OSDN Git Service

print-manager: removing it, use the web browser interface instead
authorIvailo Monev <xakepa10@gmail.com>
Mon, 14 Mar 2022 06:03:06 +0000 (08:03 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 14 Mar 2022 06:03:06 +0000 (08:03 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
141 files changed:
CMakeLists.txt
appveyor.yml
print-manager/CMakeLists.txt [deleted file]
print-manager/COPYING [deleted file]
print-manager/Messages.sh [deleted file]
print-manager/README [deleted file]
print-manager/add-printer/AddPrinter.cpp [deleted file]
print-manager/add-printer/AddPrinter.h [deleted file]
print-manager/add-printer/AddPrinterAssistant.cpp [deleted file]
print-manager/add-printer/AddPrinterAssistant.h [deleted file]
print-manager/add-printer/CMakeLists.txt [deleted file]
print-manager/add-printer/ChooseLpd.cpp [deleted file]
print-manager/add-printer/ChooseLpd.h [deleted file]
print-manager/add-printer/ChooseLpd.ui [deleted file]
print-manager/add-printer/ChooseSamba.cpp [deleted file]
print-manager/add-printer/ChooseSamba.h [deleted file]
print-manager/add-printer/ChooseSamba.ui [deleted file]
print-manager/add-printer/ChooseSerial.cpp [deleted file]
print-manager/add-printer/ChooseSerial.h [deleted file]
print-manager/add-printer/ChooseSerial.ui [deleted file]
print-manager/add-printer/ChooseSocket.cpp [deleted file]
print-manager/add-printer/ChooseSocket.h [deleted file]
print-manager/add-printer/ChooseSocket.ui [deleted file]
print-manager/add-printer/ChooseUri.cpp [deleted file]
print-manager/add-printer/ChooseUri.h [deleted file]
print-manager/add-printer/ChooseUri.ui [deleted file]
print-manager/add-printer/DevicesModel.cpp [deleted file]
print-manager/add-printer/DevicesModel.h [deleted file]
print-manager/add-printer/GenericPage.cpp [deleted file]
print-manager/add-printer/GenericPage.h [deleted file]
print-manager/add-printer/PageAddPrinter.cpp [deleted file]
print-manager/add-printer/PageAddPrinter.h [deleted file]
print-manager/add-printer/PageAddPrinter.ui [deleted file]
print-manager/add-printer/PageChoosePPD.cpp [deleted file]
print-manager/add-printer/PageChoosePPD.h [deleted file]
print-manager/add-printer/PageChoosePPD.ui [deleted file]
print-manager/add-printer/PageChoosePrinters.cpp [deleted file]
print-manager/add-printer/PageChoosePrinters.h [deleted file]
print-manager/add-printer/PageChoosePrinters.ui [deleted file]
print-manager/add-printer/PageDestinations.cpp [deleted file]
print-manager/add-printer/PageDestinations.h [deleted file]
print-manager/add-printer/PageDestinations.ui [deleted file]
print-manager/add-printer/main.cpp [deleted file]
print-manager/config.h.cmake [deleted file]
print-manager/configure-printer/CMakeLists.txt [deleted file]
print-manager/configure-printer/ConfigureDialog.cpp [deleted file]
print-manager/configure-printer/ConfigureDialog.h [deleted file]
print-manager/configure-printer/ConfigurePrinter.cpp [deleted file]
print-manager/configure-printer/ConfigurePrinter.h [deleted file]
print-manager/configure-printer/ConfigurePrinterInterface.cpp [deleted file]
print-manager/configure-printer/ConfigurePrinterInterface.h [deleted file]
print-manager/configure-printer/ModifyPrinter.cpp [deleted file]
print-manager/configure-printer/ModifyPrinter.h [deleted file]
print-manager/configure-printer/ModifyPrinter.ui [deleted file]
print-manager/configure-printer/PrinterBehavior.cpp [deleted file]
print-manager/configure-printer/PrinterBehavior.h [deleted file]
print-manager/configure-printer/PrinterBehavior.ui [deleted file]
print-manager/configure-printer/PrinterOptions.cpp [deleted file]
print-manager/configure-printer/PrinterOptions.h [deleted file]
print-manager/configure-printer/PrinterOptions.ui [deleted file]
print-manager/configure-printer/PrinterPage.cpp [deleted file]
print-manager/configure-printer/PrinterPage.h [deleted file]
print-manager/configure-printer/main.cpp [deleted file]
print-manager/configure-printer/org.kde.ConfigurePrinter.service.in [deleted file]
print-manager/configure-printer/org.kde.ConfigurePrinter.xml [deleted file]
print-manager/declarative-plugins/CMakeLists.txt [deleted file]
print-manager/declarative-plugins/qmldir [deleted file]
print-manager/declarative-plugins/qmlplugins.cpp [deleted file]
print-manager/declarative-plugins/qmlplugins.h [deleted file]
print-manager/libkcups/CMakeLists.txt [deleted file]
print-manager/libkcups/ClassListWidget.cpp [deleted file]
print-manager/libkcups/ClassListWidget.h [deleted file]
print-manager/libkcups/JobModel.cpp [deleted file]
print-manager/libkcups/JobModel.h [deleted file]
print-manager/libkcups/JobSortFilterModel.cpp [deleted file]
print-manager/libkcups/JobSortFilterModel.h [deleted file]
print-manager/libkcups/KCupsConnection.cpp [deleted file]
print-manager/libkcups/KCupsConnection.h [deleted file]
print-manager/libkcups/KCupsJob.cpp [deleted file]
print-manager/libkcups/KCupsJob.h [deleted file]
print-manager/libkcups/KCupsPasswordDialog.cpp [deleted file]
print-manager/libkcups/KCupsPasswordDialog.h [deleted file]
print-manager/libkcups/KCupsPrinter.cpp [deleted file]
print-manager/libkcups/KCupsPrinter.h [deleted file]
print-manager/libkcups/KCupsRequest.cpp [deleted file]
print-manager/libkcups/KCupsRequest.h [deleted file]
print-manager/libkcups/KCupsServer.cpp [deleted file]
print-manager/libkcups/KCupsServer.h [deleted file]
print-manager/libkcups/KIppRequest.cpp [deleted file]
print-manager/libkcups/KIppRequest.h [deleted file]
print-manager/libkcups/KIppRequest_p.h [deleted file]
print-manager/libkcups/NoSelectionRectDelegate.cpp [deleted file]
print-manager/libkcups/NoSelectionRectDelegate.h [deleted file]
print-manager/libkcups/PPDModel.cpp [deleted file]
print-manager/libkcups/PPDModel.h [deleted file]
print-manager/libkcups/PrinterModel.cpp [deleted file]
print-manager/libkcups/PrinterModel.h [deleted file]
print-manager/libkcups/PrinterSortFilterModel.cpp [deleted file]
print-manager/libkcups/PrinterSortFilterModel.h [deleted file]
print-manager/libkcups/SelectMakeModel.cpp [deleted file]
print-manager/libkcups/SelectMakeModel.h [deleted file]
print-manager/libkcups/SelectMakeModel.ui [deleted file]
print-manager/plasmoid/CMakeLists.txt [deleted file]
print-manager/plasmoid/KPrintManagerConfigPlugin.cpp [deleted file]
print-manager/plasmoid/KPrintManagerConfigPlugin.h [deleted file]
print-manager/plasmoid/package/contents/config/main.xml [deleted file]
print-manager/plasmoid/package/contents/ui/CompactRepresentation.qml [deleted file]
print-manager/plasmoid/package/contents/ui/JobItem.qml [deleted file]
print-manager/plasmoid/package/contents/ui/NIHSwitch.qml [deleted file]
print-manager/plasmoid/package/contents/ui/PrinterItem.qml [deleted file]
print-manager/plasmoid/package/contents/ui/ScrollableListView.qml [deleted file]
print-manager/plasmoid/package/contents/ui/StatusView.qml [deleted file]
print-manager/plasmoid/package/contents/ui/config.ui [deleted file]
print-manager/plasmoid/package/contents/ui/printmanager.qml [deleted file]
print-manager/plasmoid/package/contents/ui/private/RoundShadow.qml [deleted file]
print-manager/plasmoid/package/metadata.desktop [deleted file]
print-manager/print-manager-kded/CMakeLists.txt [deleted file]
print-manager/print-manager-kded/NewPrinterNotification.cpp [deleted file]
print-manager/print-manager-kded/NewPrinterNotification.h [deleted file]
print-manager/print-manager-kded/PrintManagerKded.cpp [deleted file]
print-manager/print-manager-kded/PrintManagerKded.h [deleted file]
print-manager/print-manager-kded/com.redhat.NewPrinterNotification.xml [deleted file]
print-manager/print-manager-kded/printmanager.desktop [deleted file]
print-manager/print-manager-kded/printmanager.notifyrc [deleted file]
print-manager/printer-manager-kcm/CMakeLists.txt [deleted file]
print-manager/printer-manager-kcm/PrintKCM.cpp [deleted file]
print-manager/printer-manager-kcm/PrintKCM.h [deleted file]
print-manager/printer-manager-kcm/PrintKCM.ui [deleted file]
print-manager/printer-manager-kcm/PrinterDelegate.cpp [deleted file]
print-manager/printer-manager-kcm/PrinterDelegate.h [deleted file]
print-manager/printer-manager-kcm/PrinterDescription.cpp [deleted file]
print-manager/printer-manager-kcm/PrinterDescription.h [deleted file]
print-manager/printer-manager-kcm/PrinterDescription.ui [deleted file]
print-manager/printer-manager-kcm/kcm_printer_manager.desktop [deleted file]
print-manager/printqueue/CMakeLists.txt [deleted file]
print-manager/printqueue/PrintQueue.cpp [deleted file]
print-manager/printqueue/PrintQueue.h [deleted file]
print-manager/printqueue/PrintQueueUi.cpp [deleted file]
print-manager/printqueue/PrintQueueUi.h [deleted file]
print-manager/printqueue/PrintQueueUi.ui [deleted file]
print-manager/printqueue/main.cpp [deleted file]

index 67ac1fc..dbc2310 100644 (file)
@@ -53,7 +53,6 @@ macro_optional_add_subdirectory(kuser)
 macro_optional_add_subdirectory(kvkbd)
 macro_optional_add_subdirectory(okular)
 macro_optional_add_subdirectory(partitionmanager)
-macro_optional_add_subdirectory(print-manager)
 macro_optional_add_subdirectory(skanlite)
 macro_optional_add_subdirectory(thumbnailers)
 macro_optional_add_subdirectory(yakuake)
index 29c8f1a..c6884b1 100644 (file)
@@ -21,7 +21,7 @@ build_script:
     sudo apt-get install -qq cmake katie-dev katana-baseapps \
         katana-workspace xorg-dev zlib1g-dev libgpgme-dev \
         libacl1-dev libattr1-dev libarchive-dev libasound2-dev libatasmart-dev \
-        libavcodec-dev libavformat-dev libavutil-dev libblkid-dev libcups2-dev \
+        libavcodec-dev libavformat-dev libavutil-dev libblkid-dev \
         libdjvulibre-dev libepub-dev libexiv2-dev libfreetype6-dev \
         libgcrypt20-dev libgettextpo-dev libgmp-dev libmms-dev libparted-dev \
         libqalculate-dev libsane-dev libspectre-dev libspeechd-dev \
diff --git a/print-manager/CMakeLists.txt b/print-manager/CMakeLists.txt
deleted file mode 100644 (file)
index 25de73f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-project(print-manager)
-
-if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
-    find_package(KDE4 4.21.0 REQUIRED)
-    include(KDE4Defaults)
-    include_directories(${KDE4_INCLUDES})
-    add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
-endif()
-
-find_package(Cups "1.5" REQUIRED)
-include(MacroLibrary)
-
-# Print-Manager version
-set(PM_VERSION "0.3.0" CACHE STRING "Print Manager version")
-
-# Generate config.h
-configure_file(
-    ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/config.h
-)
-
-include_directories(
-    ${CMAKE_SOURCE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_BINARY_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/libkcups
-    ${CUPS_INCLUDE_DIR}
-)
-
-add_subdirectory(libkcups)
-add_subdirectory(configure-printer)
-add_subdirectory(add-printer)
-add_subdirectory(printer-manager-kcm)
-add_subdirectory(printqueue)
-add_subdirectory(print-manager-kded)
-add_subdirectory(plasmoid)
-add_subdirectory(declarative-plugins)
diff --git a/print-manager/COPYING b/print-manager/COPYING
deleted file mode 100644 (file)
index d159169..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/print-manager/Messages.sh b/print-manager/Messages.sh
deleted file mode 100644 (file)
index acf11d8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /usr/bin/env bash
-$EXTRACTRC `find . -name "*.rc" -o -name "*.ui" | grep -v "plasmoid"` >> rc.cpp
-$XGETTEXT `find . -name "*.cpp" | grep -v "plasmoid"` -o $podir/print-manager.pot
-rm -f rc.cpp
-
-$EXTRACTRC `find plasmoid -name "*.rc" -o -name "*.ui"` >> rc.cpp
-$XGETTEXT rc.cpp `find plasmoid -name "*.cpp"` -o $podir/plasma_applet_org.kde.printmanager.pot
-$XGETTEXT `find plasmoid -name "*.qml"` -j -L Java -o $podir/plasma_applet_org.kde.printmanager.pot
diff --git a/print-manager/README b/print-manager/README
deleted file mode 100644 (file)
index 8637353..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-This project aims to be a full replacement for the
-current printing management of KDE.
-
-* It should be small and fast
-* Simple and functional
-* Very well integrated
-
-printd - contains a kded module that checks for user print jobs and shows a systray icon
- --TODO
-  - Integrate with PackageKit, talking to PK is easy
-    the hard part is understand what s-c-p does.
-
-printqueue - contains an application that show the printers queue
-
-printer-manager-kcm - configure printers in a very simple way
-
-add-printer - a wizard to add new printers
- --TODO
-  - Search for windows printers using samba
-  - Guess the print queue for some kind of printers
-
-plasmoid - show printers and it's jobs
- --TODO
-  - Move the jobs dataengine to a QML plugin
-    so we can load all jobs and still be fast
diff --git a/print-manager/add-printer/AddPrinter.cpp b/print-manager/add-printer/AddPrinter.cpp
deleted file mode 100644 (file)
index fca9ea6..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "AddPrinter.h"
-
-#include "AddPrinterAssistant.h"
-
-#include <KCupsRequest.h>
-
-#include <QPointer>
-#include <KWindowSystem>
-
-#include <KDebug>
-
-AddPrinter::AddPrinter() :
-    KApplication()
-{
-    setQuitOnLastWindowClosed(true);
-}
-
-AddPrinter::~AddPrinter()
-{
-}
-
-void AddPrinter::addPrinter(qulonglong wid)
-{
-    AddPrinterAssistant *wizard = new AddPrinterAssistant();
-    wizard->initAddPrinter();
-    show(wizard, wid);
-}
-
-void AddPrinter::addClass(qulonglong wid)
-{
-    AddPrinterAssistant *wizard = new AddPrinterAssistant();
-    wizard->initAddClass();
-    show(wizard, wid);
-}
-
-void AddPrinter::changePPD(qulonglong wid, const QString &name)
-{
-    // Fist we need to get the printer attributes
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    QStringList attr;
-    attr << KCUPS_PRINTER_TYPE; // needed to know if it's a remote printer
-    attr << KCUPS_PRINTER_MAKE_AND_MODEL;
-    attr << KCUPS_DEVICE_URI;
-    request->getPrinterAttributes(name, false, attr);
-    request->waitTillFinished();
-    if (request) {
-        if (!request->hasError() && request->printers().size() == 1) {
-            KCupsPrinter printer = request->printers().first();
-            if (printer.type() & CUPS_PRINTER_REMOTE) {
-                kWarning() << "Ignoring request, can not change PPD of remote printer" << name;
-            } else {
-                AddPrinterAssistant *wizard = new AddPrinterAssistant();
-                wizard->initChangePPD(name, printer.deviceUri(), printer.makeAndModel());
-                show(wizard, wid);
-            }
-        } else {
-            kWarning() << "Ignoring request, printer not found" << name << request->errorMsg();
-        }
-        request->deleteLater();
-    }
-}
-
-void AddPrinter::newPrinterFromDevice(qulonglong wid, const QString &name, const QString &device_id)
-{
-    // Example of data
-    // "direct"
-    // "MFG:Samsung;CMD:GDI;MDL:SCX-4200 Series;CLS:PRINTER;MODE:PCL;STATUS:IDLE;"
-    // "Samsung SCX-4200 Series"
-    // "Samsung SCX-4200 Series"
-    // "usb://Samsung/SCX-4200%20Series"
-    // ""
-
-    //        printer = "Samsung SCX-3400 Series";
-    //        deviceId = "MFG:Samsung;CMD:SPL,FWV,PIC,BDN,EXT;MDL:SCX-3400 Series;CLS:PRINTER;MODE:SCN,SPL3,R000105;STATUS:BUSY;";
-
-    //        printer = "Samsung SCX-4200 Series";
-    //        deviceId = "MFG:Samsung;CMD:GDI;MDL:SCX-4200 Series;CLS:PRINTER;MODE:PCL;STATUS:IDLE;";
-
-    //        printer = "HP PSC 1400 series";
-    //        deviceId = "MFG:HP;MDL:PSC 1400 series;DES:;CMD:LDL,MLC,PML,DYN;";
-
-    AddPrinterAssistant *wizard = new AddPrinterAssistant();
-    wizard->initAddPrinter(name, device_id);
-    show(wizard, wid);
-}
-
-void AddPrinter::show(QWidget *widget, qulonglong wid) const
-{
-    widget->show();
-    KWindowSystem::forceActiveWindow(widget->winId());
-    KWindowSystem::setMainWindow(widget, wid);
-}
diff --git a/print-manager/add-printer/AddPrinter.h b/print-manager/add-printer/AddPrinter.h
deleted file mode 100644 (file)
index 9f36f0a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef ADDPRINTER_H
-#define ADDPRINTER_H
-
-#include <KApplication>
-
-class AddPrinterInterface;
-class AddPrinter : public KApplication
-{
-    Q_OBJECT
-public:
-    AddPrinter();
-    virtual ~AddPrinter();
-
-    /**
-     * This method allows to browse discovered printers and add them
-     */
-    void addPrinter(qulonglong wid);
-
-    /**
-     * This method allows to browse printers and create a class
-     */
-    void addClass(qulonglong wid);
-
-    /**
-     * This method allows to change the PPD of an existing printer
-     */
-    void changePPD(qulonglong wid, const QString &name);
-
-    /**
-     * This method allows to browse the PPD list,
-     * and adding the printer described by device_id
-     */
-    void newPrinterFromDevice(qulonglong wid, const QString &name, const QString &device_id);
-
-private:
-    void show(QWidget *widget, qulonglong wid) const;
-
-    AddPrinterInterface *m_pqInterface;
-};
-
-#endif //ADDPRINTER_H
diff --git a/print-manager/add-printer/AddPrinterAssistant.cpp b/print-manager/add-printer/AddPrinterAssistant.cpp
deleted file mode 100644 (file)
index 7e816a3..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "AddPrinterAssistant.h"
-
-#include "PageDestinations.h"
-#include "PageChoosePrinters.h"
-#include "PageChoosePPD.h"
-#include "PageAddPrinter.h"
-
-#include <QHostInfo>
-
-#include <KCupsRequest.h>
-
-#include <KLocale>
-#include <KPushButton>
-#include <KPixmapSequence>
-
-#include <KDebug>
-
-AddPrinterAssistant::AddPrinterAssistant() :
-    KAssistantDialog(),
-    m_devicesPage(0),
-    m_chooseClassPage(0),
-    m_choosePPDPage(0),
-    m_addPrinterPage(0)
-{
-    setWindowTitle(i18nc("@title:window", "Add a New Printer"));
-    setWindowIcon(KIcon("printer"));
-    showButton(KDialog::Cancel, false);
-    setDefaultButton(KDialog::User2); // next
-    setDefaultButton(KDialog::User1); // finished
-    // Needed so we have our dialog size saved
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    // Configure the help button to be flat, disabled and empty
-    button(KDialog::Help)->setFlat(true);
-    button(KDialog::Help)->setEnabled(false);
-    button(KDialog::Help)->setIcon(QIcon());
-    button(KDialog::Help)->setText(QString());
-
-    // Setup the busy cursor
-    m_busySeq = new KPixmapSequenceOverlayPainter(this);
-    m_busySeq->setSequence(KPixmapSequence("process-working", KIconLoader::SizeSmallMedium));
-    m_busySeq->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
-    m_busySeq->setWidget(button(KDialog::Help));
-
-    // Restore the dialog size
-    KConfig config("print-manager");
-    KConfigGroup configGroup(&config, "AddPrinterAssistant");
-    restoreDialogSize(configGroup);
-}
-
-AddPrinterAssistant::~AddPrinterAssistant()
-{
-    KConfig config("print-manager");
-    KConfigGroup configGroup(&config, "AddPrinterAssistant");
-    saveDialogSize(configGroup);
-}
-
-void AddPrinterAssistant::initAddPrinter(const QString &printer, const QString &deviceId)
-{
-    // setup our hash args with the information if we are
-    // adding a new printer or a class
-    QVariantHash args;
-    args[ADDING_PRINTER] = true;
-
-    KPageWidgetItem *currentPage;
-    if (deviceId.isNull()) {
-        m_devicesPage = new KPageWidgetItem(new PageDestinations(args), i18nc("@title:window", "Select a Printer to Add"));
-        addPage(m_devicesPage);
-        currentPage = m_devicesPage;
-
-        m_choosePPDPage = new KPageWidgetItem(new PageChoosePPD, i18nc("@title:window", "Pick a Driver"));
-        addPage(m_choosePPDPage);
-    } else {
-        args[KCUPS_DEVICE_URI] = printer;
-        args[KCUPS_DEVICE_ID] = deviceId;
-        args[KCUPS_DEVICE_LOCATION] = QHostInfo::localHostName();
-
-        m_choosePPDPage = new KPageWidgetItem(new PageChoosePPD(args), i18nc("@title:window", "Pick a Driver"));
-        addPage(m_choosePPDPage);
-        currentPage = m_choosePPDPage;
-    }
-
-    m_addPrinterPage = new KPageWidgetItem(new PageAddPrinter, i18nc("@title:window", "Please describe you printer"));
-    addPage(m_addPrinterPage);
-
-    // Set this later so that all m_*Pages are created
-    setCurrentPage(currentPage);
-}
-
-void AddPrinterAssistant::initAddClass()
-{
-    // setup our hash args with the information if we are
-    // adding a new printer or a class
-    QVariantHash args;
-    args[ADDING_PRINTER] = false;
-    args[KCUPS_DEVICE_LOCATION] = QHostInfo::localHostName();
-
-    KPageWidgetItem *currentPage;
-    m_chooseClassPage = new KPageWidgetItem(new PageChoosePrinters(args), i18nc("@title:window", "Configure your connection"));
-    addPage(m_chooseClassPage);
-    currentPage = m_chooseClassPage;
-
-    m_addPrinterPage = new KPageWidgetItem(new PageAddPrinter, i18nc("@title:window", "Please describe you printer"));
-    addPage(m_addPrinterPage);
-
-    // Set this later so that all m_*Pages are created
-    setCurrentPage(currentPage);
-}
-
-void AddPrinterAssistant::initChangePPD(const QString &printer, const QString &deviceUri, const QString &makeAndModel)
-{
-    // setup our hash args with the information if we are
-    // adding a new printer or a class
-    QVariantHash args;
-    args[ADDING_PRINTER] = true;
-    args[KCUPS_DEVICE_URI] = deviceUri;
-    args[KCUPS_PRINTER_NAME] = printer;
-    args[KCUPS_PRINTER_MAKE_AND_MODEL] = makeAndModel;
-
-    m_choosePPDPage = new KPageWidgetItem(new PageChoosePPD(args), i18nc("@title:window", "Pick a Driver"));
-    addPage(m_choosePPDPage);
-    setCurrentPage(m_choosePPDPage);
-}
-
-void AddPrinterAssistant::back()
-{
-    KAssistantDialog::back();
-    GenericPage *currPage;
-    currPage = qobject_cast<GenericPage*>(currentPage()->widget());
-    enableNextButton(currPage->canProceed());
-    if (!qobject_cast<GenericPage*>(currentPage()->widget())->isValid()) {
-        back();
-    }
-}
-
-void AddPrinterAssistant::next()
-{
-    next(currentPage());
-}
-
-void AddPrinterAssistant::next(KPageWidgetItem *currentPage)
-{
-    // Each page has all it's settings and previous pages
-    // settings stored, so when going backwards
-    // we don't set (or even unset values),
-    // and we only call setValues on the next page if
-    // the currentPage() has changes.
-    QVariantHash args = qobject_cast<GenericPage*>(currentPage->widget())->values();
-    if (currentPage == m_devicesPage) {
-        qobject_cast<GenericPage*>(m_choosePPDPage->widget())->setValues(args);
-        setCurrentPage(m_choosePPDPage);
-    } else if (currentPage == m_chooseClassPage ||currentPage == m_choosePPDPage) {
-        qobject_cast<GenericPage*>(m_addPrinterPage->widget())->setValues(args);
-        setCurrentPage(m_addPrinterPage);
-    }
-}
-
-void AddPrinterAssistant::setCurrentPage(KPageWidgetItem *page)
-{
-    // if after setting the values the page is still valid show
-    // it up, if not call next with it so we can find the next page
-    if (qobject_cast<GenericPage*>(page->widget())->isValid()) {
-        KAssistantDialog::setCurrentPage(page);
-        GenericPage *currPage = qobject_cast<GenericPage*>(currentPage()->widget());
-        GenericPage *nextPage = qobject_cast<GenericPage*>(page->widget());
-        // Disconnect the current page slots
-        disconnect(currPage, SIGNAL(allowProceed(bool)), this, SLOT(enableNextButton(bool)));
-        disconnect(currPage, SIGNAL(allowProceed(bool)), this, SLOT(enableFinishButton(bool)));
-        disconnect(currPage, SIGNAL(startWorking()), m_busySeq, SLOT(start()));
-        disconnect(currPage, SIGNAL(stopWorking()), m_busySeq, SLOT(stop()));
-        disconnect(currPage, SIGNAL(proceed()), this, SLOT(next()));
-
-        // Connect next page signals
-        connect(currPage, SIGNAL(startWorking()), m_busySeq, SLOT(start()));
-        connect(currPage, SIGNAL(stopWorking()), m_busySeq, SLOT(stop()));
-        connect(nextPage, SIGNAL(proceed()), this, SLOT(next()));
-
-        // check the working property
-        if (nextPage->isWorking()) {
-            m_busySeq->start();
-        } else {
-            m_busySeq->stop();
-        }
-
-        // When ChangePPD() is called addPrinterPage is zero
-        if (page == m_addPrinterPage || m_addPrinterPage == 0) {
-            connect(nextPage, SIGNAL(allowProceed(bool)), this, SLOT(enableFinishButton(bool)));
-            enableNextButton(false);
-            enableFinishButton(nextPage->canProceed());
-        } else {
-            connect(nextPage, SIGNAL(allowProceed(bool)), this, SLOT(enableNextButton(bool)));
-            enableNextButton(nextPage->canProceed());
-        }
-    } else {
-        // In case page is not valid try the next one
-        next(page);
-    }
-}
-
-void AddPrinterAssistant::showEvent(QShowEvent *event)
-{
-    KAssistantDialog::showEvent(event);
-    enableNextButton(false);
-    enableFinishButton(false);
-}
-
-void AddPrinterAssistant::slotButtonClicked(int button)
-{
-    // Finish Button
-    if (button == KDialog::User1) {
-        GenericPage *page = qobject_cast<GenericPage*>(currentPage()->widget());
-        enableFinishButton(false);
-        if (page->finishClicked()) {
-            KAssistantDialog::slotButtonClicked(button);
-        } else {
-            enableFinishButton(true);
-        }
-    } else {
-        KAssistantDialog::slotButtonClicked(button);
-    }
-}
-
-void AddPrinterAssistant::enableNextButton(bool enable)
-{
-    enableButton(KDialog::User2, enable);
-}
-
-void AddPrinterAssistant::enableFinishButton(bool enable)
-{
-    enableButton(KDialog::User1, enable);
-}
diff --git a/print-manager/add-printer/AddPrinterAssistant.h b/print-manager/add-printer/AddPrinterAssistant.h
deleted file mode 100644 (file)
index 2516c3f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef ADD_PRINTER_ASSISTANT_H
-#define ADD_PRINTER_ASSISTANT_H
-
-#include <KAssistantDialog>
-
-#include <KPixmapSequenceOverlayPainter>
-
-class AddPrinterAssistant : public KAssistantDialog
-{
-    Q_OBJECT
-public:
-    AddPrinterAssistant();
-    virtual ~AddPrinterAssistant();
-
-    void initAddPrinter(const QString &printer = QString(), const QString &deviceId = QString());
-    void initAddClass();
-    void initChangePPD(const QString &printer, const QString &deviceUri, const QString &makeAndModel);
-
-public slots:
-    void back();
-    void next();
-    void enableNextButton(bool enable);
-    void enableFinishButton(bool enable);
-    void slotButtonClicked(int button);
-
-private:
-    void next(KPageWidgetItem *currentPage);
-    void setCurrentPage(KPageWidgetItem *page);
-    virtual void showEvent(QShowEvent * event);
-
-    KPageWidgetItem *m_devicesPage;
-    KPageWidgetItem *m_chooseClassPage;
-    KPageWidgetItem *m_choosePPDPage;
-    KPageWidgetItem *m_addPrinterPage;
-    KPixmapSequenceOverlayPainter *m_busySeq;
-};
-
-#endif
diff --git a/print-manager/add-printer/CMakeLists.txt b/print-manager/add-printer/CMakeLists.txt
deleted file mode 100644 (file)
index b1d2c5c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-find_package(KDE4Internal REQUIRED)
-
-set(addprinter_SRCS
-    main.cpp
-    AddPrinter.cpp
-    DevicesModel.cpp
-    GenericPage.cpp
-    PageDestinations.cpp
-    ChooseLpd.cpp
-    ChooseSamba.cpp
-    ChooseSerial.cpp
-    ChooseSocket.cpp
-    ChooseUri.cpp
-    PageChoosePrinters.cpp
-    PageChoosePPD.cpp
-    PageAddPrinter.cpp
-    AddPrinterAssistant.cpp
-    PageDestinations.ui
-    ChooseLpd.ui
-    ChooseSamba.ui
-    ChooseSerial.ui
-    ChooseSocket.ui
-    ChooseUri.ui
-    PageChoosePrinters.ui
-    PageChoosePPD.ui
-    PageAddPrinter.ui
-)
-
-add_executable(kde-add-printer
-    ${addprinter_SRCS}
-)
-
-target_link_libraries(kde-add-printer
-    ${KDE4_KDEUI_LIBS}
-    ${QT_QTNETWORK_LIBRARY}
-    ${KDE4_KIO_LIBS}
-    kcupslib
-)
-
-install(TARGETS kde-add-printer DESTINATION ${KDE4_BIN_INSTALL_DIR})
diff --git a/print-manager/add-printer/ChooseLpd.cpp b/print-manager/add-printer/ChooseLpd.cpp
deleted file mode 100644 (file)
index 7f4b326..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ChooseLpd.h"
-#include "ui_ChooseLpd.h"
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-
-#include <KDebug>
-#include <KLocale>
-
-ChooseLpd::ChooseLpd(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_ChooseLpd),
-    m_isValid(false)
-{
-    ui->setupUi(this);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-}
-
-ChooseLpd::~ChooseLpd()
-{
-    delete ui;
-}
-
-void ChooseLpd::on_addressLE_textChanged(const QString &text)
-{
-    kDebug() << text;
-}
-
-void ChooseLpd::setValues(const QVariantHash &args)
-{
-    m_args = args;
-    QString deviceUri = args[KCUPS_DEVICE_URI].toString();
-    kDebug() << deviceUri;
-    if (deviceUri.contains(QLatin1Char('/'))) {
-        m_isValid = false;
-        return;
-    }
-    m_isValid = true;
-
-    ui->addressLE->setText(deviceUri);
-    ui->addressLE->setFocus();
-}
-
-QVariantHash ChooseLpd::values() const
-{
-    QVariantHash ret = m_args;
-    ret[KCUPS_DEVICE_URI] = static_cast<QString>(QLatin1String("lpd://") + ui->addressLE->text());
-    return ret;
-}
-
-bool ChooseLpd::canProceed() const
-{
-    bool allow = false;
-    if (!ui->addressLE->text().isEmpty()) {
-        KUrl url = KUrl(QLatin1String("lpd://") + ui->addressLE->text());
-        allow = url.isValid();
-    }
-    return allow;
-}
-
-bool ChooseLpd::isValid() const
-{
-    return m_isValid;
-}
-
-void ChooseLpd::checkSelected()
-{
-//     emit allowProceed(!devicesLV->selectionModel()->selection().isEmpty());
-}
diff --git a/print-manager/add-printer/ChooseLpd.h b/print-manager/add-printer/ChooseLpd.h
deleted file mode 100644 (file)
index df07a06..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CHOOSE_LPD_H
-#define CHOOSE_LPD_H
-
-#include "GenericPage.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_ChooseLpd;
-QT_END_NAMESPACE
-
-class ChooseLpd : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit ChooseLpd(QWidget *parent = 0);
-    ~ChooseLpd();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-    bool canProceed() const;
-
-public slots:
-    void on_addressLE_textChanged(const QString &text);
-
-private slots:
-    void checkSelected();
-
-private:
-    Ui_ChooseLpd *ui;
-    bool m_isValid;
-};
-
-#endif
diff --git a/print-manager/add-printer/ChooseLpd.ui b/print-manager/add-printer/ChooseLpd.ui
deleted file mode 100644 (file)
index a8475de..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChooseLpd</class>
- <widget class="QWidget" name="ChooseLpd">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QFormLayout" name="formLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="label_2">
-     <property name="text">
-      <string>Address:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KLineEdit" name="addressLE"/>
-   </item>
-   <item row="1" column="0">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Queue:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <layout class="QHBoxLayout" name="horizontalLayout_3">
-     <item>
-      <widget class="KLineEdit" name="queueLE"/>
-     </item>
-     <item>
-      <widget class="QPushButton" name="detectPB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Detect</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/ChooseSamba.cpp b/print-manager/add-printer/ChooseSamba.cpp
deleted file mode 100644 (file)
index b98246f..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ChooseSamba.h"
-#include "ui_ChooseSamba.h"
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-
-#include <KUrl>
-#include <KDebug>
-#include <KLocale>
-
-ChooseSamba::ChooseSamba(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_ChooseSamba)
-{
-    ui->setupUi(this);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-
-    connect(ui->addressLE, SIGNAL(textChanged(QString)), this, SLOT(checkSelected()));
-    connect(ui->usernameLE, SIGNAL(textChanged(QString)), this, SLOT(checkSelected()));
-    connect(ui->passwordLE, SIGNAL(textChanged(QString)), this, SLOT(checkSelected()));
-}
-
-ChooseSamba::~ChooseSamba()
-{
-    delete ui;
-}
-
-void ChooseSamba::setValues(const QVariantHash &args)
-{
-    m_args = args;
-    ui->addressLE->setFocus();
-}
-
-QVariantHash ChooseSamba::values() const
-{
-    QVariantHash ret = m_args;
-
-    QString address = ui->addressLE->text().trimmed();
-    KUrl url;
-    if (address.startsWith(QLatin1String("//"))) {
-        url = QLatin1String("smb:") + address;
-    } else if (address.startsWith(QLatin1String("/"))) {
-        url = QLatin1String("smb:/") + address;
-    } else if (address.startsWith(QLatin1String("://"))) {
-        url = QLatin1String("smb") + address;
-    } else if (address.startsWith(QLatin1String("smb://"))) {
-        url = address;
-    } else if (!KUrl(address).protocol().isEmpty() &&
-               KUrl(address).protocol() != QLatin1String("smb")) {
-        url = address;
-        url.setProtocol(QLatin1String("smb"));
-    } else {
-        url = QLatin1String("smb://") + address;
-    }
-
-    kDebug() << 1 << url;
-    if (!ui->usernameLE->text().isEmpty()) {
-        url.setUser(ui->usernameLE->text());
-    }
-
-    if (!ui->passwordLE->text().isEmpty()) {
-        url.setPass(ui->passwordLE->text());
-    }
-
-    kDebug() << 2 << url;
-    kDebug() << 3 << url.url() << url.path().section(QLatin1Char('/'), -1, -1);// same as url.fileName()
-    kDebug() << 4 << url.fileName();
-    kDebug() << 5 << url.host() << url.url().section(QLatin1Char('/'), 3, 3).toLower();
-
-    ret[KCUPS_DEVICE_URI] = url.url();
-    ret[KCUPS_DEVICE_INFO] = url.fileName();
-
-    // if there is 4 '/' means the url is like
-    // smb://group/host/printer, so the location is at a different place
-    if (url.url().count(QLatin1Char('/') == 4)) {
-        ret[KCUPS_DEVICE_LOCATION] = url.url().section(QLatin1Char('/'), 3, 3).toLower();
-    } else {
-        ret[KCUPS_DEVICE_LOCATION] = url.host();
-    }
-
-    return ret;
-}
-
-bool ChooseSamba::isValid() const
-{
-    QVariantHash args = values();
-    KUrl url(args[KCUPS_DEVICE_URI].toString());
-
-    return url.isValid() &&
-            !url.isEmpty() &&
-            !url.protocol().isEmpty() &&
-            url.hasHost() &&
-            url.hasPath() &&
-            !url.fileName().isEmpty() &&
-            url.url().count(QLatin1Char('/')) <= 4;
-}
-
-bool ChooseSamba::canProceed() const
-{
-    return isValid();
-}
-
-void ChooseSamba::load()
-{
-}
-
-void ChooseSamba::checkSelected()
-{
-    emit allowProceed(isValid());
-}
diff --git a/print-manager/add-printer/ChooseSamba.h b/print-manager/add-printer/ChooseSamba.h
deleted file mode 100644 (file)
index ec0ef11..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CHOOSE_SAMBA_H
-#define CHOOSE_SAMBA_H
-
-#include "GenericPage.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_ChooseSamba;
-QT_END_NAMESPACE
-
-class ChooseSamba : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit ChooseSamba(QWidget *parent = 0);
-    ~ChooseSamba();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-    bool canProceed() const;
-
-public slots:
-    void load();
-
-private slots:
-    void checkSelected();
-
-private:
-    Ui_ChooseSamba *ui;
-};
-
-#endif
diff --git a/print-manager/add-printer/ChooseSamba.ui b/print-manager/add-printer/ChooseSamba.ui
deleted file mode 100644 (file)
index 4b0500a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChooseSamba</class>
- <widget class="QWidget" name="ChooseSamba">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QGroupBox" name="groupBox_2">
-     <property name="title">
-      <string comment="@title:group">Windows Printer via SAMBA</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_2">
-      <item row="1" column="0" colspan="2">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string comment="@label samba URL markup example, this is preceded by a label containing smb://">smb://[workgroup/]server[:port]/printer</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0">
-       <widget class="KLineEdit" name="addressLE"/>
-      </item>
-      <item row="0" column="1">
-       <widget class="QPushButton" name="browsePB">
-        <property name="enabled">
-         <bool>false</bool>
-        </property>
-        <property name="text">
-         <string comment="@action:button">Browse</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QGroupBox" name="groupBox_3">
-     <property name="title">
-      <string comment="@title:group">Authentication</string>
-     </property>
-     <layout class="QFormLayout" name="formLayout_2">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string comment="@label:textbox">Username:</string>
-        </property>
-        <property name="buddy">
-         <cstring>usernameLE</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="KLineEdit" name="usernameLE"/>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string comment="@label:textbox">Password</string>
-        </property>
-        <property name="buddy">
-         <cstring>passwordLE</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="KLineEdit" name="passwordLE">
-        <property name="passwordMode">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="2" column="0">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>addressLE</tabstop>
-  <tabstop>usernameLE</tabstop>
-  <tabstop>passwordLE</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/ChooseSerial.cpp b/print-manager/add-printer/ChooseSerial.cpp
deleted file mode 100644 (file)
index 178990c..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ChooseSerial.h"
-#include "ui_ChooseSerial.h"
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-#include <KDebug>
-#include <KLocale>
-
-ChooseSerial::ChooseSerial(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_ChooseSerial),
-    m_rx("\\?baud=(\\d+)"),
-    m_isValid(false)
-{
-    ui->setupUi(this);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-
-    ui->parityCB->addItem(i18nc("@label:listbox", "None"), "none");
-    ui->parityCB->addItem(i18nc("@label:listbox", "Even"), "even");
-    ui->parityCB->addItem(i18nc("@label:listbox", "Odd"),  "odd");
-
-    ui->flowCB->addItem(i18nc("@label:listbox", "None"), "none");
-    ui->flowCB->addItem(i18nc("@label:listbox", "XON/XOFF (Software)"), "soft");
-    ui->flowCB->addItem(i18nc("@label:listbox", "RTS/CTS (Hardware)"),  "hard");
-    ui->flowCB->addItem(i18nc("@label:listbox", "DTR/DSR (Hardware)"),  "dtrdsr");
-}
-
-ChooseSerial::~ChooseSerial()
-{
-    delete ui;
-}
-
-bool ChooseSerial::isValid() const
-{
-    return m_isValid;
-};
-
-void ChooseSerial::setValues(const QVariantHash &args)
-{
-    m_args = args;
-    QString deviceUri = args[KCUPS_DEVICE_URI].toString();
-    if (!deviceUri.startsWith(QLatin1String("serial:"))) {
-        m_isValid = false;
-        return;
-    }
-    m_isValid = true;
-
-    static int    baudrates[] =       /* Baud rates */
-    {
-        1200,
-        2400,
-        4800,
-        9600,
-        19200,
-        38400,
-        57600,
-        115200,
-        230400,
-        460800
-    };
-
-    // Find out the max baud rate
-    int maxrate;
-    if (m_rx.indexIn(deviceUri) != -1) {
-        maxrate = m_rx.cap(1).toInt();
-    } else {
-        maxrate = 19200;
-    }
-
-    ui->baudRateCB->clear();
-    for (int i = 0; i < 10; i ++) {
-        if (baudrates[i] > maxrate) {
-            break;
-        } else {
-            ui->baudRateCB->addItem(QString::number(baudrates[i]));
-        }
-    }
-    // Set the current index to the maxrate
-    ui->baudRateCB->setCurrentIndex(ui->baudRateCB->count() - 1);
-}
-
-void ChooseSerial::load()
-{
-}
-
-QVariantHash ChooseSerial::values() const
-{
-    QVariantHash ret = m_args;
-    QString deviceUri = m_args[KCUPS_DEVICE_URI].toString();
-    int pos = deviceUri.indexOf(QLatin1Char('?'));
-    QString baudRate = ui->baudRateCB->currentText();
-    QString bits = ui->bitsCB->currentText();
-    QString parity = ui->baudRateCB->itemData(ui->baudRateCB->currentIndex()).toString();
-    QString flow = ui->flowCB->itemData(ui->flowCB->currentIndex()).toString();
-    QString replace = QString("?baud=%1+bits=%2+parity=%3+flow=%4").arg(baudRate, bits, parity, flow);
-    deviceUri.replace(pos, deviceUri.size() - pos, replace);
-    ret[KCUPS_DEVICE_URI] = deviceUri;
-    return ret;
-}
diff --git a/print-manager/add-printer/ChooseSerial.h b/print-manager/add-printer/ChooseSerial.h
deleted file mode 100644 (file)
index de83253..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CHOOSE_SERIAL_H
-#define CHOOSE_SERIAL_H
-
-#include "GenericPage.h"
-
-#include <QRegExp>
-
-QT_BEGIN_NAMESPACE
-class Ui_ChooseSerial;
-QT_END_NAMESPACE
-
-class ChooseSerial : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit ChooseSerial(QWidget *parent = 0);
-    ~ChooseSerial();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-
-public slots:
-    void load();
-
-private:
-    Ui_ChooseSerial *ui;
-    QRegExp m_rx;
-    bool m_isValid;
-};
-
-#endif
diff --git a/print-manager/add-printer/ChooseSerial.ui b/print-manager/add-printer/ChooseSerial.ui
deleted file mode 100644 (file)
index 6b9cf1a..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChooseSerial</class>
- <widget class="QWidget" name="ChooseSerial">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QFormLayout" name="formLayout">
-   <property name="formAlignment">
-    <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="label_2">
-     <property name="text">
-      <string comment="@label:listbox">Baud Rate:</string>
-     </property>
-     <property name="buddy">
-      <cstring>baudRateCB</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KComboBox" name="baudRateCB"/>
-   </item>
-   <item row="1" column="0">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string comment="@label:listbox">Parity:</string>
-     </property>
-     <property name="buddy">
-      <cstring>parityCB</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="KComboBox" name="parityCB"/>
-   </item>
-   <item row="2" column="0">
-    <widget class="QLabel" name="label_4">
-     <property name="text">
-      <string comment="@label:listbox">Data Bits:</string>
-     </property>
-     <property name="buddy">
-      <cstring>bitsCB</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="1">
-    <widget class="KComboBox" name="bitsCB">
-     <item>
-      <property name="text">
-       <string notr="true">8</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string notr="true">7</string>
-      </property>
-     </item>
-    </widget>
-   </item>
-   <item row="3" column="0">
-    <widget class="QLabel" name="label_5">
-     <property name="text">
-      <string comment="@label:listbox">Flow Control:</string>
-     </property>
-     <property name="buddy">
-      <cstring>flowCB</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <widget class="KComboBox" name="flowCB"/>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/ChooseSocket.cpp b/print-manager/add-printer/ChooseSocket.cpp
deleted file mode 100644 (file)
index 29d908c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ChooseSocket.h"
-#include "ui_ChooseSocket.h"
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-
-#include <KDebug>
-#include <KLocale>
-
-ChooseSocket::ChooseSocket(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_ChooseSocket),
-    m_isValid(false)
-{
-    ui->setupUi(this);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-}
-
-ChooseSocket::~ChooseSocket()
-{
-    delete ui;
-}
-
-void ChooseSocket::setValues(const QVariantHash &args)
-{
-    if (m_args == args) {
-        return;
-    }
-
-    m_args = args;
-    ui->addressLE->clear();
-    ui->portISB->setValue(9100);
-    QString deviceUri = args[KCUPS_DEVICE_URI].toString();
-    KUrl url = deviceUri;
-    if (url.scheme() == QLatin1String("socket")) {
-        ui->addressLE->setText(url.host());
-        ui->portISB->setValue(url.port(9100));
-    }
-    ui->addressLE->setFocus();
-
-    m_isValid = true;
-}
-
-QVariantHash ChooseSocket::values() const
-{
-    QVariantHash ret = m_args;
-    KUrl url = KUrl(QLatin1String("socket://") + ui->addressLE->text());
-    url.setPort(ui->portISB->value());
-    ret[KCUPS_DEVICE_URI] = url.prettyUrl();
-    return ret;
-}
-
-bool ChooseSocket::isValid() const
-{
-    return m_isValid;
-}
-
-bool ChooseSocket::canProceed() const
-{
-    return !ui->addressLE->text().isEmpty();
-}
-
-void ChooseSocket::on_addressLE_textChanged(const QString &text)
-{
-    Q_UNUSED(text)
-    emit allowProceed(canProceed());
-}
diff --git a/print-manager/add-printer/ChooseSocket.h b/print-manager/add-printer/ChooseSocket.h
deleted file mode 100644 (file)
index 4c1a58b..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CHOOSE_SOCKET_H
-#define CHOOSE_SOCKET_H
-
-#include "GenericPage.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_ChooseSocket;
-QT_END_NAMESPACE
-
-class ChooseSocket : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit ChooseSocket(QWidget *parent = 0);
-    ~ChooseSocket();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-    bool canProceed() const;
-
-private slots:
-    void on_addressLE_textChanged(const QString &text);
-
-private:
-    Ui_ChooseSocket *ui;
-    bool m_isValid;
-};
-
-#endif
diff --git a/print-manager/add-printer/ChooseSocket.ui b/print-manager/add-printer/ChooseSocket.ui
deleted file mode 100644 (file)
index 0385c4a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChooseSocket</class>
- <widget class="QWidget" name="ChooseSocket">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QFormLayout" name="formLayout">
-   <property name="labelAlignment">
-    <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="label_2">
-     <property name="text">
-      <string comment="@label:textbox">Address:</string>
-     </property>
-     <property name="buddy">
-      <cstring>addressLE</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KLineEdit" name="addressLE"/>
-   </item>
-   <item row="1" column="0">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string comment="@label:spinbox">Port:</string>
-     </property>
-     <property name="buddy">
-      <cstring>portISB</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="KIntSpinBox" name="portISB">
-     <property name="accelerated">
-      <bool>true</bool>
-     </property>
-     <property name="minimum">
-      <number>1</number>
-     </property>
-     <property name="maximum">
-      <number>65535</number>
-     </property>
-     <property name="value">
-      <number>9100</number>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KIntSpinBox</class>
-   <extends>QSpinBox</extends>
-   <header>knuminput.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/ChooseUri.cpp b/print-manager/add-printer/ChooseUri.cpp
deleted file mode 100644 (file)
index 0e64e50..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ChooseUri.h"
-#include "ui_ChooseUri.h"
-
-#include <KCupsRequest.h>
-#include <KUrl>
-#include <KDebug>
-#include <KLocale>
-
-ChooseUri::ChooseUri(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_ChooseUri)
-{
-    ui->setupUi(this);
-
-    ui->searchTB->setIcon(KIcon("edit-find"));
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-
-    connect(ui->addressLE, SIGNAL(textChanged(QString)), this, SLOT(checkSelected()));
-    connect(ui->addressLE, SIGNAL(returnPressed()), this, SLOT(findPrinters()));
-    connect(ui->searchTB, SIGNAL(clicked()), this, SLOT(findPrinters()));
-}
-
-ChooseUri::~ChooseUri()
-{
-    delete ui;
-}
-
-void ChooseUri::setValues(const QVariantHash &args)
-{
-    m_args = args;
-    bool visible = false;
-    KUrl url = args[KCUPS_DEVICE_URI].toString();
-    if (url.url() == QLatin1String("other")) {
-        ui->addressLE->clear();
-        visible = true;
-    } else if (url.protocol().isEmpty() && url.authority().isEmpty()) {
-        ui->addressLE->setText(url.url() + QLatin1String("://"));
-    } else {
-        ui->addressLE->setText(url.url());
-    }
-    ui->searchTB->setVisible(visible);
-    ui->addressLE->setFocus();
-}
-
-QVariantHash ChooseUri::values() const
-{
-    QVariantHash ret = m_args;
-
-    ret[KCUPS_DEVICE_URI] = parsedURL(ui->addressLE->text()).url();
-
-    return ret;
-}
-
-bool ChooseUri::isValid() const
-{
-    QVariantHash args = values();
-    KUrl url(args[KCUPS_DEVICE_URI].toString());
-//kDebug() << url << url.isValid() << url.isEmpty() << url.protocol().isEmpty() << url.hasHost();
-    return url.isValid() && !url.isEmpty() && !url.protocol().isEmpty() && url.hasHost();
-}
-
-bool ChooseUri::canProceed() const
-{
-    return isValid();
-}
-
-void ChooseUri::load()
-{
-}
-
-void ChooseUri::checkSelected()
-{
-    emit allowProceed(isValid());
-}
-
-void ChooseUri::on_addressLE_textChanged(const QString &text)
-{
-    KUrl url = parsedURL(text);
-
-    if (url.isValid() &&
-            (url.protocol().isEmpty() ||
-             url.protocol() == QLatin1String("http") ||
-             url.protocol() == QLatin1String("https") ||
-             url.protocol() == QLatin1String("ipp"))) {
-        // TODO maybe cups library can connect to more protocols
-        ui->searchTB->setEnabled(true);
-    } else {
-        ui->searchTB->setEnabled(false);
-    }
-}
-
-void ChooseUri::findPrinters()
-{
-    KUrl url = parsedURL(ui->addressLE->text());
-
-    KCupsConnection *conn = new KCupsConnection(url, this);
-    KCupsRequest *request = new KCupsRequest(conn);
-    connect(request, SIGNAL(finished()), this, SLOT(getPrintersFinished()));
-
-    QStringList attr;
-    attr << KCUPS_PRINTER_NAME;
-    attr << KCUPS_PRINTER_STATE;
-    attr << KCUPS_PRINTER_IS_SHARED;
-    attr << KCUPS_PRINTER_IS_ACCEPTING_JOBS;
-    attr << KCUPS_PRINTER_TYPE;
-    attr << KCUPS_PRINTER_LOCATION;
-    attr << KCUPS_PRINTER_INFO;
-    attr << KCUPS_PRINTER_MAKE_AND_MODEL;
-    request->setProperty("URI", url);
-
-    emit startWorking();
-    request->getPrinters(attr);
-}
-
-void ChooseUri::getPrintersFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest*>(sender());
-    KUrl uri = request->property("URI").value<KUrl>();
-    KUrl url;
-    url.setProtocol(QLatin1String("ipp"));
-    url.setAuthority(uri.authority());
-
-    KCupsPrinters printers = request->printers();
-    if (request->hasError()) {
-        emit errorMessage(request->errorMsg());
-    } else {
-        emit insertDevice("network",
-                          url.authority(),
-                          url.authority(),
-                          QString(),
-                          url.url(),
-                          QString(),
-                          printers);
-    }
-
-    request->deleteLater();
-    request->connection()->deleteLater();
-    emit stopWorking();
-}
-
-KUrl ChooseUri::parsedURL(const QString &text) const
-{
-    KUrl url(text);
-    if (url.host().isEmpty() && !text.contains(QLatin1String("://"))) {
-        url = KUrl();
-        // URI might be scsi, network on anything that didn't match before
-        if (m_args[KCUPS_DEVICE_URI].toString() != QLatin1String("other")) {
-            url.setProtocol(m_args[KCUPS_DEVICE_URI].toString());
-        }
-        url.setAuthority(text);
-    }
-    return url;
-}
diff --git a/print-manager/add-printer/ChooseUri.h b/print-manager/add-printer/ChooseUri.h
deleted file mode 100644 (file)
index 971ab64..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CHOOSE_URI_H
-#define CHOOSE_URI_H
-
-#include "GenericPage.h"
-
-#include <KCupsPrinter.h>
-
-#include <KUrl>
-
-QT_BEGIN_NAMESPACE
-class Ui_ChooseUri;
-QT_END_NAMESPACE
-
-class ChooseUri : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit ChooseUri(QWidget *parent = 0);
-    ~ChooseUri();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-    bool canProceed() const;
-
-public slots:
-    void load();
-
-signals:
-    void errorMessage(const QString &message);
-    void insertDevice(const QString &device_class,
-                      const QString &device_id,
-                      const QString &device_info,
-                      const QString &device_make_and_model,
-                      const QString &device_uri,
-                      const QString &device_location,
-                      const KCupsPrinters &grouped_printers);
-
-private slots:
-    void checkSelected();
-    void on_addressLE_textChanged(const QString &text);
-    void findPrinters();
-    void getPrintersFinished();
-
-private:
-    KUrl parsedURL(const QString &text) const;
-
-    Ui_ChooseUri *ui;
-};
-
-#endif
diff --git a/print-manager/add-printer/ChooseUri.ui b/print-manager/add-printer/ChooseUri.ui
deleted file mode 100644 (file)
index 9772343..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChooseUri</class>
- <widget class="QWidget" name="ChooseUri">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>409</width>
-    <height>252</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QFormLayout" name="formLayout">
-   <property name="fieldGrowthPolicy">
-    <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-   </property>
-   <property name="rowWrapPolicy">
-    <enum>QFormLayout::WrapLongRows</enum>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="label_2">
-     <property name="text">
-      <string comment="@label:textbox">Connection:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <layout class="QHBoxLayout" name="horizontalLayout_3">
-     <item>
-      <widget class="KLineEdit" name="addressLE"/>
-     </item>
-     <item>
-      <widget class="QToolButton" name="searchTB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="0" colspan="2">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string comment="@info">&lt;TABLE&gt;
-&lt;TR&gt;
-&lt;TD&gt;Examples:
-&lt;PRE&gt;
-    http://hostname:631/ipp/
-    http://hostname:631/ipp/port1
-
-    ipp://hostname/ipp/
-    ipp://hostname/ipp/port1
-
-    lpd://hostname/queue
-
-    socket://hostname
-    socket://hostname:9100
-&lt;/PRE&gt;
-
-&lt;P&gt;See &lt;A HREF=&quot;http://localhost:631/help/network.html&quot; TARGET=&quot;_blank&quot;&gt;&quot;Network
-Printers&quot;&lt;/A&gt; for the correct URI to use with your printer.&lt;/P&gt;
-&lt;/TD&gt;
-&lt;/TR&gt;
-&lt;/TABLE&gt;</string>
-     </property>
-     <property name="textFormat">
-      <enum>Qt::RichText</enum>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-     <property name="openExternalLinks">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/DevicesModel.cpp b/print-manager/add-printer/DevicesModel.cpp
deleted file mode 100644 (file)
index d77d096..0000000
+++ /dev/null
@@ -1,382 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "DevicesModel.h"
-
-#include <KCupsRequest.h>
-
-#include <KLocale>
-#include <KMessageBox>
-
-#include <QHostInfo>
-#include <QDBusMetaType>
-#include <QDBusConnection>
-
-#include <KDebug>
-
-DevicesModel::DevicesModel(QObject *parent)
- : QStandardItemModel(parent),
-   m_request(0),
-   m_rx("[a-z]+://.*")
-{
-    qDBusRegisterMetaType<MapSS>();
-    qDBusRegisterMetaType<MapSMapSS>();
-
-    m_blacklistedURIs << QLatin1String("hp");
-    m_blacklistedURIs << QLatin1String("hpfax");
-    m_blacklistedURIs << QLatin1String("hal");
-    m_blacklistedURIs << QLatin1String("beh");
-    m_blacklistedURIs << QLatin1String("scsi");
-    m_blacklistedURIs << QLatin1String("http");
-    m_blacklistedURIs << QLatin1String("delete");
-
-    // Adds the other device which is meant for manual URI input
-    insertDevice("other",
-                 QString(),
-                 i18nc("@item", "Manual URI"),
-                 QString(),
-                 "other",
-                 QString());
-}
-
-void DevicesModel::update()
-{
-    if (m_request) {
-        return;
-    }
-
-    // clear the model to don't duplicate items
-    if (rowCount()) {
-        removeRows(1, rowCount() - 1);
-    }
-    m_request = new KCupsRequest;
-    connect(m_request, SIGNAL(device(QString,QString,QString,QString,QString,QString)),
-            this, SLOT(gotDevice(QString,QString,QString,QString,QString,QString)));
-    connect(m_request, SIGNAL(finished()), this, SLOT(finished()));
-
-    // Get devices with 5 seconds of timeout
-    m_request->getDevices(10);
-}
-
-
-void DevicesModel::gotDevice(const QString &device_class,
-                             const QString &device_id,
-                             const QString &device_info,
-                             const QString &device_make_and_model,
-                             const QString &device_uri,
-                             const QString &device_location)
-{
-    // "direct"
-    kDebug() << device_class;
-    // "MFG:Samsung;CMD:GDI;MDL:SCX-4200 Series;CLS:PRINTER;MODE:PCL;STATUS:IDLE;"
-    kDebug() << device_id;
-    // "Samsung SCX-4200 Series"
-    kDebug() << device_info;
-    // "Samsung SCX-4200 Series"
-    kDebug() << device_make_and_model;
-    // "usb://Samsung/SCX-4200%20Series"
-    kDebug() << device_uri;
-    // ""
-    kDebug() << device_location;
-
-    if (m_blacklistedURIs.contains(device_uri)) {
-        // ignore black listed uri's
-        return;
-    }
-
-    // For the protocols, not real devices
-    if (device_id.isEmpty() &&
-            device_make_and_model == QLatin1String("Unknown")) {
-        insertDevice(device_class,
-                     device_id,
-                     device_info,
-                     device_make_and_model,
-                     device_uri,
-                     device_location);
-    } else {
-        // Map the devices so later we try to group them
-        MapSS mapSS;
-        mapSS[KCUPS_DEVICE_CLASS] = device_class;
-        mapSS[KCUPS_DEVICE_ID] = device_id;
-        mapSS[KCUPS_DEVICE_INFO] = device_info;
-        mapSS[KCUPS_DEVICE_MAKE_AND_MODEL] = device_make_and_model;
-        mapSS[KCUPS_DEVICE_LOCATION] = device_location;
-        m_mappedDevices[device_uri] = mapSS;
-    }
-}
-
-void DevicesModel::finished()
-{
-    bool hasError = m_request->hasError();
-    if (hasError) {
-        emit errorMessage(i18n("Failed to get a list of devices: '%1'", m_request->errorMsg()));
-    }
-    m_request->deleteLater();
-    m_request = 0;
-
-    if (hasError || m_mappedDevices.isEmpty()) {
-        emit loaded();
-        return;
-    }
-
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("/org/fedoraproject/Config/Printing"),
-                                             QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("GroupPhysicalDevices"));
-    message << qVariantFromValue(m_mappedDevices);
-    QDBusConnection::sessionBus().callWithCallback(message,
-                                                   this,
-                                                   SLOT(getGroupedDevicesSuccess(QDBusMessage)),
-                                                   SLOT(getGroupedDevicesFailed(QDBusError,QDBusMessage)));
-}
-
-void DevicesModel::insertDevice(const QString &device_class,
-                                const QString &device_id,
-                                const QString &device_info,
-                                const QString &device_make_and_model,
-                                const QString &device_uri,
-                                const QString &device_location,
-                                const QStringList &grouped_uris)
-{
-    QStandardItem *stdItem;
-    stdItem = createItem(device_class,
-                         device_id,
-                         device_info,
-                         device_make_and_model,
-                         device_uri,
-                         device_location,
-                         !grouped_uris.isEmpty());
-    if (!grouped_uris.isEmpty()) {
-        stdItem->setData(grouped_uris, DeviceUris);
-    }
-}
-
-void DevicesModel::insertDevice(const QString &device_class,
-                                const QString &device_id,
-                                const QString &device_info,
-                                const QString &device_make_and_model,
-                                const QString &device_uri,
-                                const QString &device_location,
-                                const KCupsPrinters &grouped_printers)
-{
-    QStandardItem *stdItem;
-    stdItem = createItem(device_class,
-                         device_id,
-                         device_info,
-                         device_make_and_model,
-                         device_uri,
-                         device_location,
-                         !grouped_printers.isEmpty());
-    if (!grouped_printers.isEmpty()) {
-        stdItem->setData(qVariantFromValue(grouped_printers), DeviceUris);
-    }
-}
-
-QStandardItem *DevicesModel::createItem(const QString &device_class,
-                                        const QString &device_id,
-                                        const QString &device_info,
-                                        const QString &device_make_and_model,
-                                        const QString &device_uri,
-                                        const QString &device_location,
-                                        bool grouped)
-{
-    // "direct"
-    kDebug() << device_class;
-    // "MFG:Samsung;CMD:GDI;MDL:SCX-4200 Series;CLS:PRINTER;MODE:PCL;STATUS:IDLE;"
-    kDebug() << device_id;
-    // "Samsung SCX-4200 Series"
-    kDebug() << device_info;
-    // "Samsung SCX-4200 Series"
-    kDebug() << device_make_and_model;
-    // "usb://Samsung/SCX-4200%20Series"
-    kDebug() << device_uri;
-    // ""
-    kDebug() << device_location;
-
-    Kind kind;
-    // Store the kind of the device
-    if (device_class == QLatin1String("network")) {
-        if (m_rx.indexIn(device_uri) > -1) {
-            kind = Networked;
-        } else {
-            // other network devices looks like
-            // just "http"
-            kind = OtherNetworked;
-        }
-    } else if (device_class == QLatin1String("other") &&
-               device_uri == QLatin1String("other")) {
-        kind = Other;
-    } else {
-        // If device class is not network assume local
-        kind = Local;
-    }
-
-    QString location;
-    if (device_location.isEmpty() && kind == Local) {
-        location = QHostInfo::localHostName();
-    } else {
-        location = device_location;
-    }
-
-    QString text;
-    if (!device_make_and_model.isEmpty() &&
-            !grouped &&
-            device_make_and_model.compare(QLatin1String("unknown"), Qt::CaseInsensitive)) {
-        text = device_info + QLatin1String(" (") + device_make_and_model + QLatin1Char(')');
-    } else {
-        text = device_info;
-    }
-
-    QString toolTip;
-    if (!grouped) {
-        if (device_uri.startsWith(QLatin1String("parallel"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "A printer connected to the parallel port");
-        } else if (device_uri.startsWith(QLatin1String("usb"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "A printer connected to a USB port");
-        } else if (device_uri.startsWith(QLatin1String("bluetooth"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "A printer connected via Bluetooth");
-        } else if (device_uri.startsWith(QLatin1String("hal"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "Local printer detected by the "
-                            "Hardware Abstraction Layer (HAL)");
-        } else if (device_uri.startsWith(QLatin1String("hp"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "HPLIP software driving a printer, "
-                            "or the printer function of a multi-function device");
-        } else if (device_uri.startsWith(QLatin1String("hpfax"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "HPLIP software driving a fax machine, "
-                            "or the fax function of a multi-function device");
-        } else if (device_uri.startsWith(QLatin1String("dnssd")) ||
-                   device_uri.startsWith(QLatin1String("mdns"))) {
-            toolTip = i18nc("@info:tooltip",
-                            "Remote CUPS printer via DNS-SD");
-        }
-    }
-
-    QStandardItem *stdItem = new QStandardItem;
-    stdItem->setText(text);
-    stdItem->setToolTip(toolTip);
-    stdItem->setData(device_class, DeviceClass);
-    stdItem->setData(device_id, DeviceId);
-    stdItem->setData(device_info, DeviceInfo);
-    stdItem->setData(device_uri, DeviceUri);
-    stdItem->setData(device_make_and_model, DeviceMakeAndModel);
-    stdItem->setData(device_location, DeviceLocation);
-
-    // Find the proper category to our item
-    QStandardItem *catItem;
-    switch (kind) {
-    case Networked:
-        catItem = findCreateCategory(i18nc("@item", "Discovered Network Printers"));
-        catItem->appendRow(stdItem);
-        break;
-    case OtherNetworked:
-        catItem = findCreateCategory(i18nc("@item", "Other Network Printers"));
-        catItem->appendRow(stdItem);
-        break;
-    case Local:
-        catItem = findCreateCategory(i18nc("@item", "Local Printers"));
-        catItem->appendRow(stdItem);
-        break;
-    default:
-        appendRow(stdItem);
-    }
-
-    return stdItem;
-}
-
-void DevicesModel::getGroupedDevicesSuccess(const QDBusMessage &message)
-{
-    if (message.type() == QDBusMessage::ReplyMessage && message.arguments().size() == 1) {
-        QDBusArgument argument;
-        argument = message.arguments().first().value<QDBusArgument>();
-        QList<QStringList> groupeDevices;
-        groupeDevices = qdbus_cast<QList<QStringList> >(argument);
-        foreach (const QStringList &list, groupeDevices) {
-            if (list.isEmpty()) {
-                continue;
-            }
-
-            QString uri = list.first();
-            MapSS device = m_mappedDevices[uri];
-            insertDevice(device[KCUPS_DEVICE_CLASS],
-                         device[KCUPS_DEVICE_ID],
-                         device[KCUPS_DEVICE_INFO],
-                         device[KCUPS_DEVICE_MAKE_AND_MODEL],
-                         uri,
-                         device[KCUPS_DEVICE_LOCATION],
-                         list.size() > 1 ? list : QStringList());
-        }
-    } else {
-        kWarning() << "Unexpected message" << message;
-        groupedDevicesFallback();
-    }
-    emit loaded();
-}
-
-void DevicesModel::getGroupedDevicesFailed(const QDBusError &error, const QDBusMessage &message)
-{
-    kWarning() << error <<  message;
-    groupedDevicesFallback();
-    emit errorMessage(i18n("Failed to group devices: '%1'",error.message()));
-    emit loaded();
-}
-
-void DevicesModel::groupedDevicesFallback()
-{
-    MapSMapSS::const_iterator i = m_mappedDevices.constBegin();
-    while (i != m_mappedDevices.constEnd()) {
-        MapSS device = i.value();
-        insertDevice(device[KCUPS_DEVICE_CLASS],
-                     device[KCUPS_DEVICE_ID],
-                     device[KCUPS_DEVICE_INFO],
-                     device[KCUPS_DEVICE_MAKE_AND_MODEL],
-                     i.key(),
-                     device[KCUPS_DEVICE_LOCATION]);
-        ++i;
-    }
-}
-
-QStandardItem* DevicesModel::findCreateCategory(const QString &category)
-{
-    for (int i = 0; i < rowCount(); ++i) {
-        QStandardItem *catItem = item(i);
-        if (catItem->text() == category) {
-            return catItem;
-        }
-    }
-
-    QStandardItem *catItem = new QStandardItem(category);
-    QFont font = catItem->font();
-    font.setBold(true);
-    catItem->setFont(font);
-    catItem->setFlags(Qt::ItemIsEnabled);
-    appendRow(catItem);
-
-    // Emit the parent so the view expand the item
-    emit parentAdded(indexFromItem(catItem));
-
-    return catItem;
-}
diff --git a/print-manager/add-printer/DevicesModel.h b/print-manager/add-printer/DevicesModel.h
deleted file mode 100644 (file)
index ab38642..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef DEVICES_MODEL_H
-#define DEVICES_MODEL_H
-
-#include <QStandardItemModel>
-#include <QDBusMessage>
-
-#include <KCupsPrinter.h>
-
-typedef QMap<QString, QString> MapSS;
-typedef QMap<QString, MapSS> MapSMapSS;
-
-class KCupsRequest;
-class DevicesModel : public QStandardItemModel
-{
-    Q_OBJECT
-    Q_ENUMS(Role)
-public:
-    enum Role {
-        DeviceClass = Qt::UserRole + 2,
-        DeviceId,
-        DeviceInfo,
-        DeviceMakeAndModel,
-        DeviceUri,
-        DeviceUris,
-        DeviceLocation
-    };
-
-    enum Kind {
-        Local,
-        Networked,
-        OtherNetworked,
-        Other
-    };
-
-    explicit DevicesModel(QObject *parent = 0);
-
-signals:
-    void loaded();
-    void parentAdded(const QModelIndex &index);
-    void errorMessage(const QString &message);
-
-public slots:
-    void update();
-    void insertDevice(const QString &device_class,
-                      const QString &device_id,
-                      const QString &device_info,
-                      const QString &device_make_and_model,
-                      const QString &device_uri,
-                      const QString &device_location,
-                      const QStringList &grouped_uris = QStringList());
-    void insertDevice(const QString &device_class,
-                      const QString &device_id,
-                      const QString &device_info,
-                      const QString &device_make_and_model,
-                      const QString &device_uri,
-                      const QString &device_location,
-                      const KCupsPrinters &grouped_printers);
-
-private slots:
-    QStandardItem* createItem(const QString &device_class,
-                              const QString &device_id,
-                              const QString &device_info,
-                              const QString &device_make_and_model,
-                              const QString &device_uri,
-                              const QString &device_location,
-                              bool grouped);
-    void gotDevice(const QString &device_class,
-                   const QString &device_id,
-                   const QString &device_info,
-                   const QString &device_make_and_model,
-                   const QString &device_uri,
-                   const QString &device_location);
-    void finished();
-    void getGroupedDevicesSuccess(const QDBusMessage &message);
-    void getGroupedDevicesFailed(const QDBusError &error, const QDBusMessage &message);
-    void groupedDevicesFallback();
-
-private:
-    QStandardItem *findCreateCategory(const QString &category);
-
-    KCupsRequest *m_request;
-    MapSMapSS m_mappedDevices;
-    QRegExp m_rx;
-    QStringList m_blacklistedURIs;
-};
-
-Q_DECLARE_METATYPE(MapSS)
-Q_DECLARE_METATYPE(MapSMapSS)
-
-#endif
diff --git a/print-manager/add-printer/GenericPage.cpp b/print-manager/add-printer/GenericPage.cpp
deleted file mode 100644 (file)
index bf04764..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "GenericPage.h"
-
-GenericPage::GenericPage(QWidget *parent) :
-    QWidget(parent),
-    m_working(0)
-{
-}
-
-void GenericPage::working()
-{
-    if (m_working++ == 0) {
-        emit startWorking();
-    }
-}
-
-void GenericPage::notWorking()
-{
-    if (--m_working == 0) {
-        emit stopWorking();
-    }
-}
-
-QVariantHash GenericPage::values() const
-{
-    return m_args;
-}
-
-void GenericPage::setValues(const QVariantHash &args)
-{
-    m_args = args;
-}
diff --git a/print-manager/add-printer/GenericPage.h b/print-manager/add-printer/GenericPage.h
deleted file mode 100644 (file)
index d358c76..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef GENERIC_PAGE_H
-#define GENERIC_PAGE_H
-
-#include <QWidget>
-#include <QHash>
-#include <QVariant>
-
-#define ADDING_PRINTER         "add-new-printer"
-#define PPD_NAME               "ppd-name"
-#define FILENAME               "filename"
-
-class GenericPage : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit GenericPage(QWidget *parent = 0);
-    virtual bool canProceed() const { return true; }
-    virtual bool isValid() const { return true; }
-    virtual bool isWorking() const { return m_working; }
-    virtual void setValues(const QVariantHash &args);
-    virtual QVariantHash values() const;
-
-    virtual bool finishClicked() { return false; }
-
-signals:
-    void allowProceed(bool allow);
-    void proceed();
-    void startWorking();
-    void stopWorking();
-
-protected slots:
-    void working();
-    void notWorking();
-
-protected:
-    QVariantHash m_args;
-    int m_working;
-};
-
-#endif
diff --git a/print-manager/add-printer/PageAddPrinter.cpp b/print-manager/add-printer/PageAddPrinter.cpp
deleted file mode 100644 (file)
index 0ddeb8b..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PageAddPrinter.h"
-#include "ui_PageAddPrinter.h"
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-#include <KCategorizedSortFilterProxyModel>
-#include <KCategoryDrawer>
-#include <KDebug>
-#include <KLocale>
-#include <KIconLoader>
-
-PageAddPrinter::PageAddPrinter(QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_PageAddPrinter)
-{
-    ui->setupUi(this);
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-    // loads the standard key icon
-    QPixmap pixmap;
-    pixmap = KIconLoader::global()->loadIcon("printer",
-                                             KIconLoader::NoGroup,
-                                             KIconLoader::SizeEnormous, // a not so huge icon
-                                             KIconLoader::DefaultState);
-    QPixmap icon(pixmap);
-    QPainter painter(&icon);
-
-    pixmap = KIconLoader::global()->loadIcon("dialog-information",
-                                             KIconLoader::NoGroup,
-                                             KIconLoader::SizeLarge, // a not so huge icon
-                                             KIconLoader::DefaultState);
-    // the emblem icon to size 32
-    int overlaySize = KIconLoader::SizeLarge;
-    QPoint startPoint;
-    // bottom right corner
-    startPoint = QPoint(KIconLoader::SizeEnormous - overlaySize - 2,
-                        KIconLoader::SizeEnormous - overlaySize - 2);
-    painter.drawPixmap(startPoint, pixmap);
-    ui->printerL->setPixmap(icon);
-
-    // May contain any printable characters except "/", "#", and space
-    QRegExp rx("[^/#\\ ]*");
-    QValidator *validator = new QRegExpValidator(rx, this);
-    ui->nameLE->setValidator(validator);
-
-    // Hide the message widget
-    ui->messageWidget->setMessageType(KMessageWidget::Error);
-    ui->messageWidget->hide();
-}
-
-PageAddPrinter::~PageAddPrinter()
-{
-    delete ui;
-}
-
-void PageAddPrinter::setValues(const QVariantHash &args)
-{
-    if (m_args != args) {
-        QString name;
-        if (!args[KCUPS_PRINTER_NAME].toString().isEmpty()) {
-            name = args[KCUPS_PRINTER_NAME].toString();
-        } else if (!args[KCUPS_DEVICE_MAKE_AND_MODEL].toString().isEmpty()) {
-            name = args[KCUPS_DEVICE_MAKE_AND_MODEL].toString();
-        } else if (!args[KCUPS_DEVICE_INFO].toString().isEmpty()) {
-            name = args[KCUPS_DEVICE_INFO].toString();
-        }
-
-        if (!args[KCUPS_PRINTER_INFO].toString().isEmpty()) {
-            ui->descriptionLE->setText(args[KCUPS_PRINTER_INFO].toString());
-        } else {
-            ui->descriptionLE->setText(name);
-        }
-
-        name.replace(QLatin1Char(' '), QLatin1Char('_'));
-        name.replace(QLatin1Char('/'), QLatin1Char('-'));
-        name.replace(QLatin1Char('#'), QLatin1Char('='));
-        ui->nameLE->setText(name);
-        ui->locationLE->setText(args[KCUPS_DEVICE_LOCATION].toString());
-        ui->shareCB->setChecked(true);
-        ui->shareCB->setVisible(args[ADDING_PRINTER].toBool());
-
-        m_args = args;
-    }
-}
-
-void PageAddPrinter::load()
-{
-}
-
-bool PageAddPrinter::canProceed() const
-{
-    return !ui->nameLE->text().isEmpty();
-}
-
-bool PageAddPrinter::finishClicked()
-{
-    bool ret = false;
-    QVariantHash args = values();
-    args[KCUPS_PRINTER_IS_ACCEPTING_JOBS] = true;
-    args[KCUPS_PRINTER_STATE] = IPP_PRINTER_IDLE;
-
-    // Check if it's a printer or a class that we are adding
-    bool isClass = !args.take(ADDING_PRINTER).toBool();
-    QString destName = args[KCUPS_PRINTER_NAME].toString();
-    QString filename = args.take(FILENAME).toString();
-
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    if (isClass) {
-        request->addOrModifyClass(destName, args);
-    } else {
-        request->addOrModifyPrinter(destName, args, filename);
-    }
-    request->waitTillFinished();
-    if (request) {
-        if (request->hasError()) {
-            kDebug() << request->error() << request->errorMsg();
-            QString message;
-            if (isClass) {
-                message = i18nc("@info", "Failed to add class: '%1'", request->errorMsg());
-            } else {
-                message = i18nc("@info", "Failed to configure printer: '%1'", request->errorMsg());
-            }
-            ui->messageWidget->setText(message);
-            ui->messageWidget->animatedShow();
-        } else {
-            ret = true;
-        }
-        request->deleteLater();
-    }
-
-    return ret;
-}
-
-QVariantHash PageAddPrinter::values() const
-{
-    QVariantHash ret = m_args;
-    ret[KCUPS_PRINTER_NAME] = ui->nameLE->text();
-    ret[KCUPS_PRINTER_LOCATION] = ui->locationLE->text();
-    ret[KCUPS_PRINTER_INFO] = ui->descriptionLE->text();
-    if (ret[ADDING_PRINTER].toBool()) {
-         ret[KCUPS_PRINTER_IS_SHARED] = ui->shareCB->isChecked();
-    }
-    return ret;
-}
-
-void PageAddPrinter::on_nameLE_textChanged(const QString &text)
-{
-    emit allowProceed(!text.isEmpty());
-}
-
-void PageAddPrinter::checkSelected()
-{
-//     emit allowProceed(!devicesLV->selectionModel()->selection().isEmpty());
-}
diff --git a/print-manager/add-printer/PageAddPrinter.h b/print-manager/add-printer/PageAddPrinter.h
deleted file mode 100644 (file)
index 9aaf17c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PAGE_ADD_PRINTER_H
-#define PAGE_ADD_PRINTER_H
-
-#include "GenericPage.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_PageAddPrinter;
-QT_END_NAMESPACE
-
-class PageAddPrinter : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit PageAddPrinter(QWidget *parent = 0);
-    ~PageAddPrinter();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool canProceed() const;
-
-    bool finishClicked();
-
-public slots:
-    void load();
-
-private slots:
-    void checkSelected();
-    void on_nameLE_textChanged(const QString &text);
-
-private:
-    Ui_PageAddPrinter *ui;
-};
-
-#endif
diff --git a/print-manager/add-printer/PageAddPrinter.ui b/print-manager/add-printer/PageAddPrinter.ui
deleted file mode 100644 (file)
index a8fa3b4..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PageAddPrinter</class>
- <widget class="QWidget" name="PageAddPrinter">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="1" column="3">
-    <layout class="QFormLayout" name="formLayout">
-     <property name="fieldGrowthPolicy">
-      <enum>QFormLayout::ExpandingFieldsGrow</enum>
-     </property>
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_2">
-       <property name="text">
-        <string comment="@label:textbox">Name:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="KLineEdit" name="nameLE">
-       <property name="toolTip">
-        <string>May contain any printable characters except &quot;/&quot;, &quot;#&quot;, and space</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string comment="@label:textbox">Description:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="KLineEdit" name="descriptionLE"/>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_4">
-       <property name="text">
-        <string comment="@label:textbox">Location:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="KLineEdit" name="locationLE"/>
-     </item>
-     <item row="3" column="1">
-      <widget class="QCheckBox" name="shareCB">
-       <property name="text">
-        <string comment="@option:check">Share this printer</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="2">
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <layout class="QVBoxLayout" name="verticalLayout">
-     <property name="sizeConstraint">
-      <enum>QLayout::SetMinimumSize</enum>
-     </property>
-     <item>
-      <spacer name="verticalSpacer_3">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QLabel" name="printerL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string notr="true">printer</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
-       </property>
-       <property name="margin">
-        <number>7</number>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer_4">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="1" colspan="3">
-    <widget class="KMessageWidget" name="messageWidget" native="true"/>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KMessageWidget</class>
-   <extends>QWidget</extends>
-   <header location="global">kmessagewidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/PageChoosePPD.cpp b/print-manager/add-printer/PageChoosePPD.cpp
deleted file mode 100644 (file)
index bc97830..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PageChoosePPD.h"
-#include "ui_PageChoosePPD.h"
-
-#include "DevicesModel.h"
-
-#include <SelectMakeModel.h>
-#include <KCupsRequest.h>
-
-#include <KTemporaryFile>
-#include <KDebug>
-#include <KLocale>
-
-#include <QFileInfo>
-#include <QFile>
-
-PageChoosePPD::PageChoosePPD(const QVariantHash &args, QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_PageChoosePPD),
-    m_isValid(false)
-{
-    ui->setupUi(this);
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-
-    m_layout = new QStackedLayout;
-    m_layout->setContentsMargins(0, 0, 0, 0);
-    ui->gridLayout->addLayout(m_layout, 1, 3);
-    m_selectMM = new SelectMakeModel(this);
-    connect(m_selectMM, SIGNAL(changed(bool)), this, SLOT(checkSelected()));
-    m_layout->addWidget(m_selectMM);
-
-    // Setup the busy cursor
-    connect(m_selectMM, SIGNAL(changed(bool)), this, SLOT(notWorking()));
-
-    if (!args.isEmpty()) {
-        // set our args
-        setValues(args);
-    }
-}
-
-PageChoosePPD::~PageChoosePPD()
-{
-    removeTempPPD();
-
-    delete ui;
-}
-
-void PageChoosePPD::setValues(const QVariantHash &args)
-{
-    m_args = args;
-
-    if (args[ADDING_PRINTER].toBool()) {
-
-        kDebug() << args;
-        working();
-        removeTempPPD();
-        QString deviceId = args[KCUPS_DEVICE_ID].toString();
-        QString make;
-        QString makeAndModel = args[KCUPS_DEVICE_MAKE_AND_MODEL].toString();
-        QString deviceURI = args[KCUPS_DEVICE_URI].toString();
-
-        // If
-        KUrl url(deviceURI + QLatin1String(".ppd"));
-        if (url.protocol() == QLatin1String("ipp")) {
-            KTemporaryFile *tempFile = new KTemporaryFile;
-            tempFile->setPrefix("print-manager");
-            tempFile->setSuffix(".ppd");
-            tempFile->open();
-            url.setProtocol(QLatin1String("http"));
-            if (url.port() < 0) {
-                url.setPort(631);
-            }
-            kDebug() << deviceURI << url;
-            KJob *job = KIO::file_copy(url,
-                                      tempFile->fileName(),
-                                      -1,
-                                      KIO::Overwrite | KIO::HideProgressInfo);
-            job->setProperty("URI", deviceURI);
-            connect(job, SIGNAL(result(KJob*)),
-                    this, SLOT(resultJob(KJob*)));
-        }
-
-        // Get the make from the device id
-        foreach (const QString &pair, deviceId.split(QLatin1Char(';'))) {
-            if (pair.startsWith(QLatin1String("MFG:"))) {
-                make = pair.section(QLatin1Char(':'), 1);
-                break;
-            }
-        }
-
-        if (makeAndModel.isEmpty()) {
-            // Get the model  from the device id
-            foreach (const QString &pair, deviceId.split(QLatin1Char(';'))) {
-                if (pair.startsWith(QLatin1String("MDL:"))) {
-                    // Build the make and model string
-                    if (make.isNull()) {
-                        makeAndModel = pair.section(QLatin1Char(':'), 1);
-                    } else {
-                        makeAndModel = make + QLatin1Char(' ') + pair.section(QLatin1Char(':'), 1);
-                    }
-                    break;
-                }
-            }
-        }
-
-        // if the device info is empty use the make and model
-        // so we can have a nice name for the new printer on the next page
-        if (!args.contains(KCUPS_DEVICE_INFO) && !makeAndModel.isEmpty()) {
-            m_args[KCUPS_DEVICE_INFO] = makeAndModel;
-        }
-
-        m_selectMM->setDeviceInfo(deviceId, make, makeAndModel, deviceURI);
-        m_isValid = true;
-    } else {
-        m_isValid = false;
-    }
-}
-
-bool PageChoosePPD::isValid() const
-{
-    return m_isValid;
-}
-
-QVariantHash PageChoosePPD::values() const
-{
-    if (!isValid()) {
-        return m_args;
-    }
-
-    QVariantHash ret = m_args;
-    if (canProceed()) {
-        if (!m_ppdFile.isNull()) {
-            ret[FILENAME] = m_ppdFile;
-        } else if (m_selectMM->isFileSelected()) {
-            ret[FILENAME] = m_selectMM->selectedPPDFileName();
-        } else {
-            ret[PPD_NAME] = m_selectMM->selectedPPDName();
-        }
-    }
-    return ret;
-}
-
-bool PageChoosePPD::canProceed() const
-{
-    // It can proceed if a PPD file (local or not) is provided    bool changed = false;
-    bool allow = false;
-
-    if (m_selectMM->isFileSelected()) {
-        allow = !m_selectMM->selectedPPDFileName().isNull();
-    } else if (!m_ppdFile.isNull()) {
-        allow = true;
-    } else {
-        allow = !m_selectMM->selectedPPDName().isNull();
-    }
-
-    kDebug() << allow;
-    return allow;
-}
-
-void PageChoosePPD::checkSelected()
-{
-    emit allowProceed(canProceed());
-}
-
-void PageChoosePPD::selectDefault()
-{
-}
-
-void PageChoosePPD::resultJob(KJob *job)
-{
-    if (!job->error() &&
-            job->property("URI").toString() == m_args[KCUPS_DEVICE_URI].toString()) {
-        KIO::FileCopyJob *fileCopyJob = qobject_cast<KIO::FileCopyJob*>(job);
-
-        // Make sure this job is for the current device
-        m_ppdFile = fileCopyJob->destUrl().toLocalFile();
-        m_isValid = false;
-        emit proceed();
-    }
-}
-
-void PageChoosePPD::removeTempPPD()
-{
-    if (!m_ppdFile.isNull()) {
-        QFile::remove(m_ppdFile);
-        m_ppdFile.clear();
-    }
-}
diff --git a/print-manager/add-printer/PageChoosePPD.h b/print-manager/add-printer/PageChoosePPD.h
deleted file mode 100644 (file)
index bb735e4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PAGE_CHOOSE_PPD_H
-#define PAGE_CHOOSE_PPD_H
-
-#include "GenericPage.h"
-
-#include <QStackedLayout>
-
-#include <KIO/Job>
-
-QT_BEGIN_NAMESPACE
-class Ui_PageChoosePPD;
-QT_END_NAMESPACE
-
-class SelectMakeModel;
-class PageChoosePPD : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit PageChoosePPD(const QVariantHash &args = QVariantHash(), QWidget *parent = 0);
-    ~PageChoosePPD();
-
-    bool canProceed() const;
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-
-private slots:
-    void checkSelected();
-    void selectDefault();
-    void resultJob(KJob *job);
-
-private:
-    void removeTempPPD();
-
-    Ui_PageChoosePPD *ui;
-    bool m_isValid;
-    SelectMakeModel *m_selectMM;
-    QStackedLayout *m_layout;
-    QString m_ppdFile;
-};
-
-#endif
diff --git a/print-manager/add-printer/PageChoosePPD.ui b/print-manager/add-printer/PageChoosePPD.ui
deleted file mode 100644 (file)
index a258658..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PageChoosePPD</class>
- <widget class="QWidget" name="PageChoosePPD">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/PageChoosePrinters.cpp b/print-manager/add-printer/PageChoosePrinters.cpp
deleted file mode 100644 (file)
index 0939713..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PageChoosePrinters.h"
-#include "ui_PageChoosePrinters.h"
-
-#include <ClassListWidget.h>
-
-#include <KCupsRequest.h>
-
-#include <QPainter>
-#include <KDebug>
-#include <KLocale>
-#include <KIconLoader>
-
-PageChoosePrinters::PageChoosePrinters(const QVariantHash &args, QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_PageChoosePrinters)
-{
-    ui->setupUi(this);
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-    // loads the standard key icon
-    QPixmap pixmap;
-    pixmap = KIconLoader::global()->loadIcon("printer",
-                                             KIconLoader::NoGroup,
-                                             KIconLoader::SizeEnormous, // a not so huge icon
-                                             KIconLoader::DefaultState);
-    QPixmap icon(pixmap);
-    QPainter painter(&icon);
-
-    pixmap = KIconLoader::global()->loadIcon("preferences-other",
-                                             KIconLoader::NoGroup,
-                                             KIconLoader::SizeLarge, // a not so huge icon
-                                             KIconLoader::DefaultState);
-    // the emblem icon to size 32
-    int overlaySize = KIconLoader::SizeLarge;
-    QPoint startPoint;
-    // bottom right corner
-    startPoint = QPoint(KIconLoader::SizeEnormous - overlaySize - 2,
-                        KIconLoader::SizeEnormous - overlaySize - 2);
-    painter.drawPixmap(startPoint, pixmap);
-    ui->printerL->setPixmap(icon);
-
-    connect(ui->membersLV, SIGNAL(changed(bool)),
-            this, SIGNAL(allowProceed(bool)));
-
-    if (!args.isEmpty()) {
-        setValues(args);
-    }
-}
-
-PageChoosePrinters::~PageChoosePrinters()
-{
-    delete ui;
-}
-
-void PageChoosePrinters::setValues(const QVariantHash &args)
-{
-    if (m_args != args) {
-        m_args = args;
-    }
-}
-
-QVariantHash PageChoosePrinters::values() const
-{
-    QVariantHash ret = m_args;
-    ret[KCUPS_MEMBER_URIS] = ui->membersLV->currentSelected(true);
-    return ret;
-}
-
-bool PageChoosePrinters::canProceed() const
-{
-    return ui->membersLV->selectedPrinters().count() > 0;
-}
diff --git a/print-manager/add-printer/PageChoosePrinters.h b/print-manager/add-printer/PageChoosePrinters.h
deleted file mode 100644 (file)
index b7efb30..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PAGE_CHOOSE_PRINTERS_H
-#define PAGE_CHOOSE_PRINTERS_H
-
-#include "GenericPage.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_PageChoosePrinters;
-QT_END_NAMESPACE
-
-class PageChoosePrinters : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit PageChoosePrinters(const QVariantHash &args, QWidget *parent = 0);
-    ~PageChoosePrinters();
-
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool canProceed() const;
-
-private:
-    Ui_PageChoosePrinters *ui;
-};
-
-#endif
diff --git a/print-manager/add-printer/PageChoosePrinters.ui b/print-manager/add-printer/PageChoosePrinters.ui
deleted file mode 100644 (file)
index 22e21e1..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PageChoosePrinters</class>
- <widget class="QWidget" name="PageChoosePrinters">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
-   <item row="0" column="1">
-    <layout class="QVBoxLayout" name="verticalLayout">
-     <property name="sizeConstraint">
-      <enum>QLayout::SetMinimumSize</enum>
-     </property>
-     <item>
-      <spacer name="verticalSpacer_3">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QLabel" name="printerL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string notr="true">printer</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignCenter</set>
-       </property>
-       <property name="margin">
-        <number>7</number>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer_4">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="2">
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="3">
-    <layout class="QVBoxLayout" name="vertLayout">
-     <item>
-      <widget class="QLabel" name="label">
-       <property name="text">
-        <string comment="@label:listbox">Members:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="ClassListWidget" name="membersLV"/>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>ClassListWidget</class>
-   <extends>QListView</extends>
-   <header location="global">ClassListWidget.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/PageDestinations.cpp b/print-manager/add-printer/PageDestinations.cpp
deleted file mode 100644 (file)
index 236c950..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PageDestinations.h"
-#include "ui_PageDestinations.h"
-
-#include "DevicesModel.h"
-
-#include "ChooseLpd.h"
-#include "ChooseSamba.h"
-#include "ChooseSerial.h"
-#include "ChooseSocket.h"
-#include "ChooseUri.h"
-
-#include <KCupsRequest.h>
-#include <NoSelectionRectDelegate.h>
-
-#include <QItemSelectionModel>
-
-#include <KDebug>
-#include <KLocale>
-
-// system-config-printer --setup-printer='file:/tmp/printout' --devid='MFG:Ricoh;MDL:Aficio SP C820DN'
-PageDestinations::PageDestinations(const QVariantHash &args, QWidget *parent) :
-    GenericPage(parent),
-    ui(new Ui_PageDestinations),
-    m_chooseLpd(new ChooseLpd(this)),
-    m_chooseSamba(new ChooseSamba(this)),
-    m_chooseSerial(new ChooseSerial(this)),
-    m_chooseSocket(new ChooseSocket(this)),
-    m_chooseUri(new ChooseUri(this)),
-    m_chooseLabel(new QLabel(this))
-{
-    ui->setupUi(this);
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    ui->stackedWidget->addWidget(m_chooseLpd);
-    connect(m_chooseLpd, SIGNAL(allowProceed(bool)), SIGNAL(allowProceed(bool)));
-    connect(m_chooseLpd, SIGNAL(startWorking()), SLOT(working()));
-    connect(m_chooseLpd, SIGNAL(stopWorking()), SLOT(notWorking()));
-
-    ui->stackedWidget->addWidget(m_chooseSamba);
-    connect(m_chooseSamba, SIGNAL(allowProceed(bool)), SIGNAL(allowProceed(bool)));
-    connect(m_chooseSamba, SIGNAL(startWorking()), SLOT(working()));
-    connect(m_chooseSamba, SIGNAL(stopWorking()), SLOT(notWorking()));
-
-    ui->stackedWidget->addWidget(m_chooseSerial);
-    connect(m_chooseSerial, SIGNAL(allowProceed(bool)), SIGNAL(allowProceed(bool)));
-    connect(m_chooseSerial, SIGNAL(startWorking()), SLOT(working()));
-    connect(m_chooseSerial, SIGNAL(stopWorking()), SLOT(notWorking()));
-
-    ui->stackedWidget->addWidget(m_chooseSocket);
-    connect(m_chooseSocket, SIGNAL(allowProceed(bool)), SIGNAL(allowProceed(bool)));
-    connect(m_chooseSocket, SIGNAL(startWorking()), SLOT(working()));
-    connect(m_chooseSocket, SIGNAL(stopWorking()), SLOT(notWorking()));
-
-    ui->stackedWidget->addWidget(m_chooseUri);
-    connect(m_chooseUri, SIGNAL(allowProceed(bool)), SIGNAL(allowProceed(bool)));
-    connect(m_chooseUri, SIGNAL(startWorking()), SLOT(working()));
-    connect(m_chooseUri, SIGNAL(stopWorking()), SLOT(notWorking()));
-    connect(m_chooseUri, SIGNAL(errorMessage(QString)), ui->messageWidget, SLOT(setText(QString)));
-    connect(m_chooseUri, SIGNAL(errorMessage(QString)), ui->messageWidget, SLOT(animatedShow()));
-    connect(m_chooseUri, SIGNAL(insertDevice(QString,QString,QString,QString,QString,QString,KCupsPrinters)),
-            SLOT(insertDevice(QString,QString,QString,QString,QString,QString,KCupsPrinters)));
-
-    m_chooseLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
-    ui->stackedWidget->addWidget(m_chooseLabel);
-
-    // Hide the message widget
-    ui->messageWidget->setMessageType(KMessageWidget::Error);
-    ui->messageWidget->hide();
-
-    // setup default options
-    setWindowTitle(i18nc("@title:window", "Select a Printer to Add"));
-    m_model = new DevicesModel(this);
-    ui->devicesTV->setModel(m_model);
-    ui->devicesTV->setItemDelegate(new NoSelectionRectDelegate(this));
-    connect(ui->devicesTV->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-            this, SLOT(deviceChanged()));
-    connect(m_model, SIGNAL(errorMessage(QString)), ui->messageWidget, SLOT(setText(QString)));
-    connect(m_model, SIGNAL(errorMessage(QString)), ui->messageWidget, SLOT(animatedShow()));
-
-    // Expand when a parent is added
-    connect(m_model, SIGNAL(parentAdded(QModelIndex)),
-            ui->devicesTV, SLOT(expand(QModelIndex)));
-
-    // Update the view when the device URI combo box changed
-    connect(ui->connectionsCB, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(deviceUriChanged()));
-    ui->connectionsGB->setVisible(false);
-
-    // Setup the busy cursor
-    working();
-    connect(m_model, SIGNAL(loaded()), this, SLOT(notWorking()));
-
-    if (!args.isEmpty()) {
-        // set our args
-        setValues(args);
-    }
-}
-
-PageDestinations::~PageDestinations()
-{
-    delete ui;
-}
-
-void PageDestinations::setValues(const QVariantHash &args)
-{
-    m_args = args;
-    if (args[ADDING_PRINTER].toBool()) {
-//        m_isValid = true;
-        m_model->update();
-//        m_busySeq->start();
-    } else {
-//        m_isValid = false;
-    }
-}
-
-bool PageDestinations::isValid() const
-{
-    return true;
-}
-
-QVariantHash PageDestinations::values() const
-{
-    QVariantHash ret = m_args;
-    GenericPage *page = qobject_cast<GenericPage*>(ui->stackedWidget->currentWidget());
-    if (page) {
-        ret = page->values();
-    } else if (canProceed()) {
-        ret = selectedItemValues();
-    }
-    return ret;
-}
-
-bool PageDestinations::canProceed() const
-{
-    bool ret = ui->stackedWidget->currentIndex() != 0;
-
-    GenericPage *page = qobject_cast<GenericPage*>(ui->stackedWidget->currentWidget());
-    if (page) {
-        ret = page->canProceed();
-    }
-
-    return ret;
-}
-
-void PageDestinations::deviceChanged()
-{
-    QItemSelectionModel *selection = ui->devicesTV->selectionModel();
-    if (!selection->selectedIndexes().isEmpty() &&
-            selection->selectedIndexes().size() == 1) {
-        QModelIndex index = selection->selectedIndexes().first();
-        QVariant uris = index.data(DevicesModel::DeviceUris);
-        if (uris.isNull()) {
-            ui->connectionsGB->setVisible(false);
-        } else if (uris.type() == QVariant::StringList) {
-            ui->connectionsCB->clear();
-            foreach (const QString &uri, uris.toStringList()) {
-                ui->connectionsCB->addItem(uriText(uri), uri);
-            }
-            ui->connectionsGB->setVisible(true);
-        } else {
-            ui->connectionsCB->clear();
-            foreach (const KCupsPrinter &printer, uris.value<KCupsPrinters>()) {
-                ui->connectionsCB->addItem(printer.name(), qVariantFromValue(printer));
-            }
-            ui->connectionsGB->setVisible(true);
-        }
-    } else {
-        ui->connectionsGB->setVisible(false);
-        setCurrentPage(0, selectedItemValues());
-        return;
-    }
-
-    deviceUriChanged();
-}
-
-void PageDestinations::deviceUriChanged()
-{
-    // Get the selected values
-    QVariantHash args = selectedItemValues();
-
-    // "beh" is excluded from the list
-    QString deviceUri = args[KCUPS_DEVICE_URI].toString();
-    kDebug() << deviceUri;
-    if (deviceUri.startsWith(QLatin1String("parallel"))) {
-        m_chooseLabel->setText(i18n("A printer connected to the parallel port."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("usb"))) {
-        m_chooseLabel->setText(i18n("A printer connected to a USB port."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("bluetooth"))) {
-        m_chooseLabel->setText(i18n("A printer connected via Bluetooth."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("hal"))) {
-        m_chooseLabel->setText(i18n("Local printer detected by the "
-                                    "Hardware Abstraction Layer (HAL)."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("hp"))) {
-        m_chooseLabel->setText(i18n("HPLIP software driving a printer, "
-                                    "or the printer function of a multi-function device."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("hpfax"))) {
-        m_chooseLabel->setText(i18n("HPLIP software driving a fax machine, "
-                                    "or the fax function of a multi-function device."));
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("dnssd")) ||
-               deviceUri.startsWith(QLatin1String("mdns"))) {
-        // TODO this needs testing...
-        QString text;
-        if (deviceUri.contains(QLatin1String("cups"))) {
-            text = i18n("Remote CUPS printer via DNS-SD");
-        } else {
-            QString protocol;
-            if (deviceUri.contains(QLatin1String("._ipp"))) {
-                protocol = QLatin1String("IPP");
-            } else if (deviceUri.contains(QLatin1String("._printer"))) {
-                protocol = QLatin1String("LPD");
-            } else if (deviceUri.contains(QLatin1String("._pdl-datastream"))) {
-                protocol = QLatin1String("AppSocket/JetDirect");
-            }
-
-            if (protocol.isNull()) {
-                text = i18n("Network printer via DNS-SD");
-            } else {
-                text = i18n("%1 network printer via DNS-SD", protocol);
-            }
-        }
-        m_chooseLabel->setText(text);
-        setCurrentPage(m_chooseLabel, args);
-    } else if (deviceUri.startsWith(QLatin1String("socket"))) {
-        kDebug() << "SOCKET";
-        setCurrentPage(m_chooseSocket, args);
-    } else if (deviceUri.startsWith(QLatin1String("ipp")) ||
-               deviceUri.startsWith(QLatin1String("ipps")) ||
-               deviceUri.startsWith(QLatin1String("http")) ||
-               deviceUri.startsWith(QLatin1String("https"))) {
-        setCurrentPage(m_chooseUri, args);
-    } else if (deviceUri.startsWith(QLatin1String("lpd"))) {
-        setCurrentPage(m_chooseLpd, args);
-    } else if (deviceUri.startsWith(QLatin1String("scsi"))) {
-        // TODO
-        setCurrentPage(m_chooseUri, args);
-    } else if (deviceUri.startsWith(QLatin1String("serial"))) {
-        setCurrentPage(m_chooseSerial, args);
-    } else if (deviceUri.startsWith(QLatin1String("smb"))) {
-        setCurrentPage(m_chooseSamba, args);
-    } else if (deviceUri.startsWith(QLatin1String("network"))) {
-        setCurrentPage(m_chooseUri, args);
-    } else {
-        setCurrentPage(m_chooseUri, args);
-    }
-
-    emit allowProceed(canProceed());
-}
-
-void PageDestinations::insertDevice(const QString &device_class, const QString &device_id, const QString &device_info, const QString &device_make_and_model, const QString &device_uri, const QString &device_location, const KCupsPrinters &grouped_printers)
-{
-    m_model->insertDevice(device_class,
-                          device_id,
-                          device_info,
-                          device_make_and_model,
-                          device_uri,
-                          device_location,
-                          grouped_printers);
-}
-
-QVariantHash PageDestinations::selectedItemValues() const
-{
-    QVariantHash ret = m_args;
-    if (!ui->devicesTV->selectionModel()->selectedIndexes().isEmpty() &&
-            ui->devicesTV->selectionModel()->selectedIndexes().size() == 1) {
-        QModelIndex index = ui->devicesTV->selectionModel()->selectedIndexes().first();
-        QVariant uri = index.data(DevicesModel::DeviceUri);
-        QVariant uris = index.data(DevicesModel::DeviceUris);
-        // if the devicesTV holds an item with grouped URIs
-        // get the selected value from the connections combo box
-        if (uris.isNull() || uris.type() == QVariant::StringList) {
-            if (uris.type() == QVariant::StringList) {
-                uri = ui->connectionsCB->itemData(ui->connectionsCB->currentIndex());
-            }
-            ret[KCUPS_DEVICE_URI] = uri;
-            ret[KCUPS_DEVICE_ID] = index.data(DevicesModel::DeviceId);
-            ret[KCUPS_DEVICE_MAKE_AND_MODEL] = index.data(DevicesModel::DeviceMakeAndModel);
-            ret[KCUPS_DEVICE_INFO] = index.data(DevicesModel::DeviceInfo);
-            ret[KCUPS_DEVICE_LOCATION] = index.data(DevicesModel::DeviceLocation);
-        } else {
-            QVariant aux = ui->connectionsCB->itemData(ui->connectionsCB->currentIndex());
-            KCupsPrinter printer = aux.value<KCupsPrinter>();
-            KUrl url = uri.toString();
-            url.setPath(QLatin1String("printers/") + printer.name());
-            ret[KCUPS_DEVICE_URI] = url.url();
-            ret[KCUPS_DEVICE_ID] = index.data(DevicesModel::DeviceId);
-            ret[KCUPS_PRINTER_INFO] = printer.info();
-            kDebug() << KCUPS_PRINTER_INFO << printer.info();
-            ret[KCUPS_PRINTER_NAME] = printer.name();
-            ret[KCUPS_DEVICE_LOCATION] = printer.location();
-        }
-        kDebug() << uri << ret;
-    }
-    return ret;
-}
-
-void PageDestinations::setCurrentPage(QWidget *widget, const QVariantHash &args)
-{
-    GenericPage *page = qobject_cast<GenericPage*>(widget);
-    if (page) {
-        page->setValues(args);
-        if (ui->stackedWidget->currentWidget() != page) {;
-            ui->stackedWidget->setCurrentWidget(page);
-        }
-    } else if (qobject_cast<QLabel*>(widget)) {
-        if (ui->connectionsGB->isVisible() &&
-                ui->connectionsCB->currentText() == m_chooseLabel->text()) {
-            // Don't show duplicated text for the user
-            m_chooseLabel->clear();
-        }
-
-        if (ui->stackedWidget->currentWidget() != widget) {;
-            ui->stackedWidget->setCurrentWidget(widget);
-        }
-    } else {
-        ui->stackedWidget->setCurrentIndex(0);
-    }
-}
-
-QString PageDestinations::uriText(const QString &uri) const
-{
-    QString ret;
-    if (uri.startsWith(QLatin1String("parallel"))) {
-        ret = i18n("Parallel Port");
-    } else if (uri.startsWith(QLatin1String("serial"))) {
-        ret = i18n("Serial Port");
-    } else if (uri.startsWith(QLatin1String("usb"))) {
-        ret = i18n("USB");
-    } else if (uri.startsWith(QLatin1String("bluetooth")) ){
-        ret = i18n("Bluetooth");
-    } else if (uri.startsWith(QLatin1String("hpfax"))) {
-        ret = i18n("Fax - HP Linux Imaging and Printing (HPLIP)");
-    } else if (uri.startsWith(QLatin1String("hp"))) {
-        ret = i18n("HP Linux Imaging and Printing (HPLIP)");
-    } else if (uri.startsWith(QLatin1String("hal"))) {
-        ret = i18n("Hardware Abstraction Layer (HAL)");
-    } else if (uri.startsWith(QLatin1String("socket"))) {
-        ret = i18n("AppSocket/HP JetDirect");
-    } else if (uri.startsWith(QLatin1String("lpd"))) {
-        // Check if the queue name is defined
-        QString queue = uri.section(QLatin1Char('/'), -1, -1);
-        if (queue.isEmpty()) {
-            ret = i18n("LPD/LPR queue");
-        } else {
-            ret = i18n("LPD/LPR queue %1", queue);
-        }
-    } else if (uri.startsWith(QLatin1String("smb"))) {
-        ret = i18n("Windows Printer via SAMBA");
-    } else if (uri.startsWith(QLatin1String("ipp"))) {
-        // Check if the queue name (fileName) is defined
-        QString queue = uri.section(QLatin1Char('/'), -1, -1);
-        if (queue.isEmpty()) {
-            ret = i18n("IPP");
-        } else {
-            ret = i18n("IPP %1", queue);
-        }
-    } else if (uri.startsWith(QLatin1String("https"))) {
-        ret = i18n("HTTP");
-    } else if (uri.startsWith(QLatin1String("dnssd")) ||
-               uri.startsWith(QLatin1String("mdns"))) {
-        // TODO this needs testing...
-        QString text;
-        if (uri.contains(QLatin1String("cups"))) {
-            text = i18n("Remote CUPS printer via DNS-SD");
-        } else {
-            if (uri.contains(QLatin1String("._ipp"))) {
-                ret = i18n("IPP network printer via DNS-SD");
-            } else if (uri.contains(QLatin1String("._printer"))) {
-                ret = i18n("LPD network printer via DNS-SD");
-            } else if (uri.contains(QLatin1String("._pdl-datastream"))) {
-                ret = i18n("AppSocket/JetDirect network printer via DNS-SD");
-            } else {
-                ret = i18n("Network printer via DNS-SD");
-            }
-        }
-    } else {
-        ret = uri;
-    }
-    return ret;
-}
diff --git a/print-manager/add-printer/PageDestinations.h b/print-manager/add-printer/PageDestinations.h
deleted file mode 100644 (file)
index 55256a7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PAGE_DESTINATIONS_H
-#define PAGE_DESTINATIONS_H
-
-#include "GenericPage.h"
-
-#include <KCupsPrinter.h>
-#include <KUrl>
-
-#include <QLabel>
-
-QT_BEGIN_NAMESPACE
-class Ui_PageDestinations;
-QT_END_NAMESPACE
-
-class DevicesModel;
-class ChooseLpd;
-class ChoosePrinters;
-class ChooseSamba;
-class ChooseSerial;
-class ChooseSocket;
-class ChooseUri;
-class PageDestinations : public GenericPage
-{
-    Q_OBJECT
-public:
-    explicit PageDestinations(const QVariantHash &args = QVariantHash(), QWidget *parent = 0);
-    ~PageDestinations();
-
-    bool canProceed() const;
-    void setValues(const QVariantHash &args);
-    QVariantHash values() const;
-    bool isValid() const;
-
-private slots:
-    void deviceChanged();
-    void deviceUriChanged();
-    void insertDevice(const QString &device_class,
-                      const QString &device_id,
-                      const QString &device_info,
-                      const QString &device_make_and_model,
-                      const QString &device_uri,
-                      const QString &device_location,
-                      const KCupsPrinters &grouped_printers);
-
-private:
-    QString uriText(const QString &uri) const;
-    QVariantHash selectedItemValues() const;
-    void setCurrentPage(QWidget *widget, const QVariantHash &args);
-
-    Ui_PageDestinations *ui;
-    DevicesModel *m_model;
-
-    QString m_currentUri;
-    ChooseLpd      *m_chooseLpd;
-    ChoosePrinters *m_choosePrinters;
-    ChooseSamba    *m_chooseSamba;
-    ChooseSerial   *m_chooseSerial;
-    ChooseSocket   *m_chooseSocket;
-    ChooseUri      *m_chooseUri;
-    QLabel         *m_chooseLabel;
-};
-
-#endif
diff --git a/print-manager/add-printer/PageDestinations.ui b/print-manager/add-printer/PageDestinations.ui
deleted file mode 100644 (file)
index c59ce8e..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PageDestinations</class>
- <widget class="QWidget" name="PageDestinations">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>570</width>
-    <height>355</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="horizontalSpacing">
-    <number>0</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="1" column="0">
-    <widget class="QTreeView" name="devicesTV">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="editTriggers">
-      <set>QAbstractItemView::NoEditTriggers</set>
-     </property>
-     <property name="rootIsDecorated">
-      <bool>false</bool>
-     </property>
-     <property name="itemsExpandable">
-      <bool>false</bool>
-     </property>
-     <property name="animated">
-      <bool>true</bool>
-     </property>
-     <property name="expandsOnDoubleClick">
-      <bool>false</bool>
-     </property>
-     <attribute name="headerVisible">
-      <bool>false</bool>
-     </attribute>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <layout class="QVBoxLayout" name="verticalLayout">
-     <property name="spacing">
-      <number>0</number>
-     </property>
-     <item>
-      <widget class="QGroupBox" name="connectionsGB">
-       <property name="title">
-        <string>Connections</string>
-       </property>
-       <layout class="QGridLayout" name="gridLayout_3">
-        <property name="topMargin">
-         <number>0</number>
-        </property>
-        <property name="verticalSpacing">
-         <number>0</number>
-        </property>
-        <item row="0" column="0">
-         <widget class="KComboBox" name="connectionsCB">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
-      <widget class="QStackedWidget" name="stackedWidget">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <widget class="QWidget" name="page">
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="0">
-          <widget class="QLabel" name="label">
-           <property name="text">
-            <string>Please choose an item on the list</string>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignCenter</set>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="0" colspan="2">
-    <widget class="KMessageWidget" name="messageWidget" native="true"/>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KMessageWidget</class>
-   <extends>QWidget</extends>
-   <header location="global">kmessagewidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/add-printer/main.cpp b/print-manager/add-printer/main.cpp
deleted file mode 100644 (file)
index 5ceb943..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "AddPrinter.h"
-
-#include <config.h>
-
-#include <KDebug>
-#include <KLocale>
-#include <KAboutData>
-#include <KCmdLineArgs>
-
-int main(int argc, char **argv)
-{
-    KAboutData about("add-printer",
-                     "print-manager",
-                     ki18n("AddPrinter"),
-                     PM_VERSION,
-                     ki18n("Tool for adding new printers"),
-                     KAboutData::License_GPL,
-                     ki18n("(C) 2010-2013 Daniel Nicoletti"));
-
-    about.addAuthor(ki18n("Daniel Nicoletti"), KLocalizedString(), "dantti12@gmail.com");
-
-    KCmdLineArgs::init(argc, argv, &about);
-    KCmdLineOptions options;
-    options.add("w").add("parent-window <wid>", ki18n("Parent Window ID"));
-    options.add("add-printer", ki18n("Add a new printer"));
-    options.add("add-class", ki18n("Add a new printer class"));
-    options.add("change-ppd <printer-name>", ki18n("Changes the PPD of a given printer"));
-    options.add("new-printer-from-device <printername/deviceid>", ki18n("Changes the PPD of a given printer/deviceid"));
-    KCmdLineArgs::addCmdLineOptions(options);
-
-    qulonglong wid = 0;
-    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-    if (args->isSet("w")) {
-        wid = args->getOption("parent-window").toULongLong();
-    }
-
-    AddPrinter app;
-    if (args->isSet("add-printer")) {
-        app.addPrinter(wid);
-    } else if (args->isSet("add-class")) {
-        app.addClass(wid);
-    } else if (args->isSet("change-ppd")) {
-        app.changePPD(wid, args->getOption("change-ppd"));
-    } else if (args->isSet("new-printer-from-device")) {
-        QString value = args->getOption("new-printer-from-device");
-        QStringList values = value.split(QLatin1String("/"));
-        if (values.size() == 2) {
-            app.newPrinterFromDevice(wid, values.first(), values.last());
-        } else {
-            args->usage("new-printer-from-device");
-        }
-    } else {
-        args->usage();
-    }
-
-
-    return app.exec();
-}
diff --git a/print-manager/config.h.cmake b/print-manager/config.h.cmake
deleted file mode 100644 (file)
index ca09c62..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef CONFIG_H
-#define CONFIG_H
-
-// Define the app-install database path.
-#cmakedefine PM_VERSION "@PM_VERSION@"
-
-#endif //CONFIG_H
diff --git a/print-manager/configure-printer/CMakeLists.txt b/print-manager/configure-printer/CMakeLists.txt
deleted file mode 100644 (file)
index bf4d454..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-set(configureprinter_SRCS
-    ConfigurePrinterInterface.cpp
-    ModifyPrinter.cpp
-    PrinterPage.cpp
-    PrinterOptions.cpp
-    PrinterBehavior.cpp
-    ConfigureDialog.cpp
-    ConfigurePrinter.cpp
-    main.cpp
-    ModifyPrinter.ui
-    PrinterOptions.ui
-    PrinterBehavior.ui
-)
-
-qt4_add_dbus_adaptor(configureprinter_SRCS
-    org.kde.ConfigurePrinter.xml
-    ConfigurePrinterInterface.h
-    ConfigurePrinterInterface
-)
-
-configure_file(
-    org.kde.ConfigurePrinter.service.in
-    org.kde.ConfigurePrinter.service
-)
-
-install(
-    FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ConfigurePrinter.service
-    DESTINATION ${KDE4_DBUS_SERVICES_INSTALL_DIR}
-)
-
-add_executable(configure-printer ${configureprinter_SRCS})
-
-target_link_libraries(configure-printer
-    ${KDE4_KIO_LIBS}
-    ${CUPS_LIBRARIES}
-    kcupslib
-)
-
-install(TARGETS configure-printer DESTINATION ${KDE4_LIBEXEC_INSTALL_DIR})
diff --git a/print-manager/configure-printer/ConfigureDialog.cpp b/print-manager/configure-printer/ConfigureDialog.cpp
deleted file mode 100644 (file)
index ace91a2..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ConfigureDialog.h"
-#include "PrinterPage.h"
-
-#include "ModifyPrinter.h"
-#include "PrinterBehavior.h"
-#include "PrinterOptions.h"
-
-#include "KCupsRequest.h"
-
-#include <KConfig>
-#include <KLocale>
-#include <KMessageBox>
-#include <KDebug>
-
-#include <QList>
-#include <QPointer>
-
-Q_DECLARE_METATYPE(QList<int>)
-
-ConfigureDialog::ConfigureDialog(const QString &destName, bool isClass, QWidget *parent) :
-    KPageDialog(parent)
-{
-    setFaceType(List);
-    setModal(true);
-    setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
-    setWindowTitle(destName);
-    setWindowIcon(KIcon("configure"));
-    enableButtonApply(false);
-    // Needed so we have our dialog size saved
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    QStringList attr;
-    KPageWidgetItem *page;
-
-    modifyPrinter = new ModifyPrinter(destName, isClass, this);
-    PrinterBehavior *printerBehavior = new PrinterBehavior(destName, isClass, this);
-    attr << modifyPrinter->neededValues();
-    attr << printerBehavior->neededValues();
-    attr << KCUPS_PRINTER_TYPE; // needed to know if it's a remote printer
-    attr << KCUPS_PRINTER_MAKE_AND_MODEL;
-
-    KCupsPrinter printer;
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->getPrinterAttributes(destName, isClass, attr);
-    request->waitTillFinished();
-    if (!request) {
-        return;
-    }
-    if (!request->hasError() && !request->printers().isEmpty()){
-        printer = request->printers().first();
-    }
-//    kDebug() << "VALUES" << printer.a rgument();
-//    kDebug() << "marker" << values["marker-levels"].value<QList<int> >();
-
-    request->deleteLater();
-
-    //     kDebug() << values;
-    if (printer.type() & CUPS_PRINTER_LOCAL) {
-        kDebug() << "CUPS_PRINTER_LOCAL";
-    }
-    isClass = printer.isClass();
-    bool isRemote = false;
-    if (printer.type() & CUPS_PRINTER_REMOTE) {
-        kDebug() << "CUPS_PRINTER_REMOTE";
-        isRemote = true;
-    }
-    if (printer.type() & CUPS_PRINTER_BW) {
-        kDebug() << "CUPS_PRINTER_BW";
-    }
-    if (printer.type() & CUPS_PRINTER_COLOR) {
-        kDebug() << "CUPS_PRINTER_COLOR";
-    }
-    if (printer.type() & CUPS_PRINTER_MFP) {
-        kDebug() << "CUPS_PRINTER_MFP";
-    }
-
-    modifyPrinter->setRemote(isRemote);
-    modifyPrinter->setValues(printer);
-    page = new KPageWidgetItem(modifyPrinter, i18n("Modify Printer"));
-    page->setHeader(i18n("Configure"));
-    page->setIcon(KIcon("dialog-information"));
-    // CONNECT this signal ONLY to the first Page
-    connect(modifyPrinter, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
-    addPage(page);
-
-    if (!isClass) {
-        // At least on localhost:631 modify printer does not show printer options
-        // for classes
-        printerOptions = new PrinterOptions(destName, isClass, isRemote, this);
-        page = new KPageWidgetItem(printerOptions, i18n("Printer Options"));
-        page->setHeader(i18n("Set the Default Printer Options"));
-        page->setIcon(KIcon("view-pim-tasks"));
-        addPage(page);
-        connect(modifyPrinter, SIGNAL(ppdChanged()), this, SLOT(ppdChanged()));
-        modifyPrinter->setCurrentMake(printerOptions->currentMake());
-        modifyPrinter->setCurrentMakeAndModel(printerOptions->currentMakeAndModel());
-    }
-
-    printerBehavior->setRemote(isRemote);
-    printerBehavior->setValues(printer);
-    page = new KPageWidgetItem(printerBehavior, i18n("Banners, Policies and Allowed Users"));
-    page->setHeader(i18n("Banners, Policies and Allowed Users"));
-    page->setIcon(KIcon("feed-subscribe"));
-    addPage(page);
-
-    // connect this after ALL pages were added, otherwise the slot will be called
-    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
-            SLOT(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)));
-
-    KConfig config("print-manager");
-    KConfigGroup configureDialog(&config, "ConfigureDialog");
-    restoreDialogSize(configureDialog);
-}
-
-void ConfigureDialog::ppdChanged()
-{
-    printerOptions->reloadPPD();
-    modifyPrinter->setCurrentMake(printerOptions->currentMake());
-    modifyPrinter->setCurrentMakeAndModel(printerOptions->currentMakeAndModel());
-}
-
-ConfigureDialog::~ConfigureDialog()
-{
-    KConfig config("print-manager");
-    KConfigGroup configureDialog(&config, "ConfigureDialog");
-    saveDialogSize(configureDialog);
-}
-
-void ConfigureDialog::currentPageChanged(KPageWidgetItem *current, KPageWidgetItem *before)
-{
-    PrinterPage *currentPage = qobject_cast<PrinterPage*>(current->widget());
-    PrinterPage *beforePage = qobject_cast<PrinterPage*>(before->widget());
-
-    // Check if the before page has changes
-    savePage(beforePage);
-    if (beforePage) {
-        disconnect(beforePage, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
-    }
-
-    // connect the changed signal to the new page and check if it has changes
-    connect(currentPage, SIGNAL(changed(bool)), this, SLOT(enableButtonApply(bool)));
-    enableButtonApply(currentPage->hasChanges());
-}
-
-void ConfigureDialog::slotButtonClicked(int button)
-{
-    PrinterPage *page = qobject_cast<PrinterPage *>(currentPage()->widget());
-    if (button == KDialog::Ok) {
-        page->save();
-        accept();
-    } else if (button == KDialog::Apply) {
-        page->save();
-    } else {
-        KDialog::slotButtonClicked(button);
-    }
-}
-
-void ConfigureDialog::closeEvent(QCloseEvent *event)
-{
-    PrinterPage *page = qobject_cast<PrinterPage*>(currentPage()->widget());
-    if (savePage(page)) {
-        event->accept();
-    } else {
-        event->ignore();
-    }
-}
-
-bool ConfigureDialog::savePage(PrinterPage *page)
-{
-    if (page->hasChanges()) {
-        int ret;
-        ret = KMessageBox::warningYesNoCancel(this,
-                                               i18n("The current page has changes.\n"
-                                                    "Do you want to save them?"));
-        if (ret == KMessageBox::Yes) {
-            page->save();
-        } else if (ret == KMessageBox::Cancel) {
-            return false;
-        }
-    }
-    return true;
-}
diff --git a/print-manager/configure-printer/ConfigureDialog.h b/print-manager/configure-printer/ConfigureDialog.h
deleted file mode 100644 (file)
index cfdfd23..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CONFIGURE_DIALOG_H
-#define CONFIGURE_DIALOG_H
-
-#include <QtGui/qevent.h>
-#include <KPageDialog>
-#include <kdemacros.h>
-
-class PrinterPage;
-class ModifyPrinter;
-class PrinterOptions;
-
-class KDE_EXPORT ConfigureDialog : public KPageDialog
-{
-    Q_OBJECT
-public:
-    explicit ConfigureDialog(const QString &destName, bool isClass, QWidget *parent = 0);
-    ~ConfigureDialog();
-
-private slots:
-    void currentPageChanged(KPageWidgetItem *current, KPageWidgetItem *before);
-    virtual void slotButtonClicked(int button);
-    void ppdChanged();
-
-private:
-    ModifyPrinter *modifyPrinter;
-    PrinterOptions *printerOptions;
-    void closeEvent(QCloseEvent *event);
-    // return false if the dialog was canceled
-    bool savePage(PrinterPage *page);
-};
-
-#endif
diff --git a/print-manager/configure-printer/ConfigurePrinter.cpp b/print-manager/configure-printer/ConfigurePrinter.cpp
deleted file mode 100644 (file)
index c926174..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ConfigurePrinter.h"
-
-#include "ConfigurePrinterInterface.h"
-
-#include <QTimer>
-
-#include <KCmdLineArgs>
-#include <KDebug>
-
-ConfigurePrinter::ConfigurePrinter() :
-    KUniqueApplication()
-{
-    m_cpInterface = new ConfigurePrinterInterface(this);
-    connect(m_cpInterface, SIGNAL(quit()), this, SLOT(quit()));
-}
-
-int ConfigurePrinter::newInstance()
-{
-    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-    QString printerName = args->getOption("configure-printer");
-    if (!printerName.isEmpty()) {
-        m_cpInterface->ConfigurePrinter(printerName);
-    } else {
-        // If DBus called the ui list won't be empty
-        QTimer::singleShot(500, m_cpInterface, SLOT(RemovePrinter()));
-    }
-    args->clear();
-
-    return 0;
-}
-
-ConfigurePrinter::~ConfigurePrinter()
-{
-}
-
-#include "moc_ConfigurePrinter.cpp"
diff --git a/print-manager/configure-printer/ConfigurePrinter.h b/print-manager/configure-printer/ConfigurePrinter.h
deleted file mode 100644 (file)
index 8767c17..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CONFIGURE_PRINTER_H
-#define CONFIGURE_PRINTER_H
-
-#include <KUniqueApplication>
-
-class ConfigurePrinterInterface;
-class ConfigurePrinter : public KUniqueApplication
-{
-    Q_OBJECT
-public:
-    ConfigurePrinter();
-    virtual ~ConfigurePrinter();
-
-    int newInstance();
-
-private:
-    ConfigurePrinterInterface *m_cpInterface;
-};
-
-#endif // CONFIGURE_PRINTER_H
diff --git a/print-manager/configure-printer/ConfigurePrinterInterface.cpp b/print-manager/configure-printer/ConfigurePrinterInterface.cpp
deleted file mode 100644 (file)
index a84160e..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 Daniel Nicoletti <dantti12@gmail.com>         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include "ConfigurePrinterInterface.h"
-#include "configureprinteradaptor.h"
-
-#include "ConfigureDialog.h"
-#include <KCupsRequest.h>
-#include <KCupsPrinter.h>
-
-#include <QtDBus/QDBusConnection>
-#include <QtCore/QTimer>
-#include <QtCore/QPointer>
-#include <QtGui/QLayout>
-#include <KWindowSystem>
-#include <KDialog>
-
-#include <KDebug>
-
-ConfigurePrinterInterface::ConfigurePrinterInterface(QObject *parent) :
-    QObject(parent)
-{
-    kDebug() << "Creating Helper";
-    (void) new ConfigurePrinterAdaptor(this);
-    if (!QDBusConnection::sessionBus().registerService("org.kde.ConfigurePrinter")) {
-        kDebug() << "another helper is already running";
-        return;
-    }
-
-    if (!QDBusConnection::sessionBus().registerObject("/", this)) {
-        kDebug() << "unable to register service interface to dbus";
-        return;
-    }
-
-    // setup the timer that updates the UIs
-    m_updateUi = new QTimer(this);
-    m_updateUi->setInterval(1000);
-    m_updateUi->start();
-}
-
-ConfigurePrinterInterface::~ConfigurePrinterInterface()
-{
-}
-
-void ConfigurePrinterInterface::ConfigurePrinter(const QString &destName)
-{
-    if (!m_uis.contains(destName)) {
-        // Reserve this since the CUPS call might take a long time
-        m_uis[destName] = 0;
-
-        QStringList att;
-        att << KCUPS_PRINTER_NAME;
-        att << KCUPS_PRINTER_TYPE;
-        // Get destinations with these attributes
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        request->getPrinters(att);
-        request->waitTillFinished();
-        if (!request) {
-            return;
-        }
-
-        bool found = false;
-        KCupsPrinter printer;
-        KCupsPrinters printers = request->printers();
-        for (int i = 0; i < printers.size(); i++) {
-            if (printers.at(i).name() == destName) {
-                printer = printers.at(i);
-                found = true;
-                break;
-            }
-        }
-        request->deleteLater();
-
-        if (found) {
-            ConfigureDialog *ui = new ConfigureDialog(printer.name(), printer.isClass());
-            connect(m_updateUi, SIGNAL(timeout()),
-                    ui, SLOT(update()));
-            connect(ui, SIGNAL(finished()),
-                    this, SLOT(RemovePrinter()));
-            ui->show();
-            m_uis[printer.name()] = ui;
-        } else {
-            // Remove the reservation
-            m_uis.remove(destName);
-
-            // if no destination was found and we aren't showing
-            // a queue quit the app
-            if (m_uis.isEmpty()) {
-                 emit quit();
-            }
-            return;
-        }
-    }
-
-    // Check it it's not reserved
-    if (m_uis.value(destName)) {
-        KWindowSystem::forceActiveWindow(m_uis.value(destName)->winId());
-    }
-}
-
-void ConfigurePrinterInterface::RemovePrinter()
-{
-    QWidget *ui = qobject_cast<QWidget*>(sender());
-    if (ui) {
-        m_uis.remove(m_uis.key(ui));
-    }
-
-    // if no destination was found and we aren't showing
-    // a queue quit the app
-    if (m_uis.isEmpty()) {
-         emit quit();
-    }
-}
-
-#include "moc_ConfigurePrinterInterface.cpp"
diff --git a/print-manager/configure-printer/ConfigurePrinterInterface.h b/print-manager/configure-printer/ConfigurePrinterInterface.h
deleted file mode 100644 (file)
index 090c374..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 Daniel Nicoletti <dantti12@gmail.com>              *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#ifndef CONFIGURE_PRINTER_INTERFACE_H
-#define CONFIGURE_PRINTER_INTERFACE_H
-
-#include <QtCore/QHash>
-#include <QtCore/QObject>
-#include <QtDBus/QDBusContext>
-
-#include <QTimer>
-#include <QWidget>
-class ConfigurePrinterInterface : public QObject, protected QDBusContext
-{
-    Q_OBJECT
-    Q_CLASSINFO("D-Bus Interface", "org.kde.ConfigurePrinter")
-public:
-    explicit ConfigurePrinterInterface(QObject *parent = 0);
-    ~ConfigurePrinterInterface();
-
-signals:
-    void quit();
-
-public slots:
-    void ConfigurePrinter(const QString &destName);
-    void RemovePrinter();
-
-private:
-    QTimer *m_updateUi;
-    QHash<QString, QWidget *> m_uis;
-};
-
-#endif
diff --git a/print-manager/configure-printer/ModifyPrinter.cpp b/print-manager/configure-printer/ModifyPrinter.cpp
deleted file mode 100644 (file)
index 3b24607..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ModifyPrinter.h"
-
-#include "ui_ModifyPrinter.h"
-
-#include "SelectMakeModel.h"
-
-#include <KDialog>
-#include <KPixmapSequenceOverlayPainter>
-#include <KPixmapSequence>
-#include <KPushButton>
-#include <KMessageBox>
-#include <KDebug>
-#include <KLocale>
-
-ModifyPrinter::ModifyPrinter(const QString &destName, bool isClass, QWidget *parent) :
-    PrinterPage(parent),
-    ui(new Ui_ModifyPrinter),
-    m_destName(destName),
-    m_isClass(isClass),
-    m_changes(0)
-{
-    ui->setupUi(this);
-
-    ui->nameL->setText(destName);
-    ui->connectionL->setVisible(!isClass);
-    ui->connectionLE->setVisible(!isClass);
-    ui->driverL->setVisible(!isClass);
-    ui->makeCB->setVisible(!isClass);
-
-    ui->membersL->setVisible(isClass);
-    ui->membersLV->setVisible(isClass);
-    if (isClass) {
-        ui->membersLV->setPrinter(destName);
-    }
-
-    connect(ui->descriptionLE, SIGNAL(textChanged(QString)),
-            this, SLOT(textChanged(QString)));
-    connect(ui->locationLE, SIGNAL(textChanged(QString)),
-            this, SLOT(textChanged(QString)));
-    connect(ui->connectionLE, SIGNAL(textChanged(QString)),
-            this, SLOT(textChanged(QString)));
-    connect(ui->membersLV, SIGNAL(changed(bool)),
-            this, SLOT(modelChanged()));
-}
-
-ModifyPrinter::~ModifyPrinter()
-{
-    delete ui;
-}
-
-void ModifyPrinter::on_makeCB_activated(int index)
-{
-    bool isDifferent = true;
-    if (ui->makeCB->itemData(index).toUInt() == PPDList) {
-        KConfig config("print-manager");
-        KConfigGroup ppdDialog(&config, "PPDDialog");
-
-        SelectMakeModel *widget = new SelectMakeModel(this);
-
-        KDialog *dialog = new KDialog(this);
-        connect(dialog, SIGNAL(accepted()), this, SLOT(ppdSelectionAccepted()));
-        connect(dialog, SIGNAL(rejected()), this, SLOT(ppdSelectionRejected()));
-        connect(widget, SIGNAL(changed(bool)), dialog, SLOT(enableButtonOk(bool)));
-        dialog->setCaption("Select a Driver");
-        dialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Help);
-        dialog->setMainWidget(widget);
-        dialog->enableButtonOk(false);
-        dialog->restoreDialogSize(ppdDialog);
-
-        // Configure the help button to be flat, disabled and empty
-        KPushButton *button = dialog->button(KDialog::Help);
-        button->setFlat(true);
-        button->setEnabled(false);
-        button->setIcon(QIcon());
-        button->setText(QString());
-
-        // Setup the busy cursor
-        KPixmapSequenceOverlayPainter *busySeq = new KPixmapSequenceOverlayPainter(dialog);
-        busySeq->setSequence(KPixmapSequence("process-working", KIconLoader::SizeSmallMedium));
-        busySeq->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
-        busySeq->setWidget(button);
-        busySeq->start();
-        connect(widget, SIGNAL(changed(bool)), busySeq, SLOT(stop()));
-kDebug() << m_make << m_makeAndModel;
-        widget->setMakeModel(m_make, m_makeAndModel);
-        dialog->show();
-        return;
-    } else if (ui->makeCB->itemData(index).toUInt() == PPDFile) {
-        // set the QVariant type to bool makes it possible to know a file was selected
-        m_changedValues["ppd-name"] = true;
-    } else if (ui->makeCB->itemData(index).toUInt() == PPDDefault) {
-        isDifferent = false;
-        m_changedValues.remove("ppd-name");
-    } else if (ui->makeCB->itemData(index).toUInt() == PPDCustom) {
-        m_changedValues["ppd-name"] = ui->makeCB->itemData(index, PPDName).toString();
-    } else {
-        kWarning() << "This should not happen";
-        return;
-    }
-
-    if (isDifferent != ui->makeCB->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        ui->makeCB->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-    ui->makeCB->setProperty("lastIndex", ui->makeCB->currentIndex());
-}
-
-void ModifyPrinter::ppdSelectionAccepted()
-{
-    KDialog *dialog = qobject_cast<KDialog*>(sender());
-    SelectMakeModel *widget = qobject_cast<SelectMakeModel*>(dialog->mainWidget());
-
-    if (widget->isFileSelected()) {
-        QString fileName = widget->selectedPPDFileName();
-        ui->makeCB->insertItem(0, fileName, PPDFile);
-        ui->makeCB->setCurrentIndex(0);
-        on_makeCB_activated(0);
-    } else if (!widget->selectedPPDName().isNull()) {
-        QString makeAndModel = widget->selectedPPDMakeAndModel();
-        QString ppdName = widget->selectedPPDName();
-        ui->makeCB->insertItem(0, makeAndModel, PPDCustom);
-        ui->makeCB->setItemData(0, ppdName, PPDName);
-        ui->makeCB->setCurrentIndex(0);
-        on_makeCB_activated(0);
-    } else {
-        ui->makeCB->setCurrentIndex(ui->makeCB->property("lastIndex").toInt());
-    }
-
-    KConfig config("print-manager");
-    KConfigGroup ppdDialog(&config, "PPDDialog");
-    dialog->saveDialogSize(ppdDialog);
-    dialog->deleteLater();
-}
-
-void ModifyPrinter::ppdSelectionRejected()
-{
-    ui->makeCB->setCurrentIndex(ui->makeCB->property("lastIndex").toInt());
-
-    KDialog *dialog = qobject_cast<KDialog*>(sender());
-    KConfig config("print-manager");
-    KConfigGroup ppdDialog(&config, "PPDDialog");
-    dialog->saveDialogSize(ppdDialog);
-    dialog->deleteLater();
-}
-
-void ModifyPrinter::setValues(const KCupsPrinter &printer)
-{
-//     kDebug() << values;
-    if (m_isClass) {
-        ui->membersLV->setSelectedPrinters(printer.memberNames().join(QLatin1String("|")));
-    } else {
-        ui->makeCB->clear();
-        ui->makeCB->setProperty("different", false);
-        ui->makeCB->setProperty("lastIndex", 0);
-        ui->makeCB->insertItem(0,
-                               i18n("Current - %1", printer.makeAndModel()),
-                               PPDDefault);
-        ui->makeCB->insertSeparator(1);
-        ui->makeCB->insertItem(2, i18n("Select a custom driver"), PPDList);
-    }
-    ui->membersLV->setProperty("different", false);
-
-    ui->descriptionLE->setText(printer.info());
-    ui->descriptionLE->setProperty("orig_text", printer.info());
-    ui->descriptionLE->setProperty("different", false);
-
-    ui->locationLE->setText(printer.location());
-    ui->locationLE->setProperty("orig_text", printer.location());
-    ui->locationLE->setProperty("different", false);
-
-    ui->connectionLE->setText(printer.deviceUri());
-    ui->connectionLE->setProperty("orig_text", printer.deviceUri());
-    ui->connectionLE->setProperty("different", false);
-
-    // clear old values
-    m_changes = 0;
-    m_changedValues.clear();
-
-    emit changed(0);
-}
-
-void ModifyPrinter::modelChanged()
-{
-    bool isDifferent = ui->membersLV->hasChanges();
-    if (isDifferent != ui->membersLV->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        ui->membersLV->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-
-    // store the new values
-    if (isDifferent) {
-        m_changedValues[KCUPS_MEMBER_URIS] = ui->membersLV->currentSelected(true);
-    } else {
-        m_changedValues.remove(KCUPS_MEMBER_URIS);
-    }
-}
-
-void ModifyPrinter::textChanged(const QString &text)
-{
-    KLineEdit *le = qobject_cast<KLineEdit *>(sender());
-
-    bool isDifferent = le->property("orig_text") != text;
-    if (isDifferent != le->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        le->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-
-    // store the new values
-    QString attribute = le->property("AttributeName").toString();
-    if (isDifferent) {
-        m_changedValues[attribute] = text;
-    } else {
-        m_changedValues.remove(attribute);
-    }
-}
-
-void ModifyPrinter::save()
-{
-    if (m_changes) {
-        QVariantHash args = m_changedValues;
-        QString fileName;
-        kDebug() << args;
-        if (args.contains("ppd-name") &&
-            args["ppd-name"].type() == QVariant::Bool) {
-
-            fileName = ui->makeCB->itemData(ui->makeCB->currentIndex(), PPDFile).toString();
-            args.remove("ppd-name");
-        }
-        kDebug() << fileName;
-
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        if (m_isClass) {
-            request->addOrModifyClass(m_destName, args);
-        } else {
-            request->addOrModifyPrinter(m_destName, args, fileName);
-        }
-        request->waitTillFinished();
-        if (request) {
-            if (!request->hasError()) {
-                if (m_changedValues.contains("ppd-name")) {
-                    emit ppdChanged();
-                }
-                request->getPrinterAttributes(m_destName, m_isClass, neededValues());
-                request->waitTillFinished();
-
-                if (!request->hasError() && !request->printers().isEmpty()) {
-                    KCupsPrinter printer = request->printers().first();
-                    setValues(printer);
-                }
-            } else {
-                KMessageBox::detailedSorry(this,
-                                           m_isClass ? i18nc("@info", "Failed to configure class") :
-                                                       i18nc("@info", "Failed to configure printer"),
-                                           request->errorMsg(),
-                                           i18nc("@title:window", "Failed"));
-            }
-            request->deleteLater();
-        }
-    }
-}
-
-QVariantHash ModifyPrinter::modifiedValues() const
-{
-    return m_changedValues;
-}
-
-bool ModifyPrinter::hasChanges()
-{
-    return m_changes;
-}
-
-void ModifyPrinter::setRemote(bool remote)
-{
-    ui->descriptionLE->setReadOnly(remote);
-    ui->locationLE->setReadOnly(remote);
-    ui->connectionLE->setReadOnly(remote);
-    ui->makeCB->setEnabled(!remote);
-}
-
-void ModifyPrinter::setCurrentMake(const QString &make)
-{
-    m_make = make;
-}
-
-void ModifyPrinter::setCurrentMakeAndModel(const QString &makeAndModel)
-{
-    m_makeAndModel = makeAndModel;
-}
-
-QStringList ModifyPrinter::neededValues() const
-{
-    QStringList ret;
-    ret << KCUPS_PRINTER_INFO;
-    ret << KCUPS_PRINTER_LOCATION;
-
-    if (m_isClass) {
-        ret << KCUPS_MEMBER_NAMES;
-    } else {
-        ret << KCUPS_DEVICE_URI;
-        ret << KCUPS_PRINTER_MAKE_AND_MODEL;
-    }
-    return ret;
-}
-
-#include "moc_ModifyPrinter.cpp"
diff --git a/print-manager/configure-printer/ModifyPrinter.h b/print-manager/configure-printer/ModifyPrinter.h
deleted file mode 100644 (file)
index d33b485..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef MODIFY_PRINTER_H
-#define MODIFY_PRINTER_H
-
-#include "PrinterPage.h"
-
-#include "KCupsRequest.h"
-
-#include <QWidget>
-
-QT_BEGIN_NAMESPACE
-class Ui_ModifyPrinter;
-QT_END_NAMESPACE
-
-class ModifyPrinter : public PrinterPage
-{
-    Q_OBJECT
-    Q_ENUMS(Role)
-public:
-    typedef enum {
-        PPDDefault,
-        PPDCustom,
-        PPDFile,
-        PPDList,
-        PPDName = Qt::UserRole + 1
-    } Role;
-    explicit ModifyPrinter(const QString &destName, bool isClass, QWidget *parent = 0);
-    ~ModifyPrinter();
-
-    bool hasChanges();
-    QVariantHash modifiedValues() const;
-    QStringList neededValues() const;
-    void setRemote(bool remote);
-
-    void setValues(const KCupsPrinter &printer);
-    void setCurrentMake(const QString &make);
-    void setCurrentMakeAndModel(const QString &makeAndModel);
-
-    void save();
-
-signals:
-    void ppdChanged();
-
-private slots:
-    void textChanged(const QString &text);
-    void on_makeCB_activated(int index);
-    void ppdSelectionAccepted();
-    void ppdSelectionRejected();
-    void modelChanged();
-
-private:
-    Ui_ModifyPrinter *ui;
-    QString m_destName, m_make, m_makeAndModel;
-    bool m_isClass;
-    QVariantHash m_changedValues;
-    int m_changes;
-};
-
-#endif
diff --git a/print-manager/configure-printer/ModifyPrinter.ui b/print-manager/configure-printer/ModifyPrinter.ui
deleted file mode 100644 (file)
index 39aab41..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ModifyPrinter</class>
- <widget class="QWidget" name="ModifyPrinter">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>472</width>
-    <height>470</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <layout class="QFormLayout" name="formLayout">
-     <property name="fieldGrowthPolicy">
-      <enum>QFormLayout::ExpandingFieldsGrow</enum>
-     </property>
-     <item row="0" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>Name:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="label">
-       <property name="text">
-        <string>Description:</string>
-       </property>
-       <property name="buddy">
-        <cstring>descriptionLE</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="KLineEdit" name="descriptionLE">
-       <property name="toolTip">
-        <string>Human-readable description such as &quot;HP LaserJet with Duplexer&quot;</string>
-       </property>
-       <property name="AttributeName" stdset="0">
-        <string notr="true">printer-info</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_2">
-       <property name="text">
-        <string>Location:</string>
-       </property>
-       <property name="buddy">
-        <cstring>locationLE</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="KLineEdit" name="locationLE">
-       <property name="toolTip">
-        <string>Human-readable location such as &quot;Lab 1&quot;</string>
-       </property>
-       <property name="AttributeName" stdset="0">
-        <string notr="true">printer-location</string>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="0" colspan="2">
-      <widget class="Line" name="line">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="0">
-      <widget class="QLabel" name="connectionL">
-       <property name="text">
-        <string>Connection:</string>
-       </property>
-       <property name="buddy">
-        <cstring>connectionLE</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="KLineEdit" name="connectionLE">
-       <property name="whatsThis">
-        <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Examples:&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;http://hostname:631/ipp/&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;http://hostname:631/ipp/port1&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;ipp://hostname/ipp/&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;ipp://hostname/ipp/port1&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;lpd://hostname/queue&lt;/p&gt;
-&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;socket://hostname&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;socket://hostname:9100&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-       </property>
-       <property name="AttributeName" stdset="0">
-        <string notr="true">device-uri</string>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="0">
-      <widget class="QLabel" name="membersL">
-       <property name="text">
-        <string>Members</string>
-       </property>
-       <property name="buddy">
-        <cstring>membersLV</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="1">
-      <widget class="ClassListWidget" name="membersLV"/>
-     </item>
-     <item row="6" column="0">
-      <widget class="QLabel" name="driverL">
-       <property name="text">
-        <string>Driver:</string>
-       </property>
-       <property name="buddy">
-        <cstring>makeCB</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="6" column="1">
-      <widget class="KComboBox" name="makeCB">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <widget class="QLabel" name="nameL">
-       <property name="text">
-        <string notr="true">name</string>
-       </property>
-       <property name="textFormat">
-        <enum>Qt::PlainText</enum>
-       </property>
-       <property name="textInteractionFlags">
-        <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>ClassListWidget</class>
-   <extends>QListView</extends>
-   <header>ClassListWidget.h</header>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>descriptionLE</tabstop>
-  <tabstop>locationLE</tabstop>
-  <tabstop>connectionLE</tabstop>
-  <tabstop>membersLV</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/configure-printer/PrinterBehavior.cpp b/print-manager/configure-printer/PrinterBehavior.cpp
deleted file mode 100644 (file)
index c8aefdb..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrinterBehavior.h"
-#include "ui_PrinterBehavior.h"
-
-#include <KComboBox>
-#include <KDebug>
-#include <KLocale>
-
-PrinterBehavior::PrinterBehavior(const QString &destName, bool isClass, QWidget *parent) :
-    PrinterPage(parent),
-    ui(new Ui_PrinterBehavior),
-    m_destName(destName),
-    m_isClass(isClass),
-    m_changes(0)
-{
-    ui->setupUi(this);
-
-    connect(ui->errorPolicyCB, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(currentIndexChangedCB(int)));
-    connect(ui->operationPolicyCB, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(currentIndexChangedCB(int)));
-
-    connect(ui->startingBannerCB, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(currentIndexChangedCB(int)));
-    connect(ui->endingBannerCB, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(currentIndexChangedCB(int)));
-
-    connect(ui->usersELB, SIGNAL(changed()),
-            this, SLOT(userListChanged()));
-    connect(ui->allowRB, SIGNAL(toggled(bool)),
-            this, SLOT(userListChanged()));
-}
-
-PrinterBehavior::~PrinterBehavior()
-{
-    delete ui;
-}
-
-void PrinterBehavior::setValues(const KCupsPrinter &printer)
-{
-    int defaultChoice;
-    ui->errorPolicyCB->clear();
-    foreach (const QString &value, printer.errorPolicySupported()) {
-        ui->errorPolicyCB->addItem(errorPolicyString(value), value);
-    }
-    QStringList errorPolicy = printer.errorPolicy();
-    if (!errorPolicy.isEmpty()) {
-        defaultChoice = ui->errorPolicyCB->findData(errorPolicy.first());
-        ui->errorPolicyCB->setCurrentIndex(defaultChoice);
-        ui->errorPolicyCB->setProperty("defaultChoice", defaultChoice);
-    }
-
-    ui->operationPolicyCB->clear();
-    foreach (const QString &value, printer.opPolicySupported()) {
-        ui->operationPolicyCB->addItem(operationPolicyString(value), value);
-    }
-    QStringList operationPolicy = printer.opPolicy();
-    if (!errorPolicy.isEmpty()) {
-        defaultChoice = ui->operationPolicyCB->findData(operationPolicy.first());
-        ui->operationPolicyCB->setCurrentIndex(defaultChoice);
-        ui->operationPolicyCB->setProperty("defaultChoice", defaultChoice);
-    }
-
-    ui->startingBannerCB->clear();
-    ui->endingBannerCB->clear();
-    foreach (const QString &value, printer.jobSheetsSupported()) {
-        ui->startingBannerCB->addItem(jobSheetsString(value), value);
-        ui->endingBannerCB->addItem(jobSheetsString(value), value);
-    }
-    QStringList bannerPolicy = printer.jobSheetsDefault();
-    if (bannerPolicy.size() == 2) {
-        defaultChoice = ui->startingBannerCB->findData(bannerPolicy.at(0));
-        ui->startingBannerCB->setCurrentIndex(defaultChoice);
-        ui->startingBannerCB->setProperty("defaultChoice", defaultChoice);
-        defaultChoice = ui->endingBannerCB->findData(bannerPolicy.at(1));
-        ui->endingBannerCB->setCurrentIndex(defaultChoice);
-        ui->endingBannerCB->setProperty("defaultChoice", defaultChoice);
-    }
-
-    if (!printer.requestingUserNameAllowed().isEmpty()) {
-        QStringList list = printer.requestingUserNameAllowed();
-        list.sort(); // sort the list here to be able to comapare it later
-        ui->usersELB->setEnabled(true);
-        if (list != ui->usersELB->items()) {
-            ui->usersELB->clear();
-            ui->usersELB->insertStringList(list);
-        }
-        ui->usersELB->setProperty("defaultList", list);
-        ui->allowRB->setProperty("defaultChoice", true);
-        // Set checked AFTER the default choice was set
-        // otherwise the signal will be emmited
-        // which sets that we have a change
-        ui->allowRB->setChecked(true);
-
-    } else if (!printer.requestingUserNameDenied().isEmpty()) {
-        QStringList list = printer.requestingUserNameDenied();
-        list.sort(); // sort the list here to be able to comapare it later
-        ui->usersELB->setEnabled(true);
-        if (list != ui->usersELB->items()) {
-            ui->usersELB->clear();
-            ui->usersELB->insertStringList(list);
-        }
-        ui->usersELB->setProperty("defaultList", list);
-        ui->allowRB->setProperty("defaultChoice", false);
-        // Set checked AFTER the default choice was set
-        // otherwise the signal will be emmited
-        // which sets that we have a change
-        ui->preventRB->setChecked(true);
-    }
-
-    // Clear previous changes
-    m_changes = 0;
-    emit changed(false);
-    m_changedValues.clear();
-    ui->errorPolicyCB->setProperty("different", false);
-    ui->operationPolicyCB->setProperty("different", false);
-    ui->startingBannerCB->setProperty("different", false);
-    ui->endingBannerCB->setProperty("different", false);
-    ui->usersELB->setProperty("different", false);
-}
-
-void PrinterBehavior::userListChanged()
-{
-    if (ui->usersELB->isEnabled() == false &&
-        (ui->allowRB->isChecked() ||
-         ui->preventRB->isChecked())) {
-        // this only happen when the list was empty
-       ui-> usersELB->setEnabled(true);
-    }
-
-    QStringList currentList, defaultList;
-    currentList = ui->usersELB->items();
-    // sort the list so we can be sure it's different
-    currentList.sort();
-    defaultList = ui->usersELB->property("defaultList").value<QStringList>();
-
-    bool isDifferent = currentList != defaultList;
-    if (isDifferent == false && currentList.isEmpty() == false) {
-        // if the lists are equal and not empty the user might have
-        // changed the Radio Button...
-        if (ui->allowRB->isChecked() != ui->allowRB->property("defaultChoice").toBool()) {
-            isDifferent = true;
-        }
-    }
-
-    if (isDifferent != ui->usersELB->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        ui->usersELB->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-}
-
-void PrinterBehavior::currentIndexChangedCB(int index)
-{
-    KComboBox *comboBox = qobject_cast<KComboBox*>(sender());
-    bool isDifferent = comboBox->property("defaultChoice").toInt() != index;
-
-    if (isDifferent != comboBox->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        comboBox->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-
-    QString attribute = comboBox->property("AttributeName").toString();
-    QVariant value;
-    // job-sheets-default has always two values
-    if (attribute == "job-sheets-default") {
-        QStringList values;
-        values << ui->startingBannerCB->itemData(ui->startingBannerCB->currentIndex()).toString();
-        values << ui->endingBannerCB->itemData(ui->endingBannerCB->currentIndex()).toString();
-        value = values;
-    } else {
-        value = comboBox->itemData(index).toString();
-    }
-
-    // store the new values
-    if (isDifferent) {
-        m_changedValues[attribute] = value;
-    } else {
-        m_changedValues.remove(attribute);
-    }
-}
-
-QString PrinterBehavior::errorPolicyString(const QString &policy) const
-{
-    // TODO search for others policies of printer-error-policy-supported
-    if (policy == "abort-job") {
-        return i18n("Abort job");
-    } else if (policy == "retry-current-job") {
-        return i18n("Retry current job");
-    } else if (policy == "retry-job") {
-        return i18n("Retry job");
-    } else if (policy == "stop-printer") {
-        return i18n("Stop printer");
-    }
-    return policy;
-}
-
-QString PrinterBehavior::operationPolicyString(const QString &policy) const
-{
-    // TODO search for others policies of printer-error-policy-supported
-    if (policy == "authenticated") {
-        return i18n("Authenticated");
-    } else if (policy == "default") {
-        return i18n("Default");
-    }
-    return policy;
-}
-
-QString PrinterBehavior::jobSheetsString(const QString &policy) const
-{
-    // TODO search for others policies of printer-error-policy-supported
-    if (policy == "none") {
-        return i18n("None");
-    } else if (policy == "classified") {
-        return i18n("Classified");
-    } else if (policy == "confidential") {
-        return i18n("Confidential");
-    } else if (policy == "secret") {
-        return i18n("Secret");
-    } else if (policy == "standard") {
-        return i18n("Standard");
-    } else if (policy == "topsecret") {
-        return i18n("Topsecret");
-    } else if (policy == "unclassified") {
-        return i18n("Unclassified");
-    }
-    return policy;
-}
-
-void PrinterBehavior::save()
-{
-    if (m_changes) {
-        QVariantHash changedValues = m_changedValues;
-        // since a QStringList might be big we get it here instead
-        // of adding it at edit time.
-        if (ui->usersELB->property("different").toBool()) {
-            QStringList list = ui->usersELB->items();
-            if (list.isEmpty()) {
-                list << "all";
-                changedValues[KCUPS_REQUESTING_USER_NAME_ALLOWED] = list;
-            } else {
-                if (ui->allowRB->isChecked()) {
-                    changedValues[KCUPS_REQUESTING_USER_NAME_ALLOWED] = list;
-                } else {
-                    changedValues[KCUPS_REQUESTING_USER_NAME_DENIED] = list;
-                }
-            }
-        }
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        if (m_isClass) {
-            request->addOrModifyClass(m_destName, changedValues);
-        } else {
-            request->addOrModifyPrinter(m_destName, changedValues);
-        }
-        request->waitTillFinished();
-        if (request) {
-            if (!request->hasError()) {
-                request->getPrinterAttributes(m_destName, m_isClass, neededValues());
-                request->waitTillFinished();
-                if (request && !request->hasError() && !request->printers().isEmpty()){
-                    KCupsPrinter printer = request->printers().first();
-                    setValues(printer);
-                }
-            }
-            request->deleteLater();
-        }
-    }
-}
-
-void PrinterBehavior::setRemote(bool remote)
-{
-    ui->errorPolicyCB->setEnabled(!remote);
-    ui->operationPolicyCB->setEnabled(!remote);
-    ui->startingBannerCB->setEnabled(!remote);
-    ui->endingBannerCB->setEnabled(!remote);
-    ui->allowRB->setEnabled(!remote);
-    ui->preventRB->setEnabled(!remote);
-    ui->usersELB->setEnabled(!remote);
-}
-
-bool PrinterBehavior::hasChanges()
-{
-    return m_changes;
-}
-
-QStringList PrinterBehavior::neededValues() const
-{
-    QStringList ret;
-    ret << KCUPS_JOB_SHEETS_DEFAULT;
-    ret << KCUPS_JOB_SHEETS_SUPPORTED;
-
-    ret << KCUPS_PRINTER_ERROR_POLICY;
-    ret << KCUPS_PRINTER_ERROR_POLICY_SUPPORTED;
-
-    ret << KCUPS_PRINTER_OP_POLICY;
-    ret << KCUPS_PRINTER_OP_POLICY_SUPPORTED;
-
-    ret << KCUPS_REQUESTING_USER_NAME_ALLOWED;
-    ret << KCUPS_REQUESTING_USER_NAME_DENIED;
-
-    return ret;
-}
diff --git a/print-manager/configure-printer/PrinterBehavior.h b/print-manager/configure-printer/PrinterBehavior.h
deleted file mode 100644 (file)
index 62389dc..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTER_BEHAVIOR_H
-#define PRINTER_BEHAVIOR_H
-
-#include "PrinterPage.h"
-
-#include "KCupsRequest.h"
-#include <QWidget>
-
-QT_BEGIN_NAMESPACE
-class Ui_PrinterBehavior;
-QT_END_NAMESPACE
-
-class PrinterBehavior : public PrinterPage
-{
-    Q_OBJECT
-public:
-    explicit PrinterBehavior(const QString &destName, bool isClass, QWidget *parent = 0);
-    ~PrinterBehavior();
-
-    void setValues(const KCupsPrinter &printer);
-    void setRemote(bool remote);
-    bool hasChanges();
-
-    QStringList neededValues() const;
-    void save();
-
-private slots:
-    void currentIndexChangedCB(int index);
-    void userListChanged();
-
-private:
-    QString errorPolicyString(const QString &policy) const;
-    QString operationPolicyString(const QString &policy) const;
-    QString jobSheetsString(const QString &policy) const;
-
-    Ui_PrinterBehavior *ui;
-    QString m_destName;
-    bool m_isClass;
-    QVariantHash m_changedValues;
-    int m_changes;
-};
-
-#endif
diff --git a/print-manager/configure-printer/PrinterBehavior.ui b/print-manager/configure-printer/PrinterBehavior.ui
deleted file mode 100644 (file)
index 4d600fe..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrinterBehavior</class>
- <widget class="QWidget" name="PrinterBehavior">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>486</width>
-    <height>484</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="4" column="0">
-    <widget class="QGroupBox" name="BanneryGB">
-     <property name="title">
-      <string>Banners</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_5">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string>Starting Banner:</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="buddy">
-         <cstring>startingBannerCB</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="KComboBox" name="startingBannerCB">
-        <property name="AttributeName" stdset="0">
-         <string notr="true">job-sheets-default</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_7">
-        <property name="text">
-         <string>Ending Banner:</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="buddy">
-         <cstring>endingBannerCB</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="KComboBox" name="endingBannerCB">
-        <property name="AttributeName" stdset="0">
-         <string notr="true">job-sheets-default</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QGroupBox" name="PoliciesGB">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="title">
-      <string>Policies</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_3">
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string>Operation Policy:</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="buddy">
-         <cstring>operationPolicyCB</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>Error Policy:</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-        <property name="buddy">
-         <cstring>errorPolicyCB</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="KComboBox" name="errorPolicyCB">
-        <property name="AttributeName" stdset="0">
-         <string notr="true">printer-error-policy</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="KComboBox" name="operationPolicyCB">
-        <property name="AttributeName" stdset="0">
-         <string notr="true">printer-op-policy</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="7" column="0">
-    <widget class="QGroupBox" name="AllowGB">
-     <property name="title">
-      <string>Allowed Users</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_6">
-      <item row="2" column="0">
-       <widget class="QGroupBox" name="groupBox">
-        <property name="title">
-         <string/>
-        </property>
-        <layout class="QGridLayout" name="gridLayout_2">
-         <item row="0" column="0">
-          <widget class="KEditListWidget" name="usersELB">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="buttons">
-            <set>KEditListWidget::Add|KEditListWidget::Remove</set>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="0" column="0">
-       <widget class="QRadioButton" name="allowRB">
-        <property name="text">
-         <string>Allow these users to print</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QRadioButton" name="preventRB">
-        <property name="text">
-         <string>Prevent these users from printing </string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KEditListWidget</class>
-   <extends>QWidget</extends>
-   <header>keditlistwidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/configure-printer/PrinterOptions.cpp b/print-manager/configure-printer/PrinterOptions.cpp
deleted file mode 100644 (file)
index a855353..0000000
+++ /dev/null
@@ -1,824 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- *                                                                         *
- *   The save PPD snipet is from CUPS                                      *
- *   Copyright 2007-2009 by Apple Inc.                                     *
- *   Copyright 1997-2007 by Easy Software Products.                        *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *   This is converted from LGPL 2 in accordance with section 3            *
- *   See http://www.cups.org/documentation.php/license.html                *
- ***************************************************************************/
-
-#include "PrinterOptions.h"
-
-#include "ui_PrinterOptions.h"
-
-#include <KCupsRequest.h>
-#include <NoSelectionRectDelegate.h>
-
-#include <QFormLayout>
-#include <KComboBox>
-#include <QRadioButton>
-#include <QButtonGroup>
-#include <QStandardItemModel>
-#include <QListView>
-#include <QGroupBox>
-
-#include <KDebug>
-#include <KLocale>
-
-#include <ctype.h>
-
-#define DEFAULT_CHOICE "defaultChoice"
-
-PrinterOptions::PrinterOptions(const QString &destName, bool isClass, bool isRemote, QWidget *parent) :
-    PrinterPage(parent),
-    ui(new Ui_PrinterOptions),
-    m_destName(destName),
-    m_isClass(isClass),
-    m_isRemote(isRemote),
-    m_ppd(NULL),
-    m_changes(0)
-{
-    ui->setupUi(this);
-
-    reloadPPD();
-}
-
-void PrinterOptions::on_autoConfigurePB_clicked()
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->printCommand(m_destName, "AutoConfigure", i18n("Set Default Options"));
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrinterOptions::reloadPPD()
-{
-    //     The caller "owns" the file that is created and must unlink the returned filename.
-    if (!m_filename.isNull()) {
-        unlink(m_filename.toUtf8());
-    }
-
-    // remove all the options
-    while (ui->verticalLayout->count()) {
-        kDebug() << "removing" << ui->verticalLayout->count();
-        QLayoutItem *item = ui->verticalLayout->itemAt(0);
-        ui->verticalLayout->removeItem(item);
-        if (item->widget()) {
-            item->widget()->deleteLater();
-            delete item;
-        } else if (item->layout()) {
-            kDebug() << "removing layout" << ui->verticalLayout->count();
-
-//            item->layout()->deleteLater();
-        } else if (item->spacerItem()) {
-            delete item->spacerItem();
-        }
-    }
-    m_changes = 0;
-    m_customValues.clear();
-    emit changed(false);
-
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->getPrinterPPD(m_destName);
-    request->waitTillFinished();
-    if (!request) {
-        return;
-    }
-    m_filename = request->printerPPD();
-    m_ppd = ppdOpenFile(m_filename.toUtf8());
-    request->deleteLater();
-    if (m_ppd == NULL) {
-        kWarning() << "Could not open ppd file:" << m_filename << request->errorMsg();
-        m_filename.clear();
-        return;
-    }
-
-    // select the default options on the ppd file
-    ppdMarkDefaults(m_ppd);
-
-    // TODO tri to use QTextCodec aliases
-    const char *lang_encoding;
-    lang_encoding = m_ppd->lang_encoding;
-    if (lang_encoding && !strcasecmp (lang_encoding, "ISOLatin1")) {
-        m_codec = QTextCodec::codecForName("ISO-8859-1");
-    } else if (lang_encoding && !strcasecmp (lang_encoding, "ISOLatin2")) {
-        m_codec = QTextCodec::codecForName("ISO-8859-2");
-    } else if (lang_encoding && !strcasecmp (lang_encoding, "ISOLatin5")) {
-        m_codec = QTextCodec::codecForName("ISO-8859-5");
-    } else if (lang_encoding && !strcasecmp (lang_encoding, "JIS83-RKSJ")) {
-        m_codec = QTextCodec::codecForName("SHIFT-JIS");
-    } else if (lang_encoding && !strcasecmp (lang_encoding, "MacStandard")) {
-        m_codec = QTextCodec::codecForName("MACINTOSH");
-    } else if (lang_encoding && !strcasecmp (lang_encoding, "WindowsANSI")) {
-        m_codec = QTextCodec::codecForName("WINDOWS-1252");
-    } else {
-        // Guess
-        m_codec = QTextCodec::codecForName(lang_encoding);
-    }
-    if (m_codec == 0) {
-        m_codec = QTextCodec::codecForName("UTF-8");
-    }
-
-    if (m_ppd->manufacturer) {
-        m_make = m_codec->toUnicode(m_ppd->manufacturer);
-    }
-
-    if (m_ppd->nickname) {
-        m_makeAndModel = m_codec->toUnicode(m_ppd->nickname);
-    }
-
-    ui->autoConfigurePB->hide();
-    ppd_attr_t  *ppdattr;
-    if (m_ppd->num_filters == 0 ||
-        ((ppdattr = ppdFindAttr(m_ppd, "cupsCommands", NULL)) != NULL &&
-           ppdattr->value && strstr(ppdattr->value, "AutoConfigure"))) {
-        ui->autoConfigurePB->show();
-    } else {
-        for (int i = 0; i < m_ppd->num_filters; i ++) {
-            if (!strncmp(m_ppd->filters[i], "application/vnd.cups-postscript", 31)) {
-              ui->autoConfigurePB->show();
-              break;
-            }
-        }
-    }
-
-    createGroups();
-}
-
-void PrinterOptions::createGroups()
-{
-    int i;
-    ppd_group_t *group;
-    // Iterate over the groups
-    for (i = 0, group = m_ppd->groups;
-         i < m_ppd->num_groups;
-         i++, group++) {
-        // The name of the group
-        QString name = m_codec->toUnicode(group->name);
-
-        // The humman name of the group
-        QString text = m_codec->toUnicode(group->text);
-
-        // The group box were the options will be laid out
-        QGroupBox *groupBox = new QGroupBox(text, ui->scrollArea);
-
-        // Create the form layout to put options in
-        QFormLayout *gFormLayout = new QFormLayout(groupBox);
-        gFormLayout->setFormAlignment(Qt::AlignCenter);
-        groupBox->setLayout(gFormLayout);
-        ui->verticalLayout->addWidget(groupBox);
-
-        int j;
-        ppd_option_t *option;
-        // Iterate over the options in the group
-        for (j = 0, option = group->options;
-             j < group->num_options;
-             j++, option++) {
-            QString oKeyword = m_codec->toUnicode(option->keyword);
-            QString oText = m_codec->toUnicode(option->text);
-            QString oDefChoice = m_codec->toUnicode(option->defchoice);
-            // The python system-config-printer skips this one
-            // which has the same data as "PageSize", let's hope
-            // they did the right thing
-            if (oKeyword == "PageRegion") {
-                continue;
-            }
-
-            QWidget *optionW = 0;
-            switch (option->ui) {
-            case PPD_UI_BOOLEAN:
-                optionW = pickBoolean(option, oKeyword, ui->scrollAreaWidgetContents);
-                break;
-            case PPD_UI_PICKMANY:
-                optionW = pickMany(option, oKeyword, ui->scrollAreaWidgetContents);
-                break;
-            case PPD_UI_PICKONE:
-                optionW = pickOne(option, oKeyword, ui->scrollAreaWidgetContents);
-                break;
-            default:
-                kWarning() << "Option type not recognized: " << option->ui;
-                // let's use the most common
-                optionW = pickOne(option, oKeyword, ui->scrollAreaWidgetContents);
-                break;
-            }
-
-            if (optionW) {
-                // insert the option widget
-                gFormLayout->addRow(oText, optionW);
-            }
-        }
-    }
-    ui->verticalLayout->addStretch();
-}
-
-QWidget* PrinterOptions::pickBoolean(ppd_option_t *option, const QString &keyword, QWidget *parent) const
-{
-    Q_UNUSED(keyword)
-    QWidget *widget = new QWidget(parent);
-    QHBoxLayout *layout = new QHBoxLayout(widget);
-    QButtonGroup *radioGroup = new QButtonGroup(widget);
-    widget->setLayout(layout);
-
-    int i;
-    ppd_choice_t *choice;
-    QString defChoice = m_codec->toUnicode(option->defchoice);
-    // Iterate over the choices in the option
-    for (i = 0, choice = option->choices;
-         i < option->num_choices;
-         ++i, ++choice) {
-        QString choiceName = m_codec->toUnicode(choice->choice);
-        QString cText = m_codec->toUnicode(choice->text);
-
-        QRadioButton *button = new QRadioButton(cText, widget);
-        button->setChecked(defChoice == choiceName);
-        button->setProperty("choice", choiceName);
-        // if we are in looking at a remote printer we can't save it
-        button->setEnabled(!m_isRemote);
-        layout->addWidget(button);
-        radioGroup->addButton(button);
-    }
-
-    // store the default choice
-    radioGroup->setProperty(DEFAULT_CHOICE, defChoice);
-    radioGroup->setProperty("Keyword", keyword);
-    connect(radioGroup, SIGNAL(buttonClicked(QAbstractButton*)),
-            this, SLOT(radioBtClicked(QAbstractButton*)));
-    return widget;
-}
-
-void PrinterOptions::radioBtClicked(QAbstractButton *button)
-{
-    QObject *radioGroup = sender();
-    bool isDifferent = radioGroup->property(DEFAULT_CHOICE).toString() != button->property("choice").toString();
-
-    if (isDifferent != radioGroup->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        radioGroup->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-
-    QString keyword = radioGroup->property("Keyword").toString();
-    QString choice = button->property("choice").toString();
-    radioGroup->setProperty("currentChoice", choice);
-
-    // TODO warning about conflicts
-//     ppdMarkOption(m_ppd,
-//                   m_codec->fromUnicode(keyword),
-//                   m_codec->fromUnicode(choice));
-    // store the new value
-    if (isDifferent) {
-        m_customValues[keyword] = radioGroup;
-    } else {
-        m_customValues.remove(keyword);
-    }
-}
-
-QWidget* PrinterOptions::pickMany(ppd_option_t *option, const QString &keyword, QWidget *parent) const
-{
-    Q_UNUSED(keyword)
-    QListView *listView = new QListView(parent);
-    QStandardItemModel *model = new QStandardItemModel(listView);
-    listView->setModel(model);
-    listView->setItemDelegate(new NoSelectionRectDelegate(listView));
-
-    int i;
-    ppd_choice_t *choice;
-    QString oDefChoice = m_codec->toUnicode(option->defchoice);
-    // Iterate over the choices in the option
-    for (i = 0, choice = option->choices;
-         i < option->num_choices;
-         ++i, ++choice) {
-        QString cName = m_codec->toUnicode(choice->choice);
-        QString cText = m_codec->toUnicode(choice->text);
-
-        QStandardItem *item = new QStandardItem(cText);
-        item->setData(cName);
-        item->setCheckable(true);
-        item->setEditable(false);
-        // TODO there is only ONE default choice, what about the other
-        // Items selected?!
-        item->setCheckState(oDefChoice == cName ? Qt::Checked : Qt::Unchecked);
-        model->appendRow(item);
-    }
-    // if we are in looking at a remote printer we can't save it
-    listView->setEnabled(!m_isRemote);
-    return qobject_cast<QWidget*>(listView);
-}
-
-QWidget* PrinterOptions::pickOne(ppd_option_t *option, const QString &keyword, QWidget *parent) const
-{
-    int i;
-    ppd_choice_t *choice;
-    QString defChoice = m_codec->toUnicode(option->defchoice);
-    KComboBox *comboBox = new KComboBox(parent);
-    // Iterate over the choices in the option
-    for (i = 0, choice = option->choices;
-         i < option->num_choices;
-         ++i, ++choice) {
-        QString cName = m_codec->toUnicode(choice->choice);
-        QString cText = m_codec->toUnicode(choice->text);
-
-        comboBox->addItem(cText, cName);
-    }
-    // store the default choice
-    comboBox->setProperty(DEFAULT_CHOICE, defChoice);
-    comboBox->setProperty("Keyword", keyword);
-    comboBox->setCurrentIndex(comboBox->findData(defChoice));
-    // connect the signal AFTER setCurrentIndex is called
-    connect(comboBox, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(currentIndexChangedCB(int)));
-    // if we are in looking at a remote printer we can't save it
-    comboBox->setEnabled(!m_isRemote);
-    return qobject_cast<QWidget*>(comboBox);
-}
-
-void PrinterOptions::currentIndexChangedCB(int index)
-{
-    KComboBox *comboBox = qobject_cast<KComboBox*>(sender());
-    bool isDifferent = comboBox->property(DEFAULT_CHOICE).toString() != comboBox->itemData(index).toString();
-
-    if (isDifferent != comboBox->property("different").toBool()) {
-        // it's different from the last time so add or remove changes
-        isDifferent ? m_changes++ : m_changes--;
-
-        comboBox->setProperty("different", isDifferent);
-        emit changed(m_changes);
-    }
-
-    QString keyword = comboBox->property("Keyword").toString();
-    QString value = comboBox->itemData(index).toString();
-    comboBox->setProperty("currentChoice", value);
-
-    // TODO warning about conflicts
-//     ppdMarkOption(m_ppd,
-//                   m_codec->fromUnicode(keyword),
-//                   m_codec->fromUnicode(value));
-    // store the new value
-    if (isDifferent) {
-        m_customValues[keyword] = qobject_cast<QObject*>(comboBox);
-    } else {
-        m_customValues.remove(keyword);
-    }
-}
-
-PrinterOptions::~PrinterOptions()
-{
-    if (m_ppd != NULL) {
-        ppdClose(m_ppd);
-    }
-
-    if (!m_filename.isNull()) {
-        unlink(m_filename.toUtf8());
-    }
-
-    delete ui;
-}
-
-const char *                            /* O - Value of variable */
-PrinterOptions::getVariable(const char *name)    const    /* I - Name of variable */
-{
-    QString keyword = m_codec->toUnicode(name);
-    if (m_customValues.contains(keyword)) {
-        QString value = m_customValues[keyword]->property("currentChoice").toString();
-        return m_codec->fromUnicode(value);
-    } else {
-        return NULL;
-    }
-}
-
-/*
- * 'get_points()' - Get a value in points.
- */
-double                           /* O - Number in points */
-PrinterOptions::get_points(double     number,           /* I - Original number */
-           const char *uval)            /* I - Units */
-{
-    if (!strcmp(uval, "mm"))              /* Millimeters */
-        return (number * 72.0 / 25.4);
-    else if (!strcmp(uval, "cm"))         /* Centimeters */
-        return (number * 72.0 / 2.54);
-    else if (!strcmp(uval, "in"))         /* Inches */
-        return (number * 72.0);
-    else if (!strcmp(uval, "ft"))         /* Feet */
-        return (number * 72.0 * 12.0);
-    else if (!strcmp(uval, "m"))          /* Meters */
-        return (number * 72.0 / 0.0254);
-    else                                  /* Points */
-        return (number);
-}
-
-/*
- * 'get_option_value()' - Return the value of an option.
- *
- * This function also handles generation of custom option values.
- */
-
-char *                           /* O - Value string or NULL on error */
-PrinterOptions::get_option_value(
-    ppd_file_t    *ppd,                 /* I - PPD file */
-    const char    *name,                /* I - Option name */
-    char          *buffer,              /* I - String buffer */
-    size_t        bufsize) const             /* I - Size of buffer */
-{
-    char          *bufptr,                /* Pointer into buffer */
-            *bufend;                /* End of buffer */
-    ppd_coption_t *coption;               /* Custom option */
-    ppd_cparam_t  *cparam;                /* Current custom parameter */
-    char          keyword[256];           /* Parameter name */
-    const char    *val,                   /* Parameter value */
-            *uval;                  /* Units value */
-    long          integer;                /* Integer value */
-    double        number,                 /* Number value */
-            number_points;          /* Number in points */
-
-
-    /*
-     * See if we have a custom option choice...
-     */
-
-    if ((val = getVariable(name)) == NULL) {
-        /*
-         * Option not found!
-         */
-
-        return (NULL);
-    } else if (strcasecmp(val, "Custom") ||
-               (coption = ppdFindCustomOption(ppd, name)) == NULL) {
-        /*
-         * Not a custom choice...
-         */
-
-        qstrncpy(buffer, val, bufsize);
-        return (buffer);
-    }
-
-    /*
-     * OK, we have a custom option choice, format it...
-     */
-
-    *buffer = '\0';
-
-    if (!strcmp(coption->keyword, "PageSize")) {
-        const char  *lval;                  /* Length string value */
-        double      width,                  /* Width value */
-                    width_points,           /* Width in points */
-                    length,                 /* Length value */
-                    length_points;          /* Length in points */
-
-
-        val  = getVariable("PageSize.Width");
-        lval = getVariable("PageSize.Height");
-        uval = getVariable("PageSize.Units");
-
-        if (!val || !lval || !uval ||
-                (width = strtod(val, NULL)) == 0.0 ||
-                (length = strtod(lval, NULL)) == 0.0 ||
-                (strcmp(uval, "pt") && strcmp(uval, "in") && strcmp(uval, "ft") &&
-                 strcmp(uval, "cm") && strcmp(uval, "mm") && strcmp(uval, "m"))) {
-            return (NULL);
-        }
-
-        width_points  = get_points(width, uval);
-        length_points = get_points(length, uval);
-
-        if (width_points < ppd->custom_min[0] ||
-                width_points > ppd->custom_max[0] ||
-                length_points < ppd->custom_min[1] ||
-                length_points > ppd->custom_max[1]) {
-            return (NULL);
-        }
-
-        snprintf(buffer, bufsize, "Custom.%gx%g%s", width, length, uval);
-    } else if (cupsArrayCount(coption->params) == 1) {
-        cparam = ppdFirstCustomParam(coption);
-        snprintf(keyword, sizeof(keyword), "%s.%s", coption->keyword, cparam->name);
-
-        if ((val = getVariable(keyword)) == NULL)
-            return (NULL);
-
-        switch (cparam->type) {
-        case PPD_CUSTOM_CURVE :
-        case PPD_CUSTOM_INVCURVE :
-        case PPD_CUSTOM_REAL :
-            if ((number = strtod(val, NULL)) == 0.0 ||
-                    number < cparam->minimum.custom_real ||
-                    number > cparam->maximum.custom_real)
-                return (NULL);
-
-            snprintf(buffer, bufsize, "Custom.%g", number);
-            break;
-        case PPD_CUSTOM_INT :
-            if (!*val || (integer = strtol(val, NULL, 10)) == LONG_MIN ||
-                    integer == LONG_MAX ||
-                    integer < cparam->minimum.custom_int ||
-                    integer > cparam->maximum.custom_int)
-                return (NULL);
-
-            snprintf(buffer, bufsize, "Custom.%ld", integer);
-            break;
-        case PPD_CUSTOM_POINTS :
-            snprintf(keyword, sizeof(keyword), "%s.Units", coption->keyword);
-
-            if ((number = strtod(val, NULL)) == 0.0 ||
-                    (uval = getVariable(keyword)) == NULL ||
-                    (strcmp(uval, "pt") && strcmp(uval, "in") && strcmp(uval, "ft") &&
-                     strcmp(uval, "cm") && strcmp(uval, "mm") && strcmp(uval, "m")))
-                return (NULL);
-
-            number_points = get_points(number, uval);
-            if (number_points < cparam->minimum.custom_points ||
-                    number_points > cparam->maximum.custom_points)
-                return (NULL);
-
-            snprintf(buffer, bufsize, "Custom.%g%s", number, uval);
-            break;
-        case PPD_CUSTOM_PASSCODE :
-            for (uval = val; *uval; ++uval) {
-                if (!isdigit(*uval & 255)) {
-                    return (NULL);
-                }
-            }
-        case PPD_CUSTOM_PASSWORD :
-        case PPD_CUSTOM_STRING :
-            integer = (long)strlen(val);
-            if (integer < cparam->minimum.custom_string ||
-                    integer > cparam->maximum.custom_string) {
-                return (NULL);
-            }
-
-            snprintf(buffer, bufsize, "Custom.%s", val);
-            break;
-        }
-    } else {
-        const char *prefix = "{";           /* Prefix string */
-
-
-        bufptr = buffer;
-        bufend = buffer + bufsize;
-
-        for (cparam = ppdFirstCustomParam(coption);
-             cparam;
-             cparam = ppdNextCustomParam(coption)) {
-            snprintf(keyword, sizeof(keyword), "%s.%s", coption->keyword,
-                     cparam->name);
-
-            if ((val = getVariable(keyword)) == NULL) {
-                return (NULL);
-            }
-
-            snprintf(bufptr, bufend - bufptr, "%s%s=", prefix, cparam->name);
-            bufptr += strlen(bufptr);
-            prefix = " ";
-
-            switch (cparam->type) {
-            case PPD_CUSTOM_CURVE :
-            case PPD_CUSTOM_INVCURVE :
-            case PPD_CUSTOM_REAL :
-                if ((number = strtod(val, NULL)) == 0.0 ||
-                        number < cparam->minimum.custom_real ||
-                        number > cparam->maximum.custom_real)
-                    return (NULL);
-
-                snprintf(bufptr, bufend - bufptr, "%g", number);
-                break;
-            case PPD_CUSTOM_INT :
-                if (!*val || (integer = strtol(val, NULL, 10)) == LONG_MIN ||
-                        integer == LONG_MAX ||
-                        integer < cparam->minimum.custom_int ||
-                        integer > cparam->maximum.custom_int) {
-                    return (NULL);
-                }
-
-                snprintf(bufptr, bufend - bufptr, "%ld", integer);
-                break;
-            case PPD_CUSTOM_POINTS :
-                snprintf(keyword, sizeof(keyword), "%s.Units", coption->keyword);
-
-                if ((number = strtod(val, NULL)) == 0.0 ||
-                        (uval = getVariable(keyword)) == NULL ||
-                        (strcmp(uval, "pt") && strcmp(uval, "in") &&
-                         strcmp(uval, "ft") && strcmp(uval, "cm") &&
-                         strcmp(uval, "mm") && strcmp(uval, "m"))) {
-                    return (NULL);
-                }
-
-                number_points = get_points(number, uval);
-                if (number_points < cparam->minimum.custom_points ||
-                        number_points > cparam->maximum.custom_points) {
-                    return (NULL);
-                }
-
-                snprintf(bufptr, bufend - bufptr, "%g%s", number, uval);
-                break;
-
-            case PPD_CUSTOM_PASSCODE :
-                for (uval = val; *uval; uval ++) {
-                    if (!isdigit(*uval & 255)) {
-                        return (NULL);
-                    }
-                }
-            case PPD_CUSTOM_PASSWORD :
-            case PPD_CUSTOM_STRING :
-                integer = (long)strlen(val);
-                if (integer < cparam->minimum.custom_string ||
-                        integer > cparam->maximum.custom_string) {
-                    return (NULL);
-                }
-
-                if ((bufptr + 2) > bufend) {
-                    return (NULL);
-                }
-
-                bufend --;
-                *bufptr++ = '\"';
-
-                while (*val && bufptr < bufend) {
-                    if (*val == '\\' || *val == '\"') {
-                        if ((bufptr + 1) >= bufend) {
-                            return (NULL);
-                        }
-
-                        *bufptr++ = '\\';
-                    }
-
-                    *bufptr++ = *val++;
-                }
-
-                if (bufptr >= bufend) {
-                    return (NULL);
-                }
-
-                *bufptr++ = '\"';
-                *bufptr   = '\0';
-                bufend ++;
-                break;
-            }
-
-            bufptr += strlen(bufptr);
-        }
-
-        if (bufptr == buffer || (bufend - bufptr) < 2) {
-            return (NULL);
-        }
-
-        strcpy(bufptr, "}");
-    }
-
-    return (buffer);
-}
-
-
-void PrinterOptions::save()
-{
-    char tempfile[1024];
-    const char  *var;
-    cups_file_t *in,                    /* Input file */
-                *out;                   /* Output file */
-    char        line[1024],             /* Line from PPD file */
-                value[1024],            /* Option value */
-                keyword[1024],          /* Keyword from Default line */
-                *keyptr;                /* Pointer into keyword... */
-
-    // copy cups-1.4.2/cgi-bin line 3779
-    if (!m_filename.isNull()) {
-        out = cupsTempFile2(tempfile, sizeof(tempfile));
-        in  = cupsFileOpen(m_filename.toUtf8(), "r");
-
-        if (!in || !out)
-        {
-            if (in) {
-                cupsFileClose(in);
-            }
-
-            if (out) {
-                cupsFileClose(out);
-                unlink(tempfile);
-            }
-
-            // TODO add a KMessageBox::error
-
-            return;
-        }
-
-        while (cupsFileGets(in, line, sizeof(line))) {
-            if (!strncmp(line, "*cupsProtocol:", 14)) {
-                continue;
-            } else if (strncmp(line, "*Default", 8)) {
-                cupsFilePrintf(out, "%s\n", line);
-            } else {
-                /*
-                * Get default option name...
-                */
-                qstrncpy(keyword, line + 8, sizeof(keyword));
-
-                for (keyptr = keyword; *keyptr; keyptr ++) {
-                    if (*keyptr == ':' || isspace(*keyptr & 255)) {
-                        break;
-                    }
-                }
-
-                *keyptr = '\0';
-
-                if (!strcmp(keyword, "PageRegion") ||
-                    !strcmp(keyword, "PaperDimension") ||
-                    !strcmp(keyword, "ImageableArea")) {
-                    var = get_option_value(m_ppd, "PageSize", value, sizeof(value));
-                } else {
-                    var = get_option_value(m_ppd, keyword, value, sizeof(value));
-                }
-
-                if (!var) {
-                    cupsFilePrintf(out, "%s\n", line);
-                } else {
-                    cupsFilePrintf(out, "*Default%s: %s\n", keyword, var);
-                }
-            }
-        }
-
-        cupsFileClose(in);
-        cupsFileClose(out);
-    }
-
-    QVariantHash values; // we need null values
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    if (m_isClass) {
-        request->addOrModifyClass(m_destName, values);
-    } else {
-        request->addOrModifyPrinter(m_destName, values, tempfile);
-    }
-
-    // Disable the widget till the request is processed
-    // Otherwise the user might change something in the ui
-    // which won't be saved but the apply but when the request
-    // finishes we will set the current options as default
-    setEnabled(false);
-    request->waitTillFinished();
-
-    // unlink the file
-    unlink(tempfile);
-
-    if (request) {
-        setEnabled(true);
-        if (!request->hasError()) {
-            // if we succefully save the new ppd we need now to
-            // clear our changes
-            QHash<QString, QObject*>::const_iterator i = m_customValues.constBegin();
-            while (i != m_customValues.constEnd()) {
-                QString currentChoice;
-                currentChoice = i.value()->property("currentChoice").toString();
-                // Store the current choice as the default one
-                i.value()->setProperty(DEFAULT_CHOICE, currentChoice);
-                i.value()->setProperty("currentChoice", QVariant());
-                i.value()->setProperty("different", false);
-                ++i;
-            }
-            m_changes = 0;
-            m_customValues.clear();
-            emit changed(false);
-        }
-        request->deleteLater();
-    }
-}
-
-bool PrinterOptions::hasChanges()
-{
-    return m_changes;
-}
-
-QString PrinterOptions::currentMake() const
-{
-    return m_make;
-}
-
-QString PrinterOptions::currentMakeAndModel() const
-{
-    return m_makeAndModel;
-}
-
-#include "moc_PrinterOptions.cpp"
diff --git a/print-manager/configure-printer/PrinterOptions.h b/print-manager/configure-printer/PrinterOptions.h
deleted file mode 100644 (file)
index a66e88f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTER_OPTIONS_H
-#define PRINTER_OPTIONS_H
-
-#include "PrinterPage.h"
-
-#include <cups/ppd.h>
-#include <QTextCodec>
-#include <QAbstractButton>
-#include <QHash>
-
-QT_BEGIN_NAMESPACE
-class Ui_PrinterOptions;
-QT_END_NAMESPACE
-
-class PrinterOptions : public PrinterPage
-{
-    Q_OBJECT
-public:
-    explicit PrinterOptions(const QString &destName, bool isClass, bool isRemote, QWidget *parent = 0);
-    ~PrinterOptions();
-
-    bool hasChanges();
-
-    QString currentMake() const;
-    QString currentMakeAndModel() const;
-    void reloadPPD();
-
-    void save();
-
-private slots:
-    void on_autoConfigurePB_clicked();
-    void currentIndexChangedCB(int index);
-    void radioBtClicked(QAbstractButton *button);
-
-private:
-    QWidget* pickBoolean(ppd_option_t *option, const QString &keyword, QWidget *parent) const;
-    QWidget* pickMany(ppd_option_t *option, const QString &keyword, QWidget *parent) const;
-    QWidget* pickOne(ppd_option_t *option, const QString &keyword, QWidget *parent) const;
-    const char* getVariable(const char *name) const;
-    char * get_option_value(ppd_file_t *ppd, const char *name, char *buffer, size_t bufsize) const;
-    static double get_points(double number, const char *uval);
-
-    void createGroups();
-
-    Ui_PrinterOptions *ui;
-    QString m_destName;
-    bool m_isClass;
-    bool m_isRemote;
-    QString m_filename;
-    ppd_file_t *m_ppd;
-    int m_changes;
-    QTextCodec *m_codec;
-    QHash<QString, QObject*> m_customValues;
-    QString m_make, m_makeAndModel;
-};
-
-#endif
diff --git a/print-manager/configure-printer/PrinterOptions.ui b/print-manager/configure-printer/PrinterOptions.ui
deleted file mode 100644 (file)
index 8100c1d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrinterOptions</class>
- <widget class="QWidget" name="PrinterOptions">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>484</width>
-    <height>427</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="KPushButton" name="autoConfigurePB">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text">
-      <string>Query Printer for Default Options</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QScrollArea" name="scrollArea">
-     <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="widgetResizable">
-      <bool>true</bool>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignHCenter|Qt::AlignTop</set>
-     </property>
-     <widget class="QWidget" name="scrollAreaWidgetContents">
-      <property name="geometry">
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>484</width>
-        <height>401</height>
-       </rect>
-      </property>
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout"/>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KPushButton</class>
-   <extends>QPushButton</extends>
-   <header>kpushbutton.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/configure-printer/PrinterPage.cpp b/print-manager/configure-printer/PrinterPage.cpp
deleted file mode 100644 (file)
index 19d992c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrinterPage.h"
-
-#include <QHash>
-#include <QVariant>
-
-PrinterPage::PrinterPage(QWidget *parent)
- : QWidget(parent)
-{
-}
-
-QVariantHash PrinterPage::modifiedValues() const
-{
-    return QVariantHash();
-}
-
-void PrinterPage::setRemote(bool)
-{
-}
diff --git a/print-manager/configure-printer/PrinterPage.h b/print-manager/configure-printer/PrinterPage.h
deleted file mode 100644 (file)
index bf56149..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTER_PAGE_H
-#define PRINTER_PAGE_H
-
-#include <QWidget>
-#include <KCupsPrinter.h>
-
-class PrinterPage : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit PrinterPage(QWidget *parent = 0);
-    virtual bool hasChanges() { return false; }
-
-public:
-    virtual void save() {}
-    virtual QVariantHash modifiedValues() const;
-    virtual QStringList neededValues() const { return QStringList(); }
-    virtual void setRemote(bool remote);
-
-signals:
-    void changed(bool hasChanges);
-};
-
-#endif
diff --git a/print-manager/configure-printer/main.cpp b/print-manager/configure-printer/main.cpp
deleted file mode 100644 (file)
index 538e6f4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ConfigurePrinter.h"
-
-#include <config.h>
-
-#include <KDebug>
-#include <KLocale>
-#include <KAboutData>
-#include <KCmdLineArgs>
-
-int main(int argc, char **argv)
-{
-    KAboutData about("ConfigurePrinter",
-                     "print-manager",
-                     ki18n("ConfigurePrinter"),
-                     PM_VERSION,
-                     ki18n("ConfigurePrinter"),
-                     KAboutData::License_GPL,
-                     ki18n("(C) 2010-2013 Daniel Nicoletti"));
-
-    about.addAuthor(ki18n("Daniel Nicoletti"), KLocalizedString(), "dantti12@gmail.com");
-
-    KCmdLineArgs::init(argc, argv, &about);
-    KCmdLineOptions options;
-    options.add("configure-printer [printer name]", ki18n("Configure printer"));
-    KCmdLineArgs::addCmdLineOptions(options);
-
-    ConfigurePrinter::addCmdLineOptions();
-
-    if (!ConfigurePrinter::start()) {
-        //kDebug() << "ConfigurePrinter is already running!";
-        return 0;
-    }
-
-    ConfigurePrinter app;
-    return app.exec();
-}
diff --git a/print-manager/configure-printer/org.kde.ConfigurePrinter.service.in b/print-manager/configure-printer/org.kde.ConfigurePrinter.service.in
deleted file mode 100644 (file)
index 261d8cf..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.kde.ConfigurePrinter
-Exec=@KDE4_LIBEXEC_INSTALL_DIR@/configure-printer
diff --git a/print-manager/configure-printer/org.kde.ConfigurePrinter.xml b/print-manager/configure-printer/org.kde.ConfigurePrinter.xml
deleted file mode 100644 (file)
index 2d90bb5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
-   <interface name="org.kde.ConfigurePrinter">
-       <method name="ConfigurePrinter" >
-           <arg direction="in" type="s" name="printerName" />
-       </method>
-   </interface>
-</node>
diff --git a/print-manager/declarative-plugins/CMakeLists.txt b/print-manager/declarative-plugins/CMakeLists.txt
deleted file mode 100644 (file)
index a5f4850..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-set(printmanager_qml_plugin_SRCS
-   qmlplugins.cpp
-)
-
-add_library(printmanager SHARED ${printmanager_qml_plugin_SRCS})
-target_link_libraries(printmanager
-    ${QT_QTDECLARATIVE_LIBRARY}
-    ${KDE4_PLASMA_LIBS}
-    kcupslib
-)
-
-install(TARGETS printmanager DESTINATION ${KDE4_IMPORTS_INSTALL_DIR}/org/kde/printmanager)
-install(FILES qmldir DESTINATION ${KDE4_IMPORTS_INSTALL_DIR}/org/kde/printmanager)
diff --git a/print-manager/declarative-plugins/qmldir b/print-manager/declarative-plugins/qmldir
deleted file mode 100644 (file)
index 8518302..0000000
+++ /dev/null
@@ -1 +0,0 @@
-plugin printmanager
diff --git a/print-manager/declarative-plugins/qmlplugins.cpp b/print-manager/declarative-plugins/qmlplugins.cpp
deleted file mode 100644 (file)
index a54b41f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti <dantti12@gmail.com>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include "qmlplugins.h"
-
-#include <QtDeclarative/QDeclarativeItem>
-
-#include <PrinterModel.h>
-#include <PrinterSortFilterModel.h>
-#include <JobModel.h>
-#include <JobSortFilterModel.h>
-
-void QmlPlugins::registerTypes(const char* uri)
-{
-    Q_ASSERT(uri == QLatin1String("org.kde.printmanager"));
-    qmlRegisterType<PrinterModel>(uri, 0, 1, "PrinterModel");
-    qmlRegisterType<PrinterSortFilterModel>(uri, 0, 1, "PrinterSortFilterModel");
-    qmlRegisterType<JobModel>(uri, 0, 1, "JobModel");
-    qmlRegisterType<JobSortFilterModel>(uri, 0, 1, "JobSortFilterModel");
-}
-
-Q_EXPORT_PLUGIN2(printmanager, QmlPlugins)
diff --git a/print-manager/declarative-plugins/qmlplugins.h b/print-manager/declarative-plugins/qmlplugins.h
deleted file mode 100644 (file)
index 410c6ff..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti <dantti12@gmail.com>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#ifndef PRINT_MANAGER_PLUGINS_H
-#define PRINT_MANAGER_PLUGINS_H
-
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-
-class QmlPlugins : public QDeclarativeExtensionPlugin
-{
-    public:
-        virtual void registerTypes(const char * uri);
-};
-
-#endif // PRINT_MANAGER_PLUGINS_H
diff --git a/print-manager/libkcups/CMakeLists.txt b/print-manager/libkcups/CMakeLists.txt
deleted file mode 100644 (file)
index 7c2c1b1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-set(libkcups_SRCS
-    KIppRequest.cpp
-    KCupsPasswordDialog.cpp
-    KCupsConnection.cpp
-    KCupsJob.cpp
-    KCupsPrinter.cpp
-    KCupsServer.cpp
-    KCupsRequest.cpp
-    ClassListWidget.cpp
-    PPDModel.cpp
-    SelectMakeModel.cpp
-    NoSelectionRectDelegate.cpp
-    PrinterModel.cpp
-    PrinterSortFilterModel.cpp
-    JobModel.cpp
-    JobSortFilterModel.cpp
-    SelectMakeModel.ui
-)
-
-add_library(kcupslib SHARED ${libkcups_SRCS})
-target_link_libraries(kcupslib
-    ${KDE4_KIO_LIBS}
-    ${CUPS_LIBRARIES}
-)
-
-install(TARGETS kcupslib ${INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/print-manager/libkcups/ClassListWidget.cpp b/print-manager/libkcups/ClassListWidget.cpp
deleted file mode 100644 (file)
index 05b2cb6..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "ClassListWidget.h"
-
-#include "SelectMakeModel.h"
-
-#include "KCupsRequest.h"
-#include "NoSelectionRectDelegate.h"
-
-#include <QPointer>
-#include <KFileDialog>
-#include <KDebug>
-
-#include <KPixmapSequence>
-#include <KConfigDialogManager>
-
-ClassListWidget::ClassListWidget(QWidget *parent) :
-    QListView(parent),
-    m_request(0),
-    m_showClasses(false)
-{
-    KConfigDialogManager::changedMap()->insert("ClassListWidget", SIGNAL(changed(QString)));
-
-    m_model = new QStandardItemModel(this);
-    setModel(m_model);
-    setItemDelegate(new NoSelectionRectDelegate(this));
-
-    // Setup the busy cursor
-    m_busySeq = new KPixmapSequenceOverlayPainter(this);
-    m_busySeq->setSequence(KPixmapSequence("process-working", KIconLoader::SizeSmallMedium));
-    m_busySeq->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
-    m_busySeq->setWidget(viewport());
-
-    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(modelChanged()));
-
-    m_delayedInit.setInterval(0);
-    m_delayedInit.setSingleShot(true);
-    connect(&m_delayedInit, SIGNAL(timeout()), SLOT(init()));
-    m_delayedInit.start();
-}
-
-ClassListWidget::~ClassListWidget()
-{
-}
-
-void ClassListWidget::init()
-{
-    m_busySeq->start(); // Start spining
-    m_model->clear();
-
-    QStringList att;
-    att << KCUPS_PRINTER_NAME;
-    att << KCUPS_PRINTER_URI_SUPPORTED;
-    // Get destinations with these masks
-    m_request = new KCupsRequest;
-    connect(m_request, SIGNAL(finished()), this, SLOT(loadFinished()));
-    if (m_showClasses) {
-        m_request->getPrinters(att);
-    } else {
-        m_request->getPrinters(att,
-                               CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT);
-    }
-}
-
-void ClassListWidget::loadFinished()
-{
-    // If we have an old request running discard it's result and get a new one
-    if (m_request != sender()) {
-        sender()->deleteLater();
-        return;
-    }
-
-    m_busySeq->stop(); // Stop spining
-
-    KCupsPrinters printers = m_request->printers();
-    m_request->deleteLater();
-    m_request = 0;
-
-    foreach (const KCupsPrinter &printer, printers) {
-        QString destName = printer.name();
-        if (destName != m_printerName) {
-            QStandardItem *item = new QStandardItem;
-            item->setText(destName);
-            item->setCheckable(true);
-            item->setEditable(false);
-            item->setData(printer.uriSupported());
-            updateItemState(item);
-
-            m_model->appendRow(item);
-        }
-    }
-
-    modelChanged();
-}
-
-void ClassListWidget::modelChanged()
-{
-    QStringList currentMembers = currentSelected(false);
-
-    m_changed = m_selectedPrinters != currentMembers;
-
-    emit changed(selectedPrinters());
-    emit changed(m_changed);
-}
-
-QStringList ClassListWidget::currentSelected(bool uri) const
-{
-    QStringList currentMembers;
-    for (int i = 0; i < m_model->rowCount(); i++) {
-        QStandardItem *item = m_model->item(i);
-        if (item && item->checkState() == Qt::Checked) {
-            if (uri) {
-                currentMembers << item->data().toString();
-            } else {
-                currentMembers << item->text();
-            }
-        }
-    }
-    currentMembers.sort();
-    return currentMembers;
-}
-
-void ClassListWidget::updateItemState(QStandardItem *item) const
-{
-    if (m_selectedPrinters.contains(item->text())) {
-        item->setCheckState(Qt::Checked);
-    } else {
-        item->setCheckState(Qt::Unchecked);
-    }
-}
-
-bool ClassListWidget::hasChanges()
-{
-    return m_changed;
-}
-
-void ClassListWidget::setPrinter(const QString &printer)
-{
-    if (m_printerName != printer) {
-        m_printerName = printer;
-        m_delayedInit.start();
-    }
-}
-
-QString ClassListWidget::selectedPrinters() const
-{
-    return currentSelected(false).join(QLatin1String("|"));
-}
-
-void ClassListWidget::setSelectedPrinters(const QString &selected)
-{
-    m_selectedPrinters = selected.split(QLatin1Char('|'));
-    m_selectedPrinters.sort();
-    m_delayedInit.start();
-}
-
-bool ClassListWidget::showClasses() const
-{
-    return m_showClasses;
-}
-
-void ClassListWidget::setShowClasses(bool enable)
-{
-    if (m_showClasses != enable) {
-        m_showClasses = enable;
-        m_delayedInit.start();
-    }
-}
-
-#include "moc_ClassListWidget.cpp"
diff --git a/print-manager/libkcups/ClassListWidget.h b/print-manager/libkcups/ClassListWidget.h
deleted file mode 100644 (file)
index 5ad1289..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef CLASS_LIST_WIDGET_H
-#define CLASS_LIST_WIDGET_H
-
-#include <QStandardItemModel>
-#include <QListView>
-#include <QTimer>
-
-#include <KPixmapSequenceOverlayPainter>
-#include <kdemacros.h>
-
-class KCupsRequest;
-class KDE_EXPORT ClassListWidget : public QListView
-{
-    Q_OBJECT
-    Q_PROPERTY(QString selectedPrinters READ selectedPrinters WRITE setSelectedPrinters USER true)
-    Q_PROPERTY(bool showClasses READ showClasses WRITE setShowClasses)
-public:
-    explicit ClassListWidget(QWidget *parent = 0);
-    ~ClassListWidget();
-
-    bool hasChanges();
-    void setPrinter(const QString &printer);
-    QString selectedPrinters() const;
-    void setSelectedPrinters(const QString &selected);
-    bool showClasses() const;
-    void setShowClasses(bool enable);
-    QStringList currentSelected(bool uri) const;
-
-signals:
-    void changed(bool changed);
-    void changed(const QString &selected);
-
-private slots:
-    void init();
-    void loadFinished();
-    void modelChanged();
-
-private:
-    void updateItemState(QStandardItem *item) const;
-
-    QString m_printerName;
-    QStringList m_selectedPrinters;
-    KPixmapSequenceOverlayPainter *m_busySeq;
-    KCupsRequest *m_request;
-    bool m_changed;
-    bool m_showClasses;
-    QStandardItemModel *m_model;
-    QTimer m_delayedInit;
-};
-
-#endif
diff --git a/print-manager/libkcups/JobModel.cpp b/print-manager/libkcups/JobModel.cpp
deleted file mode 100644 (file)
index 2659de0..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "JobModel.h"
-
-#include <KCupsRequest.h>
-#include <KCupsPrinter.h>
-#include <KCupsJob.h>
-
-#include <QDateTime>
-#include <QMimeData>
-#include <QPointer>
-
-#include <KUser>
-#include <KDebug>
-#include <KLocale>
-#include <KMessageBox>
-
-JobModel::JobModel(QObject *parent) :
-    QStandardItemModel(parent),
-    m_jobRequest(0),
-    m_whichjobs(CUPS_WHICHJOBS_ACTIVE),
-    m_parentId(0)
-{
-    setHorizontalHeaderItem(ColStatus,        new QStandardItem(i18n("Status")));
-    setHorizontalHeaderItem(ColName,          new QStandardItem(i18n("Name")));
-    setHorizontalHeaderItem(ColUser,          new QStandardItem(i18n("User")));
-    setHorizontalHeaderItem(ColCreated,       new QStandardItem(i18n("Created")));
-    setHorizontalHeaderItem(ColCompleted,     new QStandardItem(i18n("Completed")));
-    setHorizontalHeaderItem(ColPages,         new QStandardItem(i18n("Pages")));
-    setHorizontalHeaderItem(ColProcessed,     new QStandardItem(i18n("Processed")));
-    setHorizontalHeaderItem(ColSize,          new QStandardItem(i18n("Size")));
-    setHorizontalHeaderItem(ColStatusMessage, new QStandardItem(i18n("Status Message")));
-    setHorizontalHeaderItem(ColPrinter,       new QStandardItem(i18n("Printer")));
-    setHorizontalHeaderItem(ColFromHost,      new QStandardItem(i18n("From Hostname")));
-
-    // Setup the attributes we want from jobs
-    m_jobAttributes << KCUPS_JOB_ID;
-    m_jobAttributes << KCUPS_JOB_NAME;
-    m_jobAttributes << KCUPS_JOB_K_OCTETS;
-    m_jobAttributes << KCUPS_JOB_K_OCTETS_PROCESSED;
-    m_jobAttributes << KCUPS_JOB_STATE;
-    m_jobAttributes << KCUPS_TIME_AT_COMPLETED;
-    m_jobAttributes << KCUPS_TIME_AT_CREATION;
-    m_jobAttributes << KCUPS_TIME_AT_PROCESSING;
-    m_jobAttributes << KCUPS_JOB_PRINTER_URI;
-    m_jobAttributes << KCUPS_JOB_ORIGINATING_USER_NAME;
-    m_jobAttributes << KCUPS_JOB_ORIGINATING_HOST_NAME;
-    m_jobAttributes << KCUPS_JOB_MEDIA_PROGRESS;
-    m_jobAttributes << KCUPS_JOB_MEDIA_SHEETS;
-    m_jobAttributes << KCUPS_JOB_MEDIA_SHEETS_COMPLETED;
-    m_jobAttributes << KCUPS_JOB_PRINTER_STATE_MESSAGE;
-    m_jobAttributes << KCUPS_JOB_PRESERVED;
-
-    QHash<int, QByteArray> roles = roleNames();
-    roles[RoleJobId] = "jobId";
-    roles[RoleJobState] = "jobState";
-    roles[RoleJobName] = "jobName";
-    roles[RoleJobPages] = "jobPages";
-    roles[RoleJobSize] = "jobSize";
-    roles[RoleJobOwner] = "jobOwner";
-    roles[RoleJobCreatedAt] = "jobCreatedAt";
-    roles[RoleJobIconName] = "jobIconName";
-    roles[RoleJobCancelEnabled] = "jobCancelEnabled";
-    roles[RoleJobHoldEnabled] = "jobHoldEnabled";
-    roles[RoleJobReleaseEnabled] = "jobReleaseEnabled";
-    roles[RoleJobRestartEnabled] = "jobRestartEnabled";
-    roles[RoleJobPrinter] = "jobPrinter";
-    roles[RoleJobOriginatingHostName] = "jobFrom";
-    setRoleNames(roles);
-
-    // This is emitted when a job change it's state
-    connect(KCupsConnection::global(),
-            SIGNAL(jobState(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This is emitted when a job is created
-    connect(KCupsConnection::global(),
-            SIGNAL(jobCreated(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This is emitted when a job is stopped
-    connect(KCupsConnection::global(),
-            SIGNAL(jobStopped(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This is emitted when a job has it's config changed
-    connect(KCupsConnection::global(),
-            SIGNAL(jobConfigChanged(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This is emitted when a job change it's progress
-    connect(KCupsConnection::global(),
-            SIGNAL(jobProgress(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(insertUpdateJob(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This is emitted when a printer is removed
-    connect(KCupsConnection::global(),
-            SIGNAL(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)),
-            this,
-            SLOT(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    connect(KCupsConnection::global(), SIGNAL(serverAudit(QString)),
-            SLOT(getJobs()));
-    connect(KCupsConnection::global(), SIGNAL(serverStarted(QString)),
-            SLOT(getJobs()));
-    connect(KCupsConnection::global(), SIGNAL(serverStopped(QString)),
-            SLOT(getJobs()));
-    connect(KCupsConnection::global(), SIGNAL(serverRestarted(QString)),
-            SLOT(getJobs()));
-}
-
-void JobModel::setParentWId(WId parentId)
-{
-    m_parentId = parentId;
-}
-
-void JobModel::init(const QString &destName)
-{
-    m_destName = destName;
-
-    // Get all jobs
-    getJobs();
-}
-
-void JobModel::hold(const QString &printerName, int jobId)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->holdJob(printerName, jobId);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void JobModel::release(const QString &printerName, int jobId)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->releaseJob(printerName, jobId);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void JobModel::cancel(const QString &printerName, int jobId)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->cancelJob(printerName, jobId);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void JobModel::move(const QString &printerName, int jobId, const QString &toPrinterName)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->moveJob(printerName, jobId, toPrinterName);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void JobModel::getJobs()
-{
-    if (m_jobRequest) {
-        return;
-    }
-
-    m_jobRequest = new KCupsRequest;
-    connect(m_jobRequest, SIGNAL(finished()), this, SLOT(getJobFinished()));
-
-    m_jobRequest->getJobs(m_destName, false, m_whichjobs, m_jobAttributes);
-
-    m_processingJob.clear();
-}
-
-void JobModel::getJobFinished()
-{
-    KCupsRequest *request = static_cast<KCupsRequest *>(sender());
-    if (request) {
-        if (request->hasError()) {            
-            // clear the model after so that the proper widget can be shown
-            clear();
-        } else {
-            KCupsJobs jobs = request->jobs();
-            kDebug() << jobs.size();
-            for (int i = 0; i < jobs.size(); ++i) {
-                if (jobs.at(i).state() == IPP_JOB_PROCESSING) {
-                    m_processingJob = jobs.at(i).name();
-                }
-
-                // try to find the job row
-                int job_row = jobRow(jobs.at(i).id());
-                if (job_row == -1) {
-                    // not found, insert new one
-                    insertJob(i, jobs.at(i));
-                } else if (job_row == i) {
-                    // update the job
-                    updateJob(i, jobs.at(i));
-                } else {
-                    // found at wrong position
-                    // take it and insert on the right position
-                    QList<QStandardItem *> row = takeRow(job_row);
-                    insertRow(i, row);
-                    updateJob(i, jobs.at(i));
-                }
-            }
-
-            // remove old printers
-            // The above code starts from 0 and make sure
-            // dest == modelIndex(x) and if it's not the
-            // case it either inserts or moves it.
-            // so any item > num_jobs can be safely deleted
-            while (rowCount() > jobs.size()) {
-                removeRow(rowCount() - 1);
-            }
-        }
-        request->deleteLater();
-    } else {
-        kWarning() << "Should not be called from a non KCupsRequest class" << sender();
-    }
-    m_jobRequest = 0;
-}
-
-void JobModel::jobCompleted(const QString &text,
-                                   const QString &printerUri,
-                                   const QString &printerName,
-                                   uint printerState,
-                                   const QString &printerStateReasons,
-                                   bool printerIsAcceptingJobs,
-                                   uint jobId,
-                                   uint jobState,
-                                   const QString &jobStateReasons,
-                                   const QString &jobName,
-                                   uint jobImpressionsCompleted)
-{
-    // REALLY? all these parameters just to say foo was deleted??
-    Q_UNUSED(text)
-    Q_UNUSED(printerUri)
-    Q_UNUSED(printerName)
-    Q_UNUSED(printerState)
-    Q_UNUSED(printerStateReasons)
-    Q_UNUSED(printerIsAcceptingJobs)
-    Q_UNUSED(jobId)
-    Q_UNUSED(jobState)
-    Q_UNUSED(jobStateReasons)
-    Q_UNUSED(jobName)
-    Q_UNUSED(jobImpressionsCompleted)
-
-    // We grab all jobs again
-    getJobs();
-}
-
-void JobModel::insertUpdateJob(const QString &text,
-                                      const QString &printerUri,
-                                      const QString &printerName,
-                                      uint printerState,
-                                      const QString &printerStateReasons,
-                                      bool printerIsAcceptingJobs,
-                                      uint jobId,
-                                      uint jobState,
-                                      const QString &jobStateReasons,
-                                      const QString &jobName,
-                                      uint jobImpressionsCompleted)
-{
-    // REALLY? all these parameters just to say foo was created??
-    Q_UNUSED(text)
-    Q_UNUSED(printerUri)
-    Q_UNUSED(printerName)
-    Q_UNUSED(printerState)
-    Q_UNUSED(printerStateReasons)
-    Q_UNUSED(printerIsAcceptingJobs)
-    Q_UNUSED(jobId)
-    Q_UNUSED(jobState)
-    Q_UNUSED(jobStateReasons)
-    Q_UNUSED(jobName)
-    Q_UNUSED(jobImpressionsCompleted)
-
-    // We grab all jobs again
-    getJobs();
-}
-
-void JobModel::insertJob(int pos, const KCupsJob &job)
-{
-    // insert the first column which has the job state and id
-    QList<QStandardItem*> row;
-    ipp_jstate_e jobState = job.state();
-    QStandardItem *statusItem = new QStandardItem(jobStatus(jobState));
-    statusItem->setData(jobState, RoleJobState);
-    statusItem->setData(job.id(), RoleJobId);
-    statusItem->setData(job.name(), RoleJobName);
-    statusItem->setData(job.originatingUserName(), RoleJobOwner);
-    statusItem->setData(job.originatingHostName(), RoleJobOriginatingHostName);
-    QString size = KGlobal::locale()->formatByteSize(job.size());
-    statusItem->setData(size, RoleJobSize);
-    QString createdAt = KGlobal::locale()->formatDateTime(job.createdAt());
-    statusItem->setData(createdAt, RoleJobCreatedAt);
-
-    // TODO move the update code before the insert and reuse some code...
-    statusItem->setData(KCupsJob::iconName(jobState), RoleJobIconName);
-    statusItem->setData(KCupsJob::cancelEnabled(jobState), RoleJobCancelEnabled);
-    statusItem->setData(KCupsJob::holdEnabled(jobState), RoleJobHoldEnabled);
-    statusItem->setData(KCupsJob::releaseEnabled(jobState), RoleJobReleaseEnabled);
-    statusItem->setData(job.reprintEnabled(), RoleJobRestartEnabled);
-
-    QString pages = QString::number(job.pages());
-    if (job.processedPages()) {
-        pages = QString::number(job.processedPages()) + QLatin1Char('/') + QString::number(job.processedPages());
-    }
-    if (statusItem->data(RoleJobPages) != pages) {
-        statusItem->setData(pages, RoleJobPages);
-    }
-
-    row << statusItem;
-    for (int i = ColName; i < LastColumn; i++) {
-        // adds all Items to the model
-        row << new QStandardItem;
-    }
-
-    // insert the whole row
-    insertRow(pos, row);
-
-    // update the items
-    updateJob(pos, job);
-}
-
-void JobModel::updateJob(int pos, const KCupsJob &job)
-{
-    // Job Status & internal dataipp_jstate_e
-    ipp_jstate_e jobState = job.state();
-    if (item(pos, ColStatus)->data(RoleJobState).toInt() != jobState) {
-        item(pos, ColStatus)->setText(jobStatus(jobState));
-        item(pos, ColStatus)->setData(static_cast<int>(jobState), RoleJobState);
-
-        item(pos, ColStatus)->setData(KCupsJob::iconName(jobState), RoleJobIconName);
-        item(pos, ColStatus)->setData(KCupsJob::cancelEnabled(jobState), RoleJobCancelEnabled);
-        item(pos, ColStatus)->setData(KCupsJob::holdEnabled(jobState), RoleJobHoldEnabled);
-        item(pos, ColStatus)->setData(KCupsJob::releaseEnabled(jobState), RoleJobReleaseEnabled);
-        item(pos, ColStatus)->setData(job.reprintEnabled(), RoleJobRestartEnabled);
-    }
-
-    QString pages = QString::number(job.pages());
-    if (job.processedPages()) {
-        pages = QString::number(job.processedPages()) + QLatin1Char('/') + QString::number(job.processedPages());
-    }
-    if (item(pos, ColStatus)->data(RoleJobPages) != pages) {
-        item(pos, ColStatus)->setData(pages, RoleJobPages);
-    }
-
-    // internal dest name & column
-    QString destName = job.printer();
-    if (item(pos, ColStatus)->data(RoleJobPrinter).toString() != destName) {
-        item(pos, ColStatus)->setData(destName, RoleJobPrinter);
-        // Column job printer Name
-        item(pos, ColPrinter)->setText(destName);
-    }
-
-    // job name
-    QString jobName = job.name();
-    if (item(pos, ColName)->text() != jobName) {
-        item(pos, ColStatus)->setData(jobName, RoleJobName);
-        item(pos, ColName)->setText(jobName);
-    }
-
-    // owner of the job
-    // try to get the full user name
-    QString userString = job.originatingUserName();
-    KUser user(userString);
-    if (user.isValid() && !user.property(KUser::FullName).toString().isEmpty()) {
-        userString = user.property(KUser::FullName).toString();
-    }
-
-    // user name
-    if (item(pos, ColUser)->text() != userString) {
-        item(pos, ColUser)->setText(userString);
-    }
-
-    // when it was created
-    QDateTime timeAtCreation = job.createdAt();
-    if (item(pos, ColCreated)->data(Qt::DisplayRole).toDateTime() != timeAtCreation) {
-        item(pos, ColCreated)->setData(timeAtCreation, Qt::DisplayRole);
-    }
-
-    // when it was completed
-    QDateTime completedAt = job.completedAt();
-    if (item(pos, ColCompleted)->data(Qt::DisplayRole).toDateTime() != completedAt) {
-        if (!completedAt.isNull()) {
-            item(pos, ColCompleted)->setData(completedAt, Qt::DisplayRole);
-        } else {
-            // Clean the data might happen when the job is restarted
-            item(pos, ColCompleted)->setText(QString());
-        }
-    }
-
-    // job pages
-    int completedPages = job.processedPages();
-    if (item(pos, ColPages)->data(Qt::UserRole) != completedPages) {
-        item(pos, ColPages)->setData(completedPages, Qt::UserRole);
-        item(pos, ColPages)->setText(QString::number(completedPages));
-    }
-
-    // when it was precessed
-    QDateTime timeAtProcessing = job.processedAt();
-    if (item(pos, ColProcessed)->data(Qt::DisplayRole).toDateTime() != timeAtProcessing) {
-        if (!timeAtProcessing.isNull()) {
-            item(pos, ColProcessed)->setData(timeAtProcessing, Qt::DisplayRole);
-        } else {
-            // Clean the data might happen when the job is restarted
-            item(pos, ColCompleted)->setText(QString());
-        }
-    }
-
-    // job size TODO use kde converter
-    int jobSize = job.size();
-    if (item(pos, ColSize)->data(Qt::UserRole) != jobSize) {
-        item(pos, ColSize)->setData(jobSize, Qt::UserRole);
-        item(pos, ColSize)->setText(KGlobal::locale()->formatByteSize(jobSize));
-    }
-
-    // job printer state message
-    QString stateMessage = job.stateMsg();
-    if (item(pos, ColStatusMessage)->text() != stateMessage) {
-        item(pos, ColStatusMessage)->setText(stateMessage);
-    }
-
-    // owner of the job
-    // try to get the full user name
-    QString originatingHostName = job.originatingHostName();
-    if (item(pos, ColFromHost)->text() != originatingHostName) {
-        item(pos, ColFromHost)->setText(originatingHostName);
-    }
-}
-
-QStringList JobModel::mimeTypes() const
-{
-    return QStringList("application/x-cupsjobs");
-}
-
-Qt::DropActions JobModel::supportedDropActions() const
-{
-    return Qt::MoveAction;
-}
-
-QMimeData* JobModel::mimeData(const QModelIndexList &indexes) const
-{
-    QMimeData *mimeData = new QMimeData();
-    QByteArray encodedData;
-
-    QDataStream stream(&encodedData, QIODevice::WriteOnly);
-
-    foreach (const QModelIndex &index, indexes) {
-        if (index.isValid() && index.column() == 0) {
-            // serialize the jobId and fromDestName
-            stream << data(index, RoleJobId).toInt()
-                   << data(index, RoleJobPrinter).toString()
-                   << item(index.row(), ColName)->text();
-        }
-    }
-
-    mimeData->setData("application/x-cupsjobs", encodedData);
-    return mimeData;
-}
-
-bool JobModel::dropMimeData(const QMimeData *data,
-                                   Qt::DropAction action,
-                                   int row,
-                                   int column,
-                                   const QModelIndex &parent)
-{
-    Q_UNUSED(row)
-    Q_UNUSED(column)
-    Q_UNUSED(parent)
-    if (action == Qt::IgnoreAction) {
-        return true;
-    }
-
-    if (!data->hasFormat("application/x-cupsjobs")) {
-        return false;
-    }
-
-    QByteArray encodedData = data->data("application/x-cupsjobs");
-    QDataStream stream(&encodedData, QIODevice::ReadOnly);
-
-    bool ret = false;
-    while (!stream.atEnd()) {
-        QString fromDestName, displayName;
-        int jobId;
-        // get the jobid and the from dest name
-        stream >> jobId >> fromDestName >> displayName;
-        if (fromDestName == m_destName) {
-            continue;
-        }
-
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        request->moveJob(fromDestName, jobId, m_destName);
-        request->waitTillFinished();
-        if (request) {
-            if (request->hasError()) {
-                // failed to move one job
-                // we return here to avoid more password tries
-                KMessageBox::detailedSorryWId(m_parentId,
-                                              i18n("Failed to move '%1' to '%2'",
-                                                   displayName, m_destName),
-                                              request->errorMsg(),
-                                              i18n("Failed"));
-            }
-            request->deleteLater();
-            ret = !request->hasError();
-        }
-    }
-    return ret;
-}
-
-KCupsRequest* JobModel::modifyJob(int row, JobAction action, const QString &newDestName, const QModelIndex &parent)
-{
-    Q_UNUSED(parent)
-
-    if (row < 0 || row >= rowCount()) {
-        kWarning() << "Row number is invalid:" << row;
-        return 0;
-    }
-
-    QStandardItem *job = item(row, ColStatus);
-    int jobId = job->data(RoleJobId).toInt();
-    QString destName = job->data(RoleJobPrinter).toString();
-
-    // ignore some jobs
-    ipp_jstate_t state = static_cast<ipp_jstate_t>(job->data(RoleJobState).toInt());
-    if ((state == IPP_JOB_HELD && action == Hold) ||
-        (state == IPP_JOB_CANCELED && action == Cancel) ||
-        (state != IPP_JOB_HELD && action == Release)) {
-        return 0;
-    }
-
-    KCupsRequest *request = new KCupsRequest;
-    switch (action) {
-    case Cancel:
-        request->cancelJob(destName, jobId);
-        break;
-    case Hold:
-        request->holdJob(destName, jobId);
-        break;
-    case Release:
-        request->releaseJob(destName, jobId);
-        break;
-    case Reprint:
-        request->restartJob(destName, jobId);
-        break;
-    case Move:
-        request->moveJob(destName, jobId, newDestName);
-        break;
-    default:
-        kWarning() << "Unknown ACTION called!!!" << action;
-        return 0;
-    }
-
-    return request;
-}
-
-int JobModel::jobRow(int jobId)
-{
-    // find the position of the jobId inside the model
-    for (int i = 0; i < rowCount(); i++) {
-        if (jobId == item(i)->data(RoleJobId).toInt())
-        {
-            return i;
-        }
-    }
-    // -1 if not found
-    return -1;
-}
-
-QString JobModel::jobStatus(ipp_jstate_e job_state)
-{
-  switch (job_state)
-  {
-    case IPP_JOB_PENDING    : return i18n("Pending");
-    case IPP_JOB_HELD       : return i18n("On hold");
-    case IPP_JOB_PROCESSING : return "-";
-    case IPP_JOB_STOPPED    : return i18n("Stopped");
-    case IPP_JOB_CANCELED   : return i18n("Canceled");
-    case IPP_JOB_ABORTED    : return i18n("Aborted");
-    case IPP_JOB_COMPLETED  : return i18n("Completed");
-  }
-  return "-";
-}
-
-void JobModel::clear()
-{
-    removeRows(0, rowCount());
-}
-
-void JobModel::setWhichJobs(WhichJobs whichjobs)
-{
-    switch (whichjobs) {
-    case WhichActive:
-        m_whichjobs = CUPS_WHICHJOBS_ACTIVE;
-        break;
-    case WhichCompleted:
-        m_whichjobs = CUPS_WHICHJOBS_COMPLETED;
-        break;
-    case WhichAll:
-        m_whichjobs = CUPS_WHICHJOBS_ALL;
-        break;
-    }
-
-    getJobs();
-}
-
-Qt::ItemFlags JobModel::flags(const QModelIndex &index) const
-{
-    if (index.isValid()) {
-        ipp_jstate_t state = static_cast<ipp_jstate_t>(item(index.row(), ColStatus)->data(RoleJobState).toInt());
-        if (state == IPP_JOB_PENDING ||
-            state == IPP_JOB_PROCESSING) {
-            return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
-        }
-    }
-    return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled;
-}
-
-QString JobModel::processingJob() const
-{
-    return m_processingJob;
-}
-
-#include "moc_JobModel.cpp"
diff --git a/print-manager/libkcups/JobModel.h b/print-manager/libkcups/JobModel.h
deleted file mode 100644 (file)
index 9be93a0..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef JOB_MODEL_H
-#define JOB_MODEL_H
-
-#include <QStandardItemModel>
-
-#include <cups/cups.h>
-
-#include <kdemacros.h>
-
-class KCupsJob;
-class KCupsRequest;
-class KDE_EXPORT JobModel : public QStandardItemModel
-{
-    Q_OBJECT
-    Q_ENUMS(JobAction)
-    Q_ENUMS(Role)
-    Q_ENUMS(WhichJobs)
-public:
-    enum Role {
-        RoleJobId = Qt::UserRole + 2,
-        RoleJobState,
-        RoleJobName,
-        RoleJobPages,
-        RoleJobSize,
-        RoleJobOwner,
-        RoleJobCreatedAt,
-        RoleJobIconName,
-        RoleJobCancelEnabled,
-        RoleJobHoldEnabled,
-        RoleJobReleaseEnabled,
-        RoleJobRestartEnabled,
-        RoleJobPrinter,
-        RoleJobOriginatingHostName
-    };
-
-    enum JobAction {
-        Cancel,
-        Hold,
-        Release,
-        Move,
-        Reprint
-    };
-
-    enum WhichJobs {
-        WhichAll,
-        WhichActive,
-        WhichCompleted
-    };
-
-    enum Columns {
-        ColStatus = 0,
-        ColName,
-        ColUser,
-        ColCreated,
-        ColCompleted,
-        ColPages,
-        ColProcessed,
-        ColSize,
-        ColStatusMessage,
-        ColPrinter,
-        ColFromHost,
-        LastColumn
-    };
-
-    explicit JobModel(QObject *parent = 0);
-    void setParentWId(WId parentId);
-    Q_INVOKABLE void init(const QString &destName = QString());
-
-    Q_INVOKABLE void hold(const QString &printerName, int jobId);
-    Q_INVOKABLE void release(const QString &printerName, int jobId);
-    Q_INVOKABLE void cancel(const QString &printerName, int jobId);
-    Q_INVOKABLE void move(const QString &printerName, int jobId, const QString &toPrinterName);
-
-    QString processingJob() const;
-
-    Qt::ItemFlags flags(const QModelIndex &index) const;
-    QStringList mimeTypes() const;
-    Qt::DropActions supportedDropActions() const;
-    QMimeData* mimeData(const QModelIndexList &indexes) const;
-    bool dropMimeData(const QMimeData *data,
-                      Qt::DropAction action,
-                      int row,
-                      int column,
-                      const QModelIndex &parent);
-
-    Q_INVOKABLE void setWhichJobs(WhichJobs whichjobs);
-    KCupsRequest* modifyJob(int row, JobAction action, const QString &newDestName = QString(), const QModelIndex &parent = QModelIndex());
-
-private slots:
-    void getJobs();
-    void getJobFinished();
-
-    void jobCompleted(const QString &text,
-                      const QString &printerUri,
-                      const QString &printerName,
-                      uint printerState,
-                      const QString &printerStateReasons,
-                      bool printerIsAcceptingJobs,
-                      uint jobId,
-                      uint jobState,
-                      const QString &jobStateReasons,
-                      const QString &jobName,
-                      uint jobImpressionsCompleted);
-    void insertUpdateJob(const QString &text,
-                         const QString &printerUri,
-                         const QString &printerName,
-                         uint printerState,
-                         const QString &printerStateReasons,
-                         bool printerIsAcceptingJobs,
-                         uint jobId,
-                         uint jobState,
-                         const QString &jobStateReasons,
-                         const QString &jobName,
-                         uint jobImpressionsCompleted);
-
-private:
-    int jobRow(int jobId);
-    void insertJob(int pos, const KCupsJob &job);
-    void updateJob(int pos, const KCupsJob &job);
-    QString jobStatus(ipp_jstate_e job_state);
-    void clear();
-
-    KCupsRequest *m_jobRequest;
-    QString m_destName;
-    QString m_processingJob;
-    int m_whichjobs;
-    WId m_parentId;
-    QStringList m_jobAttributes;
-};
-
-#endif // JOB_MODEL_H
diff --git a/print-manager/libkcups/JobSortFilterModel.cpp b/print-manager/libkcups/JobSortFilterModel.cpp
deleted file mode 100644 (file)
index ee7bccf..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-#include "JobSortFilterModel.h"
-
-#include "JobModel.h"
-
-#include <KDebug>
-
-JobSortFilterModel::JobSortFilterModel(QObject *parent) :
-    QSortFilterProxyModel(parent)
-{
-    setDynamicSortFilter(true);
-    setSortCaseSensitivity(Qt::CaseInsensitive);
-    sort(0);
-
-    connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SIGNAL(activeCountChanged()));
-    connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
-            this, SIGNAL(activeCountChanged()));
-    connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
-            this, SIGNAL(activeCountChanged()));
-    connect(this, SIGNAL(modelReset()),
-            this, SIGNAL(activeCountChanged()));
-}
-
-void JobSortFilterModel::setModel(QAbstractItemModel *model)
-{
-    if (model == sourceModel()) {
-        return;
-    }
-
-    QSortFilterProxyModel::setSourceModel(model);
-    emit sourceModelChanged(model);
-}
-
-void JobSortFilterModel::setFilteredPrinters(const QString &printers)
-{
-    kDebug() << rowCount() << printers << printers.split(QLatin1Char('|'));
-    if (printers.isEmpty()) {
-        m_filteredPrinters.clear();
-    } else {
-        m_filteredPrinters = printers.split(QLatin1Char('|'));
-    }
-    invalidateFilter();
-    emit filteredPrintersChanged();
-}
-
-QString JobSortFilterModel::filteredPrinters() const
-{
-    return m_filteredPrinters.join(QLatin1String("|"));
-}
-
-int JobSortFilterModel::activeCount() const
-{
-    int active = 0;
-    for (int i = 0; i < rowCount(); ++i) {
-        QModelIndex item = index(i, 0);
-        if (weightForState(item.data(JobModel::RoleJobState).toInt())) {
-            ++active;
-        }
-    }
-    return active;
-}
-
-bool JobSortFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
-{
-    QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
-
-    // check if the printer is on the blacklist
-    if (!m_filteredPrinters.isEmpty()) {
-        return m_filteredPrinters.contains(index.data(JobModel::RoleJobPrinter).toString());
-    }
-
-    return true;
-}
-
-bool JobSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
-{
-    if (left.column() == 0) {
-        int leftWeight = weightForState(left.data(JobModel::RoleJobState).toInt());
-        int rightWeight = weightForState(right.data(JobModel::RoleJobState).toInt());
-
-        if (leftWeight != rightWeight) {
-            return leftWeight > rightWeight;
-        } else {
-            int leftId = left.data(JobModel::RoleJobId).toInt();
-            int rightId = right.data(JobModel::RoleJobId).toInt();
-
-            if (leftWeight) {
-                return leftId < rightId;
-            }
-
-            return leftId > rightId;
-        }
-    }
-    return QSortFilterProxyModel::lessThan(left, right);
-}
-
-int JobSortFilterModel::weightForState(int state) const
-{
-    switch (state) {
-    case IPP_JOB_PROCESSING:
-        return 3;
-        break;
-    case IPP_JOB_PENDING:
-        return 2;
-        break;
-    case IPP_JOB_HELD:
-        return 1;
-        break;
-    default:
-        return 0;
-        break;
-    }
-}
diff --git a/print-manager/libkcups/JobSortFilterModel.h b/print-manager/libkcups/JobSortFilterModel.h
deleted file mode 100644 (file)
index a959493..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef JOB_SORT_FILTER_MODEL_H
-#define JOB_SORT_FILTER_MODEL_H
-
-#include <QSortFilterProxyModel>
-
-#include <QDeclarativeItem>
-
-#include <kdemacros.h>
-
-class KDE_EXPORT JobSortFilterModel : public QSortFilterProxyModel
-{
-    Q_OBJECT
-    Q_PROPERTY(QString filteredPrinters READ filteredPrinters WRITE setFilteredPrinters NOTIFY filteredPrintersChanged)
-    Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setModel NOTIFY sourceModelChanged)
-    Q_PROPERTY(int activeCount READ activeCount NOTIFY activeCountChanged)
-public:
-    explicit JobSortFilterModel(QObject *parent = 0);
-
-    void setModel(QAbstractItemModel *model);
-    void setFilteredPrinters(const QString &printers);
-    QString filteredPrinters() const;
-    int activeCount() const;
-
-signals:
-    void activeCountChanged();
-    void sourceModelChanged(QObject *);
-    void filteredPrintersChanged();
-
-private:
-    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
-    bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
-
-    int weightForState(int state) const;
-
-    QStringList m_filteredPrinters;
-};
-
-#endif // JOB_SORT_FILTER_MODEL_H
diff --git a/print-manager/libkcups/KCupsConnection.cpp b/print-manager/libkcups/KCupsConnection.cpp
deleted file mode 100644 (file)
index a066e96..0000000
+++ /dev/null
@@ -1,877 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *   Copyright (C) 2012 Harald Sitter <sitter@kde.org>                     *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsConnection.h"
-
-#include "KCupsPasswordDialog.h"
-#include "KIppRequest.h"
-
-#include <config.h>
-
-#include <QCoreApplication>
-#include <QDBusConnection>
-#include <QByteArray>
-
-#include <KLocale>
-#include <KDebug>
-
-#include <cups/cups.h>
-
-#define RENEW_INTERVAL        3500
-#define SUBSCRIPTION_DURATION 3600
-
-#define DBUS_SERVER_RESTARTED "server-restarted" // ServerRestarted
-#define DBUS_SERVER_STARTED   "server-started"   // ServerStarted
-#define DBUS_SERVER_STOPPED   "server-stopped"   // ServerStopped
-#define DBUS_SERVER_AUDIT     "server-audit"     // ServerAudit
-
-#define DBUS_PRINTER_RESTARTED          "printer-restarted"          // PrinterRestarted
-#define DBUS_PRINTER_SHUTDOWN           "printer-shutdown"           // PrinterShutdown
-#define DBUS_PRINTER_STOPPED            "printer-stopped"            // PrinterStopped
-#define DBUS_PRINTER_STATE_CHANGED      "printer-state-changed"      // PrinterStateChanged
-#define DBUS_PRINTER_FINISHINGS_CHANGED "printer-finishings-changed" // PrinterFinishingsChanged
-#define DBUS_PRINTER_MEDIA_CHANGED      "printer-media-changed"      // PrinterMediaChanged
-#define DBUS_PRINTER_ADDED              "printer-added"              // PrinterAdded
-#define DBUS_PRINTER_DELETED            "printer-deleted"            // PrinterDeleted
-#define DBUS_PRINTER_MODIFIED           "printer-modified"           // PrinterModified
-
-#define DBUS_JOB_STATE_CHANGED  "job-state-changed"  // JobState
-#define DBUS_JOB_CREATED        "job-created"        // JobCreated
-#define DBUS_JOB_COMPLETED      "job-completed"      // JobCompleted
-#define DBUS_JOB_STOPPED        "job-stopped"        // JobStopped
-#define DBUS_JOB_CONFIG_CHANGED "job-config-changed" // JobConfigChanged
-#define DBUS_JOB_PROGRESS       "job-progress"       // JobProgress
-
-Q_DECLARE_METATYPE(QList<int>)
-Q_DECLARE_METATYPE(QList<bool>)
-
-KCupsConnection* KCupsConnection::m_instance = 0;
-static int password_retries = 0;
-static int internalErrorCount = 0;
-const char * password_cb(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
-
-KCupsConnection* KCupsConnection::global()
-{
-    if (!m_instance) {
-        m_instance = new KCupsConnection(qApp);
-    }
-
-    return m_instance;
-}
-
-KCupsConnection::KCupsConnection(QObject *parent) :
-    QThread(parent)
-{
-    init();
-}
-
-KCupsConnection::KCupsConnection(const KUrl &server, QObject *parent) :
-    QThread(parent),
-    m_serverUrl(server)
-{
-    qRegisterMetaType<KIppRequest>("KIppRequest");
-    init();
-}
-
-KCupsConnection::~KCupsConnection()
-{
-    if (m_instance == this) {
-        m_instance = 0;
-    }
-    m_passwordDialog->deleteLater();
-
-    quit();
-    wait();
-
-    delete m_renewTimer;
-    delete m_subscriptionTimer;
-}
-
-void KCupsConnection::setPasswordMainWindow(WId mainwindow)
-{
-    m_passwordDialog->setMainWindow(mainwindow);
-}
-
-void KCupsConnection::init()
-{
-    // Creating the dialog before start() will make it run on the gui thread
-    m_passwordDialog = new KCupsPasswordDialog;
-    m_subscriptionId = -1;
-    m_inited = false;
-
-    // setup the DBus subscriptions
-
-    // Server related signals
-    // ServerStarted
-    notifierConnect(QLatin1String("ServerStarted"),
-                    this,
-                    SIGNAL(serverStarted(QString)));
-
-    // ServerStopped
-    notifierConnect(QLatin1String("ServerStopped"),
-                    this,
-                    SIGNAL(serverStopped(QString)));
-
-    // ServerRestarted
-    notifierConnect(QLatin1String("ServerRestarted"),
-                    this,
-                    SIGNAL(serverRestarted(QString)));
-
-    // ServerAudit
-    notifierConnect(QLatin1String("ServerAudit"),
-                    this,
-                    SIGNAL(serverAudit(QString)));
-
-    // Printer related signals
-    // PrinterAdded
-    notifierConnect(QLatin1String("PrinterAdded"),
-                    this,
-                    SIGNAL(printerAdded(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterModified
-    notifierConnect(QLatin1String("PrinterModified"),
-                    this,
-                    SIGNAL(printerModified(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterDeleted
-    notifierConnect(QLatin1String("PrinterDeleted"),
-                    this,
-                    SIGNAL(printerDeleted(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterStateChanged
-    notifierConnect(QLatin1String("PrinterStateChanged"),
-                    this,
-                    SIGNAL(printerStateChanged(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterStopped
-    notifierConnect(QLatin1String("PrinterStopped"),
-                    this,
-                    SIGNAL(printerStopped(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterShutdown
-    notifierConnect(QLatin1String("PrinterShutdown"),
-                    this,
-                    SIGNAL(printerShutdown(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterRestarted
-    notifierConnect(QLatin1String("PrinterRestarted"),
-                    this,
-                    SIGNAL(printerRestarted(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterMediaChanged
-    notifierConnect(QLatin1String("PrinterMediaChanged"),
-                    this,
-                    SIGNAL(printerMediaChanged(QString,QString,QString,uint,QString,bool)));
-
-    // PrinterFinishingsChanged
-    notifierConnect(QLatin1String("PrinterFinishingsChanged"),
-                    this,
-                    SIGNAL(PrinterFinishingsChanged(QString,QString,QString,uint,QString,bool)));
-
-    // Job related signals
-    // JobState
-    notifierConnect(QLatin1String("JobState"),
-                    this,
-                    SIGNAL(jobState(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // JobCreated
-    notifierConnect(QLatin1String("JobCreated"),
-                    this,
-                    SIGNAL(jobCreated(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // JobStopped
-    notifierConnect(QLatin1String("JobStopped"),
-                    this,
-                    SIGNAL(jobStopped(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // JobConfigChanged
-    notifierConnect(QLatin1String("JobConfigChanged"),
-                    this,
-                    SIGNAL(jobConfigChanged(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // JobProgress
-    notifierConnect(QLatin1String("JobProgress"),
-                    this,
-                    SIGNAL(jobProgress(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // JobCompleted
-    notifierConnect(QLatin1String("JobCompleted"),
-                    this,
-                    SIGNAL(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint)));
-
-    // This signal is needed since the cups registration thing
-    // doesn't emit printerAdded when we add a printer class
-    // This is emitted when a printer/queue is changed
-    QDBusConnection::systemBus().connect(QLatin1String(""),
-                                         QLatin1String("/com/redhat/PrinterSpooler"),
-                                         QLatin1String("com.redhat.PrinterSpooler"),
-                                         QLatin1String("PrinterAdded"),
-                                         this,
-                                         SIGNAL(rhPrinterAdded(QString)));
-
-    // This signal is needed since the cups registration thing
-    // sometimes simple stops working... don't ask me why
-    // This is emitted when a printer/queue is changed
-    QDBusConnection::systemBus().connect(QLatin1String(""),
-                                         QLatin1String("/com/redhat/PrinterSpooler"),
-                                         QLatin1String("com.redhat.PrinterSpooler"),
-                                         QLatin1String("QueueChanged"),
-                                         this,
-                                         SIGNAL(rhQueueChanged(QString)));
-
-    // This signal is needed since the cups registration thing
-    // doesn't emit printerRemoved when we add a printer class
-    // This is emitted when a printer/queue is changed
-    QDBusConnection::systemBus().connect(QLatin1String(""),
-                                         QLatin1String("/com/redhat/PrinterSpooler"),
-                                         QLatin1String("com.redhat.PrinterSpooler"),
-                                         QLatin1String("PrinterRemoved"),
-                                         this,
-                                         SIGNAL(rhPrinterRemoved(QString)));
-
-    QDBusConnection::systemBus().connect(QLatin1String(""),
-                                         QLatin1String("/com/redhat/PrinterSpooler"),
-                                         QLatin1String("com.redhat.PrinterSpooler"),
-                                         QLatin1String("JobQueuedLocal"),
-                                         this,
-                                         SIGNAL(rhJobQueuedLocal(QString,uint,QString)));
-
-    QDBusConnection::systemBus().connect(QLatin1String(""),
-                                         QLatin1String("/com/redhat/PrinterSpooler"),
-                                         QLatin1String("com.redhat.PrinterSpooler"),
-                                         QLatin1String("JobStartedLocal"),
-                                         this,
-                                         SIGNAL(rhJobStartedLocal(QString,uint,QString)));
-
-    // Creates the timer that will renew the DBus subscription
-    m_renewTimer = new QTimer;
-    m_renewTimer->setInterval(RENEW_INTERVAL*1000);
-    m_renewTimer->moveToThread(this);
-    connect(m_renewTimer, SIGNAL(timeout()), this, SLOT(renewDBusSubscription()), Qt::DirectConnection);
-
-    // Creates the timer to merge updates on the DBus subscription
-    m_subscriptionTimer = new QTimer;
-    m_subscriptionTimer->setInterval(0);
-    m_subscriptionTimer->setSingleShot(true);
-    m_subscriptionTimer->moveToThread(this);
-    connect(m_subscriptionTimer, SIGNAL(timeout()), this, SLOT(updateSubscription()), Qt::DirectConnection);
-
-    // Starts this thread
-    start();
-}
-
-
-void KCupsConnection::run()
-{
-    // Check if we need an special connection
-    if (!m_serverUrl.isEmpty()) {
-        if (m_serverUrl.port() < 0) {
-            // TODO find out if there's a better way of hardcoding
-            // the CUPS port
-            m_serverUrl.setPort(631);
-        }
-
-        cupsSetServer(m_serverUrl.authority().toUtf8());
-    }
-
-    // This is dead cool, cups will call the thread_password_cb()
-    // function when a password set is needed, as we passed the
-    // password dialog pointer the functions just need to call
-    // it on a blocking mode.
-    cupsSetPasswordCB2(password_cb, m_passwordDialog);
-
-    m_inited = true;
-    exec();
-
-    // Event loop quit so cancelDBusSubscription()
-    if (m_subscriptionId != -1) {
-        cancelDBusSubscription();
-    }
-}
-
-bool KCupsConnection::readyToStart()
-{
-    if (QThread::currentThread() == this) {
-        password_retries = 0;
-        internalErrorCount = 0;
-        return true;
-    }
-    return false;
-}
-
-
-ReturnArguments KCupsConnection::request(const KIppRequest &request, ipp_tag_t groupTag) const
-{
-    ReturnArguments ret;
-    ipp_t *response = NULL;
-    do {
-        ippDelete(response);
-        response = NULL;
-
-        response = request.sendIppRequest();
-    } while (retry(request.resource().toUtf8(), request.operation()));
-
-    if (response && groupTag != IPP_TAG_ZERO) {
-        ret = parseIPPVars(response, groupTag);
-    }
-    ippDelete(response);
-
-    return ret;
-}
-
-int KCupsConnection::renewDBusSubscription(int subscriptionId, int leaseDuration, const QStringList &events)
-{
-    int ret = -1;
-
-    ipp_op_t operation;
-
-    // check if we have a valid subscription ID
-    if (subscriptionId >= 0) {
-        // Add the "notify-events" values to the request
-        operation = IPP_RENEW_SUBSCRIPTION;
-    } else {
-        operation = IPP_CREATE_PRINTER_SUBSCRIPTION;
-    }
-
-    KIppRequest request(operation, "/");
-    request.addString(IPP_TAG_OPERATION, IPP_TAG_URI,
-                       KCUPS_PRINTER_URI, QLatin1String("/"));
-    request.addInteger(IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
-                        KCUPS_NOTIFY_LEASE_DURATION, leaseDuration);
-
-    if (operation == IPP_CREATE_PRINTER_SUBSCRIPTION) {
-        // Add the "notify-events" values to the request
-        request.addStringList(IPP_TAG_SUBSCRIPTION, IPP_TAG_KEYWORD,
-                              KCUPS_NOTIFY_EVENTS, events);
-        request.addString(IPP_TAG_SUBSCRIPTION, IPP_TAG_KEYWORD,
-                          KCUPS_NOTIFY_PULL_METHOD, "ippget");
-        request.addString(IPP_TAG_SUBSCRIPTION, IPP_TAG_URI,
-                          KCUPS_NOTIFY_RECIPIENT_URI, "dbus://");
-    } else {
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER,
-                           KCUPS_NOTIFY_SUBSCRIPTION_ID, subscriptionId);
-    }
-
-    ipp_t *response = NULL;
-    do {
-        // Do the request
-        response = request.sendIppRequest();
-    } while (retry("/", operation));
-
-#if !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-    if (response && ippGetStatusCode(response) == IPP_OK) {
-#else
-    if (response && response->request.status.status_code == IPP_OK) {
-#endif // !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-        ipp_attribute_t *attr;
-        if (subscriptionId >= 0) {
-            // Request was ok, just return the current subscription
-            ret = subscriptionId;
-        } else if ((attr = ippFindAttribute(response,
-                                            "notify-subscription-id",
-                                            IPP_TAG_INTEGER)) == NULL) {
-            kWarning() << "No notify-subscription-id in response!";
-            ret = -1;
-        } else {
-#if !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-            ret = ippGetInteger(attr, 0);
-        }
-    } else if (subscriptionId >= 0 && response && ippGetStatusCode(response) == IPP_NOT_FOUND) {
-        kDebug() << "Subscription not found";
-        // When the subscription is not found try to get a new one
-        return renewDBusSubscription(-1, leaseDuration, events);
-#else
-            ret = attr->values[0].integer;
-        }
-    } else if (subscriptionId >= 0 && response && response->request.status.status_code == IPP_NOT_FOUND) {
-        kDebug() << "Subscription not found";
-        // When the subscription is not found try to get a new one
-        return renewDBusSubscription(-1, leaseDuration, events);
-#endif // !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-    } else {
-        kDebug() << "Request failed" << cupsLastError() << httpGetStatus(CUPS_HTTP_DEFAULT);
-        // When the server stops/restarts we will have some error so ignore it
-        ret = subscriptionId;
-    }
-
-    ippDelete(response);
-
-    return ret;
-}
-
-void KCupsConnection::notifierConnect(const QString &signal, QObject *receiver, const char *slot)
-{
-    QDBusConnection systemBus = QDBusConnection::systemBus();
-    systemBus.connect(QString(),
-                      QLatin1String("/org/cups/cupsd/Notifier"),
-                      QLatin1String("org.cups.cupsd.Notifier"),
-                      signal,
-                      receiver,
-                      slot);
-}
-
-void KCupsConnection::connectNotify(const char *signal)
-{
-    QString event = eventForSignal(signal);
-    if (!event.isNull()) {
-        m_connectedEvents << event;
-        QMetaObject::invokeMethod(m_subscriptionTimer,
-                                  "start",
-                                  Qt::QueuedConnection);
-    }
-}
-
-void KCupsConnection::disconnectNotify(const char *signal)
-{
-    QString event = eventForSignal(signal);
-    if (!event.isNull()) {
-        m_connectedEvents.removeOne(event);
-        QMetaObject::invokeMethod(m_subscriptionTimer,
-                                  "start",
-                                  Qt::QueuedConnection);
-    }
-}
-
-QString KCupsConnection::eventForSignal(const char *signal) const
-{
-    // Server signals
-    if (QLatin1String(signal) == SIGNAL(serverAudit(QString))) {
-        return DBUS_SERVER_AUDIT;
-    }
-    if (QLatin1String(signal) == SIGNAL(serverStarted(QString))) {
-        return DBUS_SERVER_STARTED;
-    }
-    if (QLatin1String(signal) == SIGNAL(serverStopped(QString))) {
-        return DBUS_SERVER_STOPPED;
-    }
-    if (QLatin1String(signal) == SIGNAL(serverRestarted(QString))) {
-        return DBUS_SERVER_RESTARTED;
-    }
-
-    // Printer signals
-    if (QLatin1String(signal) == SIGNAL(printerAdded(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_ADDED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerDeleted(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_DELETED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerFinishingsChanged(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_FINISHINGS_CHANGED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerMediaChanged(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_MEDIA_CHANGED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerModified(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_MODIFIED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerRestarted(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_RESTARTED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerShutdown(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_SHUTDOWN;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerStateChanged(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_STATE_CHANGED;
-    }
-    if (QLatin1String(signal) == SIGNAL(printerStopped(QString,QString,QString,uint,QString,bool))) {
-        return DBUS_PRINTER_STOPPED;
-    }
-
-    // job signals
-    if (QLatin1String(signal) == SIGNAL(jobCompleted(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_COMPLETED;
-    }
-    if (QLatin1String(signal) == SIGNAL(jobConfigChanged(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_CONFIG_CHANGED;
-    }
-    if (QLatin1String(signal) == SIGNAL(jobCreated(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_CREATED;
-    }
-    if (QLatin1String(signal) == SIGNAL(jobProgress(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_PROGRESS;
-    }
-    if (QLatin1String(signal) == SIGNAL(jobState(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_STATE_CHANGED;
-    }
-    if (QLatin1String(signal) == SIGNAL(jobStopped(QString,QString,QString,uint,QString,bool,uint,uint,QString,QString,uint))) {
-        return DBUS_JOB_STOPPED;
-    }
-
-    // No registered event signal matched
-    return QString();
-}
-
-void KCupsConnection::updateSubscription()
-{
-    // Build the current list
-    QStringList currentEvents = m_connectedEvents;
-    currentEvents.sort();
-    currentEvents.removeDuplicates();
-
-    // Check if the requested events are already being asked
-    if (m_requestedDBusEvents != currentEvents) {
-        m_requestedDBusEvents = currentEvents;
-
-        // If we alread have a subscription lets cancel
-        // and create a new one
-        if (m_subscriptionId >= 0) {
-            cancelDBusSubscription();
-        }
-
-        // Canculates the new events
-        renewDBusSubscription();
-    }
-}
-
-void KCupsConnection::renewDBusSubscription()
-{
-    // check if we have a valid subscription ID
-    if (m_subscriptionId >= 0) {
-        m_subscriptionId = renewDBusSubscription(m_subscriptionId, SUBSCRIPTION_DURATION);
-    }
-
-    // The above request might fail if the subscription was cancelled
-    if (m_subscriptionId < 0) {
-        if (m_requestedDBusEvents.isEmpty()) {
-            m_renewTimer->stop();
-        } else {
-            m_subscriptionId = renewDBusSubscription(m_subscriptionId, SUBSCRIPTION_DURATION, m_requestedDBusEvents);
-            m_renewTimer->start();
-        }
-    }
-}
-
-void KCupsConnection::cancelDBusSubscription()
-{
-    KIppRequest request(IPP_CANCEL_SUBSCRIPTION, "/");
-    request.addString(IPP_TAG_OPERATION, IPP_TAG_URI,
-                      KCUPS_PRINTER_URI, "/");
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER,
-                       KCUPS_NOTIFY_SUBSCRIPTION_ID, m_subscriptionId);
-
-    do {
-        // Do the request
-        ippDelete(request.sendIppRequest());
-    } while (retry(request.resource().toUtf8(), request.operation()));
-
-    // Reset the subscription id
-    m_subscriptionId = -1;
-}
-
-ReturnArguments KCupsConnection::parseIPPVars(ipp_t *response, ipp_tag_t group_tag)
-{
-    ipp_attribute_t *attr;
-    ReturnArguments ret;
-
-#if !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-    QVariantHash destAttributes;
-    for (attr = ippFirstAttribute(response); attr != NULL; attr = ippNextAttribute(response)) {
-        // We hit an attribute sepparator
-        if (ippGetName(attr) == NULL) {
-            ret << destAttributes;
-            destAttributes.clear();
-            continue;
-        }
-
-        // Skip leading attributes until we hit a a group which can be a printer, job...
-        if (ippGetGroupTag(attr) != group_tag ||
-                (ippGetValueTag(attr) != IPP_TAG_INTEGER &&
-                 ippGetValueTag(attr) != IPP_TAG_ENUM &&
-                 ippGetValueTag(attr) != IPP_TAG_BOOLEAN &&
-                 ippGetValueTag(attr) != IPP_TAG_TEXT &&
-                 ippGetValueTag(attr) != IPP_TAG_TEXTLANG &&
-                 ippGetValueTag(attr) != IPP_TAG_LANGUAGE &&
-                 ippGetValueTag(attr) != IPP_TAG_NAME &&
-                 ippGetValueTag(attr) != IPP_TAG_NAMELANG &&
-                 ippGetValueTag(attr) != IPP_TAG_KEYWORD &&
-                 ippGetValueTag(attr) != IPP_TAG_RANGE &&
-                 ippGetValueTag(attr) != IPP_TAG_URI)) {
-            continue;
-        }
-
-        // Add a printer description attribute...
-        destAttributes[QString::fromUtf8(ippGetName(attr))] = ippAttrToVariant(attr);
-    }
-
-    if (!destAttributes.isEmpty()) {
-        ret << destAttributes;
-    }
-#else
-    for (attr = response->attrs; attr != NULL; attr = attr->next) {
-       /*
-        * Skip leading attributes until we hit a a group which can be a printer, job...
-        */
-        while (attr && attr->group_tag != group_tag) {
-            attr = attr->next;
-        }
-
-        if (attr == NULL) {
-            break;
-        }
-
-        /*
-         * Pull the needed attributes from this printer...
-         */
-        QVariantHash destAttributes;
-        for (; attr && attr->group_tag == group_tag; attr = attr->next) {
-            if (attr->value_tag != IPP_TAG_INTEGER &&
-                attr->value_tag != IPP_TAG_ENUM &&
-                attr->value_tag != IPP_TAG_BOOLEAN &&
-                attr->value_tag != IPP_TAG_TEXT &&
-                attr->value_tag != IPP_TAG_TEXTLANG &&
-                attr->value_tag != IPP_TAG_LANGUAGE &&
-                attr->value_tag != IPP_TAG_NAME &&
-                attr->value_tag != IPP_TAG_NAMELANG &&
-                attr->value_tag != IPP_TAG_KEYWORD &&
-                attr->value_tag != IPP_TAG_RANGE &&
-                attr->value_tag != IPP_TAG_URI) {
-                continue;
-            }
-
-            /*
-             * Add a printer description attribute...
-             */
-            destAttributes[QString::fromUtf8(attr->name)] = ippAttrToVariant(attr);
-        }
-
-        ret << destAttributes;
-
-        if (attr == NULL) {
-            break;
-        }
-    }
-#endif // !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-
-    return ret;
-}
-
-QVariant KCupsConnection::ippAttrToVariant(ipp_attribute_t *attr)
-{
-    QVariant ret;
-#if !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-    switch (ippGetValueTag(attr)) {
-    case IPP_TAG_INTEGER:
-    case IPP_TAG_ENUM:
-        if (ippGetCount(attr) == 1) {
-            ret = ippGetInteger(attr, 0);
-        } else {
-            QList<int> values;
-            for (int i = 0; i < ippGetCount(attr); ++i) {
-                values << ippGetInteger(attr, i);
-            }
-            ret = qVariantFromValue(values);
-        }
-        break;
-    case IPP_TAG_BOOLEAN:
-        if (ippGetCount(attr)== 1) {
-            ret = ippGetBoolean(attr, 0);
-        } else {
-            QList<bool> values;
-            for (int i = 0; i < ippGetCount(attr); ++i) {
-                values << ippGetBoolean(attr, i);
-            }
-            ret = qVariantFromValue(values);
-        }
-        break;
-    case IPP_TAG_RANGE:
-    {
-        QVariantList values;
-        for (int i = 0; i < ippGetCount(attr); ++i) {
-            int rangeUpper;
-            values << ippGetRange(attr, i, &rangeUpper);
-            values << rangeUpper;
-        }
-        ret = values;
-    }
-        break;
-    default:
-        if (ippGetCount(attr)== 1) {
-            ret = QString::fromUtf8(ippGetString(attr, 0, NULL));
-        } else {
-            QStringList values;
-            for (int i = 0; i < ippGetCount(attr); ++i) {
-                values << QString::fromUtf8(ippGetString(attr, i, NULL));
-            }
-            ret = values;
-        }
-    }
-#else
-    switch (attr->value_tag) {
-    case IPP_TAG_INTEGER:
-    case IPP_TAG_ENUM:
-        if (attr->num_values == 1) {
-            ret = attr->values[0].integer;
-        } else {
-            QList<int> values;
-            for (int i = 0; i < attr->num_values; ++i) {
-                values << attr->values[i].integer;
-            }
-            ret = qVariantFromValue(values);
-        }
-        break;
-    case IPP_TAG_BOOLEAN:
-        if (attr->num_values == 1) {
-            ret = static_cast<bool>(attr->values[0].integer);
-        } else {
-            QList<bool> values;
-            for (int i = 0; i < attr->num_values; ++i) {
-                values << static_cast<bool>(attr->values[i].integer);
-            }
-            ret = qVariantFromValue(values);
-        }
-        break;
-    case IPP_TAG_RANGE:
-    {
-        QVariantList values;
-        for (int i = 0; i < attr->num_values; ++i) {
-            values << attr->values[i].range.lower;
-            values << attr->values[i].range.upper;
-        }
-        ret = values;
-    }
-        break;
-    default:
-        if (attr->num_values == 1) {
-            ret = QString::fromUtf8(attr->values[0].string.text);
-        } else {
-            QStringList values;
-            for (int i = 0; i < attr->num_values; ++i) {
-                values << QString::fromUtf8(attr->values[i].string.text);
-            }
-            ret = values;
-        }
-    }
-#endif // !(CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6)
-    return ret;
-}
-
-bool KCupsConnection::retry(const char *resource, int operation) const
-{
-    ipp_status_t status = cupsLastError();
-
-    if (operation != -1) {
-        kDebug() << ippOpString(static_cast<ipp_op_t>(operation)) << "last error:" << status << cupsLastErrorString();
-    } else {
-        kDebug() << operation << "last error:" << status << cupsLastErrorString();
-    }
-
-    // When CUPS process stops our connection
-    // with it fails and has to be re-established
-    if (status == IPP_INTERNAL_ERROR) {
-        // Deleting this connection thread forces it
-        // to create a new CUPS connection
-        kWarning() << "IPP_INTERNAL_ERROR: clearing cookies and reconnecting";
-
-        // TODO maybe reconnect is enough
-//        httpClearCookie(CUPS_HTTP_DEFAULT);
-
-        // Reconnect to CUPS
-        if (httpReconnect(CUPS_HTTP_DEFAULT)) {
-            kWarning() << "Failed to reconnect" << cupsLastErrorString();
-
-            // Server might be restarting sleep for a few ms
-            msleep(500);
-        }
-
-        // Try the request again
-        return ++internalErrorCount < 3;
-    }
-
-    bool forceAuth = false;
-    // If our user is forbidden to perform the
-    // task we try again using the root user
-    // ONLY if it was the first time
-    if (status == IPP_FORBIDDEN &&
-        password_retries == 0) {
-        // Pretend to be the root user
-        // Sometimes setting this just works
-        cupsSetUser("root");
-
-        // force authentication
-        forceAuth = true;
-    }
-
-    if (status == IPP_NOT_AUTHORIZED ||
-        status == IPP_NOT_AUTHENTICATED) {
-        if (password_retries > 3 || password_retries == -1) {
-            // the authentication failed 3 times
-            // OR the dialog was canceld (-1)
-            // reset to 0 and quit the do-while loop
-            password_retries = 0;
-            return false;
-        }
-
-        // force authentication
-        forceAuth = true;
-    }
-
-    if (forceAuth) {
-        // force authentication
-        kDebug() << "Calling cupsDoAuthentication() password_retries:" << password_retries;
-        int ret = cupsDoAuthentication(CUPS_HTTP_DEFAULT, "POST", resource);
-        kDebug() << "Called cupsDoAuthentication(), success:" << (ret == -1 ? true : false);
-
-        // If the authentication was succefull
-        // sometimes just trying to be root works
-        return ret == -1 ? true : false;
-    }
-
-    // the action was not forbidden
-    return false;
-}
-
-const char * password_cb(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data)
-{
-    Q_UNUSED(prompt)
-    Q_UNUSED(http)
-    Q_UNUSED(method)
-    Q_UNUSED(resource)
-
-    if (++password_retries > 3) {
-        // cancel the authentication
-        cupsSetUser(NULL);
-        return NULL;
-    }
-
-    KCupsPasswordDialog *passwordDialog = static_cast<KCupsPasswordDialog *>(user_data);
-    bool wrongPassword = password_retries > 1;
-
-    // This will block this thread until exec is not finished
-    kDebug() << password_retries;
-    QMetaObject::invokeMethod(passwordDialog,
-                              "exec",
-                              Qt::BlockingQueuedConnection,
-                              Q_ARG(QString, QString::fromUtf8(cupsUser())),
-                              Q_ARG(bool, wrongPassword));
-    kDebug() << passwordDialog->accepted();
-
-    // The password dialog has just returned check the result
-    // method that returns QDialog enums
-    if (passwordDialog->accepted()) {
-        cupsSetUser(passwordDialog->username().toUtf8());
-        return passwordDialog->password().toUtf8();
-    } else {
-        // the dialog was canceled
-        password_retries = -1;
-        cupsSetUser(NULL);
-        return NULL;
-    }
-}
diff --git a/print-manager/libkcups/KCupsConnection.h b/print-manager/libkcups/KCupsConnection.h
deleted file mode 100644 (file)
index c61e25a..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPSCONNECTION_H
-#define KCUPSCONNECTION_H
-
-#include <QThread>
-#include <QTimer>
-#include <QtCore/qvariant.h>
-#include <QStringList>
-#include <QWidget>
-
-#include <KUrl>
-
-#include <kdemacros.h>
-
-#include <cups/cups.h>
-
-#define KCUPS_DEVICE_CLASS          "device-class"
-#define KCUPS_DEVICE_ID             "device-id"
-#define KCUPS_DEVICE_INFO           "device-info"
-#define KCUPS_DEVICE_MAKE_AND_MODEL "device-make-and-model"
-#define KCUPS_DEVICE_LOCATION       "device-location"
-#define KCUPS_DEVICE_URI            "device-uri"
-
-#define KCUPS_PRINTER_NAME                   "printer-name"
-#define KCUPS_PRINTER_LOCATION               "printer-location"
-#define KCUPS_PRINTER_INFO                   "printer-info"
-#define KCUPS_PRINTER_URI                    "printer-uri"
-#define KCUPS_PRINTER_MAKE_AND_MODEL         "printer-make-and-model"
-#define KCUPS_PRINTER_STATE                  "printer-state"
-#define KCUPS_PRINTER_STATE_MESSAGE          "printer-state-message"
-#define KCUPS_PRINTER_IS_SHARED              "printer-is-shared"
-#define KCUPS_PRINTER_IS_ACCEPTING_JOBS      "printer-is-accepting-jobs"
-#define KCUPS_PRINTER_TYPE                   "printer-type"
-#define KCUPS_PRINTER_TYPE_MASK              "printer-type-mask"
-#define KCUPS_PRINTER_COMMANDS               "printer-commands"
-#define KCUPS_PRINTER_URI_SUPPORTED          "printer-uri-supported"
-#define KCUPS_PRINTER_ERROR_POLICY           "printer-error-policy"
-#define KCUPS_PRINTER_ERROR_POLICY_SUPPORTED "printer-error-policy-supported"
-#define KCUPS_PRINTER_OP_POLICY              "printer-op-policy"
-#define KCUPS_PRINTER_OP_POLICY_SUPPORTED    "printer-op-policy-supported"
-
-#define KCUPS_MEMBER_URIS  "member-uris"
-#define KCUPS_MEMBER_NAMES "member-names"
-
-#define KCUPS_MARKER_CHANGE_TIME "marker-change-time"
-#define KCUPS_MARKER_COLORS      "marker-colors"
-#define KCUPS_MARKER_LEVELS      "marker-levels"
-#define KCUPS_MARKER_HIGH_LEVELS "marker-high-levels"
-#define KCUPS_MARKER_LOW_LEVELS  "marker-low-levels"
-#define KCUPS_MARKER_NAMES       "marker-names"
-#define KCUPS_MARKER_TYPES       "marker-types"
-#define KCUPS_MARKER_MESSAGE     "marker-message"
-
-#define KCUPS_JOB_ID                     "job-id"
-#define KCUPS_JOB_NAME                   "job-name"
-#define KCUPS_JOB_K_OCTETS               "job-k-octets"
-#define KCUPS_JOB_K_OCTETS_PROCESSED     "job-k-octets-processed"
-#define KCUPS_JOB_PRINTER_URI            "job-printer-uri"
-#define KCUPS_JOB_PRINTER_STATE_MESSAGE  "job-printer-state-message"
-#define KCUPS_JOB_ORIGINATING_USER_NAME  "job-originating-user-name"
-#define KCUPS_JOB_ORIGINATING_HOST_NAME  "job-originating-host-name"
-#define KCUPS_JOB_MEDIA_PROGRESS         "job-media-progress"
-#define KCUPS_JOB_MEDIA_SHEETS           "job-media-sheets"
-#define KCUPS_JOB_MEDIA_SHEETS_COMPLETED "job-media-sheets-completed"
-#define KCUPS_JOB_PRESERVED              "job-preserved"
-#define KCUPS_JOB_STATE                  "job-state"
-#define KCUPS_JOB_SHEETS_DEFAULT         "job-sheets-default"
-#define KCUPS_JOB_SHEETS_SUPPORTED       "job-sheets-supported"
-#define KCUPS_JOB_SHEETS_DEFAULT         "job-sheets-default"
-#define KCUPS_JOB_SHEETS_SUPPORTED       "job-sheets-supported"
-
-#define KCUPS_MY_JOBS "my-jobs"
-#define KCUPS_WHICH_JOBS "which-jobs"
-
-#define KCUPS_TIME_AT_COMPLETED  "time-at-completed"
-#define KCUPS_TIME_AT_CREATION   "time-at-creation"
-#define KCUPS_TIME_AT_PROCESSING "time-at-processing"
-
-#define KCUPS_REQUESTED_ATTRIBUTES "requested-attributes"
-
-#define KCUPS_REQUESTING_USER_NAME         "requesting-user-name"
-#define KCUPS_REQUESTING_USER_NAME_ALLOWED "requesting-user-name-allowed"
-#define KCUPS_REQUESTING_USER_NAME_DENIED  "requesting-user-name-denied"
-
-#define KCUPS_PPD_MAKE_AND_MODEL "ppd-make-and-model"
-
-#define KCUPS_NOTIFY_EVENTS          "notify-events"
-#define KCUPS_NOTIFY_PULL_METHOD     "notify-pull-method"
-#define KCUPS_NOTIFY_RECIPIENT_URI   "notify-recipient-uri"
-#define KCUPS_NOTIFY_LEASE_DURATION  "notify-lease-duration"
-#define KCUPS_NOTIFY_SUBSCRIPTION_ID "notify-subscription-id"
-
-typedef QList<QVariantHash> ReturnArguments;
-
-class KIppRequest;
-class KCupsPasswordDialog;
-class KDE_EXPORT KCupsConnection : public QThread
-{
-    Q_OBJECT
-public:
-    /**
-     * This is the main Cups class @author Daniel Nicoletti <dantti12@gmail.com>
-     *
-     * By calling KCupsConnection::global() you have access to it.
-     * Due to cups archtecture, this class has to live on a
-     * separate thread so we avoid blocking the user interface when
-     * the cups call blocks.
-     *
-     * It is IMPORTANT that we do not create several thread
-     * for each cups request, doing so is a valid but breaks our
-     * authentication. We could tho store the user information an
-     * set the user/password every time it was needed. But I am not
-     * sure this is safe.
-     *
-     * Extending this means either adding methods to the KCupsRequest
-     * class which will move to this thread and then run.
-     */
-    static KCupsConnection* global();
-
-    /**
-     * @brief KCupsConnection
-     * @param parent
-     *
-     * This is the default constructor that connects to the default server
-     * If you don't have any special reason for creating a connection
-     * on your own consider calling global()
-     */
-    explicit KCupsConnection(QObject *parent = 0);
-    explicit KCupsConnection(const KUrl &server, QObject *parent = 0);
-    ~KCupsConnection();
-
-    void setPasswordMainWindow(WId mainwindow);
-
-Q_SIGNALS:
-    /**
-     * emitted when "server-started" is registered
-     */
-    void serverStarted(const QString &text);
-
-    /**
-     * emitted when "server-stopped" is registered
-     */
-    void serverStopped(const QString &text);
-
-    /**
-     * emitted when "server-restarted" is registered
-     */
-    void serverRestarted(const QString &text);
-
-    /**
-     * emitted when "server-audit" is registered
-     */
-    void serverAudit(const QString &text);
-
-
-    /**
-     * emitted when "printer-added" is registered
-     */
-    void printerAdded(const QString &text,
-                      const QString &printerUri,
-                      const QString &printerName,
-                      uint printerState,
-                      const QString &printerStateReasons,
-                      bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-modified" is registered
-     */
-    void printerModified(const QString &text,
-                         const QString &printerUri,
-                         const QString &printerName,
-                         uint printerState,
-                         const QString &printerStateReasons,
-                         bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-deleted" is registered
-     */
-    void printerDeleted(const QString &text,
-                        const QString &printerUri,
-                        const QString &printerName,
-                        uint printerState,
-                        const QString &printerStateReasons,
-                        bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-state-changed" is registered
-     */
-    void printerStateChanged(const QString &text,
-                             const QString &printerUri,
-                             const QString &printerName,
-                             uint printerState,
-                             const QString &printerStateReasons,
-                             bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-stopped" is registered
-     */
-    void printerStopped(const QString &text,
-                        const QString &printerUri,
-                        const QString &printerName,
-                        uint printerState,
-                        const QString &printerStateReasons,
-                        bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-restarted" is registered
-     */
-    void printerRestarted(const QString &text,
-                          const QString &printerUri,
-                          const QString &printerName,
-                          uint printerState,
-                          const QString &printerStateReasons,
-                          bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-shutdown" is registered
-     */
-    void printerShutdown(const QString &text,
-                         const QString &printerUri,
-                         const QString &printerName,
-                         uint printerState,
-                         const QString &printerStateReasons,
-                         bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-media-changed" is registered
-     */
-    void printerMediaChanged(const QString &text,
-                             const QString &printerUri,
-                             const QString &printerName,
-                             uint printerState,
-                             const QString &printerStateReasons,
-                             bool printerIsAcceptingJobs);
-
-    /**
-     * emitted when "printer-finishings-changed" is registered
-     */
-    void printerFinishingsChanged(const QString &text,
-                                  const QString &printerUri,
-                                  const QString &printerName,
-                                  uint printerState,
-                                  const QString &printerStateReasons,
-                                  bool printerIsAcceptingJobs);
-
-
-    /**
-     * emitted when "job-state-changed" is registered
-     */
-    void jobState(const QString &text,
-                  const QString &printerUri,
-                  const QString &printerName,
-                  uint printerState,
-                  const QString &printerStateReasons,
-                  bool printerIsAcceptingJobs,
-                  uint jobId,
-                  uint jobState,
-                  const QString &jobStateReasons,
-                  const QString &jobName,
-                  uint jobImpressionsCompleted);
-
-    /**
-     * emitted when "job-created" is registered
-     */
-    void jobCreated(const QString &text,
-                    const QString &printerUri,
-                    const QString &printerName,
-                    uint printerState,
-                    const QString &printerStateReasons,
-                    bool printerIsAcceptingJobs,
-                    uint jobId,
-                    uint jobState,
-                    const QString &jobStateReasons,
-                    const QString &jobName,
-                    uint jobImpressionsCompleted);
-
-    /**
-     * emitted when "job-stopped" is registered
-     */
-    void jobStopped(const QString &text,
-                    const QString &printerUri,
-                    const QString &printerName,
-                    uint printerState,
-                    const QString &printerStateReasons,
-                    bool printerIsAcceptingJobs,
-                    uint jobId,
-                    uint jobState,
-                    const QString &jobStateReasons,
-                    const QString &jobName,
-                    uint jobImpressionsCompleted);
-
-    /**
-     * emitted when "job-config-changed" is registered
-     */
-    void jobConfigChanged(const QString &text,
-                          const QString &printerUri,
-                          const QString &printerName,
-                          uint printerState,
-                          const QString &printerStateReasons,
-                          bool printerIsAcceptingJobs,
-                          uint jobId,
-                          uint jobState,
-                          const QString &jobStateReasons,
-                          const QString &jobName,
-                          uint jobImpressionsCompleted);
-
-    /**
-     * emitted when "job-progress" is registered
-     */
-    void jobProgress(const QString &text,
-                     const QString &printerUri,
-                     const QString &printerName,
-                     uint printerState,
-                     const QString &printerStateReasons,
-                     bool printerIsAcceptingJobs,
-                     uint jobId,
-                     uint jobState,
-                     const QString &jobStateReasons,
-                     const QString &jobName,
-                     uint jobImpressionsCompleted);
-
-    /**
-     * emitted when "job-completed" is registered
-     */
-    void jobCompleted(const QString &text,
-                      const QString &printerUri,
-                      const QString &printerName,
-                      uint printerState,
-                      const QString &printerStateReasons,
-                      bool printerIsAcceptingJobs,
-                      uint jobId,
-                      uint jobState,
-                      const QString &jobStateReasons,
-                      const QString &jobName,
-                      uint jobImpressionsCompleted);
-
-    void rhPrinterAdded(const QString &queueName);
-    void rhPrinterRemoved(const QString &queueName);
-    void rhQueueChanged(const QString &queueName);
-    void rhJobQueuedLocal(const QString &queueName, uint jobId, const QString &jobOwner);
-    void rhJobStartedLocal(const QString &queueName, uint jobId, const QString &jobOwner);
-
-protected:
-    friend class KCupsRequest;
-
-    virtual void run();
-    bool readyToStart();
-    bool retry(const char *resource, int operation) const;
-    ReturnArguments request(const KIppRequest &request, ipp_tag_t groupTag = IPP_TAG_ZERO) const;
-
-private slots:
-    void updateSubscription();
-    void renewDBusSubscription();
-    void cancelDBusSubscription();
-
-protected:
-    virtual void connectNotify(const char *signal);
-    virtual void disconnectNotify(const char *signal);
-    QString eventForSignal(const char *signal) const;
-
-private:
-    void init();
-
-    int renewDBusSubscription(int subscriptionId, int leaseDuration, const QStringList &events = QStringList());
-
-    void notifierConnect(const QString &signal, QObject *receiver, const char *slot);
-
-    static ReturnArguments parseIPPVars(ipp_t *response,
-                                        ipp_tag_t group_tag);
-    static QVariant ippAttrToVariant(ipp_attribute_t *attr);
-
-    static KCupsConnection* m_instance;
-
-    bool m_inited;
-    KCupsPasswordDialog *m_passwordDialog;
-    KUrl m_serverUrl;
-
-    QTimer *m_subscriptionTimer;
-    QTimer *m_renewTimer;
-    QStringList m_connectedEvents;
-    QStringList m_requestedDBusEvents;
-    int m_subscriptionId;
-};
-
-#endif // KCUPSCONNECTION_H
diff --git a/print-manager/libkcups/KCupsJob.cpp b/print-manager/libkcups/KCupsJob.cpp
deleted file mode 100644 (file)
index 685a0af..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsJob.h"
-
-#include <KDebug>
-
-KCupsJob::KCupsJob() :
-    m_jobId(0)
-{
-}
-
-KCupsJob::KCupsJob(int jobId, const QString &printer) :
-    m_jobId(jobId),
-    m_printer(printer)
-{
-    m_arguments[KCUPS_JOB_ID] = QString::number(jobId);
-}
-
-KCupsJob::KCupsJob(const QVariantHash &arguments) :
-    m_arguments(arguments)
-{
-    m_jobId = arguments[KCUPS_JOB_ID].toInt();
-    m_printer = arguments[KCUPS_JOB_PRINTER_URI].toString().section('/', -1);
-}
-
-int KCupsJob::id() const
-{
-    return m_jobId;
-}
-
-QString KCupsJob::idStr() const
-{
-    return m_arguments[KCUPS_JOB_ID].toString();
-}
-
-QString KCupsJob::name() const
-{
-    return m_arguments[KCUPS_JOB_NAME].toString();
-}
-
-QString KCupsJob::originatingUserName() const
-{
-    return m_arguments[KCUPS_JOB_ORIGINATING_USER_NAME].toString();
-}
-
-QString KCupsJob::originatingHostName() const
-{
-    return m_arguments[KCUPS_JOB_ORIGINATING_HOST_NAME].toString();
-}
-
-QString KCupsJob::printer() const
-{
-    return m_printer;
-}
-
-QDateTime KCupsJob::createdAt() const
-{
-    QDateTime ret;
-    if (m_arguments.contains(KCUPS_TIME_AT_CREATION)) {
-        ret.setTime_t(m_arguments[KCUPS_TIME_AT_CREATION].toInt());
-    }
-    return ret;
-}
-
-QDateTime KCupsJob::completedAt() const
-{
-    QDateTime ret;
-    if (m_arguments.contains(KCUPS_TIME_AT_COMPLETED)) {
-        ret.setTime_t(m_arguments[KCUPS_TIME_AT_COMPLETED].toInt());
-    }
-    return ret;
-}
-
-QDateTime KCupsJob::processedAt() const
-{
-    QDateTime ret;
-    if (m_arguments.contains(KCUPS_TIME_AT_PROCESSING)) {
-        ret.setTime_t(m_arguments[KCUPS_TIME_AT_PROCESSING].toInt());
-    }
-    return ret;
-}
-
-int KCupsJob::pages() const
-{
-    return m_arguments[KCUPS_JOB_MEDIA_SHEETS].toInt();
-}
-
-int KCupsJob::processedPages() const
-{
-    return m_arguments[KCUPS_JOB_MEDIA_SHEETS_COMPLETED].toInt();
-}
-
-int KCupsJob::size() const
-{
-    int jobKOctets = m_arguments[KCUPS_JOB_K_OCTETS].toInt();
-    jobKOctets *= 1024; // transform it to bytes
-    return jobKOctets;
-}
-
-bool KCupsJob::preserved() const
-{
-    return m_arguments[KCUPS_JOB_PRESERVED].toInt();
-}
-
-QString KCupsJob::iconName(ipp_jstate_t state)
-{
-    QString ret;
-    switch (state){
-    case IPP_JOB_PENDING:
-        ret = QLatin1String("chronometer");
-        break;
-    case IPP_JOB_HELD:
-        ret = QLatin1String("media-playback-pause");
-        break;
-    case IPP_JOB_PROCESSING:
-        ret = QLatin1String("draw-arrow-forward");
-        break;
-    case IPP_JOB_STOPPED:
-        ret = QLatin1String("draw-rectangle");
-        break;
-    case IPP_JOB_CANCELED:
-        ret = QLatin1String("archive-remove");
-        break;
-    case IPP_JOB_ABORTED:
-        ret = QLatin1String("task-attempt");
-        break;
-    case IPP_JOB_COMPLETED:
-        ret = QLatin1String("task-complete");
-        break;
-    default:
-        ret = QLatin1String("unknown");
-    }
-    return ret;
-}
-
-ipp_jstate_t KCupsJob::state() const
-{
-    return static_cast<ipp_jstate_t>(m_arguments[KCUPS_JOB_STATE].toUInt());
-}
-
-QString KCupsJob::stateMsg() const
-{
-    return m_arguments[KCUPS_JOB_PRINTER_STATE_MESSAGE].toString();
-}
-
-bool KCupsJob::reprintEnabled() const
-{
-    if (state() >= IPP_JOB_STOPPED && preserved()) {
-        return true;
-    }
-    return false;
-}
-
-bool KCupsJob::cancelEnabled(ipp_jstate_t state)
-{
-    switch (state) {
-    case IPP_JOB_CANCELED:
-    case IPP_JOB_COMPLETED:
-    case IPP_JOB_ABORTED:
-        return false;
-    default:
-        return true;
-    }
-}
-
-bool KCupsJob::holdEnabled(ipp_jstate_t state)
-{
-    switch (state) {
-    case IPP_JOB_CANCELED:
-    case IPP_JOB_COMPLETED:
-    case IPP_JOB_ABORTED:
-    case IPP_JOB_HELD:
-    case IPP_JOB_STOPPED:
-        return false;
-    default:
-        return true;
-    }
-}
-
-bool KCupsJob::releaseEnabled(ipp_jstate_t state)
-{
-    switch (state) {
-    case IPP_JOB_HELD :
-    case IPP_JOB_STOPPED :
-        return true;
-    default:
-        return false;
-    }
-}
diff --git a/print-manager/libkcups/KCupsJob.h b/print-manager/libkcups/KCupsJob.h
deleted file mode 100644 (file)
index 0fc4267..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPSJOB_H
-#define KCUPSJOB_H
-
-#include <QString>
-#include <QDateTime>
-
-#include <KCupsConnection.h>
-
-class KDE_EXPORT KCupsJob
-{
-    Q_GADGET
-    Q_ENUMS(Attribute)
-public:
-    KCupsJob();
-    KCupsJob(int jobId, const QString &printer);
-
-    int id() const;
-    QString idStr() const;
-    QString name() const;    
-    QString originatingUserName() const;
-    QString originatingHostName() const;
-    QString printer() const;
-    QDateTime createdAt() const;
-    QDateTime completedAt() const;
-    QDateTime processedAt() const;
-    int pages() const;
-    int processedPages() const;
-    int size() const;
-    bool preserved() const;
-
-    static QString iconName(ipp_jstate_t state);
-    ipp_jstate_t state() const;
-    QString stateMsg() const;
-
-    bool reprintEnabled() const;
-
-    static bool cancelEnabled(ipp_jstate_t state);
-    static bool holdEnabled(ipp_jstate_t state);
-    static bool releaseEnabled(ipp_jstate_t state);
-
-protected:
-    KCupsJob(const QVariantHash &arguments);
-
-private:
-    friend class KCupsRequest;
-
-    int     m_jobId;
-    QString m_printer;
-    QVariantHash m_arguments;
-};
-
-typedef QList<KCupsJob> KCupsJobs;
-Q_DECLARE_METATYPE(KCupsJobs)
-Q_DECLARE_METATYPE(KCupsJob)
-
-#endif // KCUPSJOB_H
diff --git a/print-manager/libkcups/KCupsPasswordDialog.cpp b/print-manager/libkcups/KCupsPasswordDialog.cpp
deleted file mode 100644 (file)
index f6806d6..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsPasswordDialog.h"
-
-#include <QPointer>
-
-#include <KPasswordDialog>
-#include <KWindowSystem>
-#include <KLocale>
-
-#include <KDebug>
-
-KCupsPasswordDialog::KCupsPasswordDialog(QObject *parent) :
-    QObject(parent),
-    m_accepted(false),
-    m_mainwindow(0)
-{
-}
-
-void KCupsPasswordDialog::setMainWindow(WId mainwindow)
-{
-    m_mainwindow = mainwindow;
-}
-
-void KCupsPasswordDialog::exec(const QString &username, bool wrongPassword)
-{
-    QPointer<KPasswordDialog> dialog = new KPasswordDialog(0L, KPasswordDialog::ShowUsernameLine);
-    dialog->setPrompt(i18n("Enter an username and a password to complete the task"));
-    dialog->setModal(false);
-    dialog->setUsername(username);
-    if (wrongPassword) {
-        dialog->showErrorMessage(QString(), KPasswordDialog::UsernameError);
-        dialog->showErrorMessage(i18n("Wrong username or password"), KPasswordDialog::PasswordError);
-    }
-
-    dialog->show();
-    if (m_mainwindow) {
-        KWindowSystem::setMainWindow(dialog, m_mainwindow);
-    }
-    KWindowSystem::forceActiveWindow(dialog->winId());
-
-    // Do not return from this method now
-    dialog->exec();
-
-    if (dialog) {
-        m_accepted = dialog->result() == QDialog::Accepted;
-        m_username = dialog->username();
-        m_password = dialog->password();
-        dialog->deleteLater();
-    }
-}
-
-bool KCupsPasswordDialog::accepted() const
-{
-    return m_accepted;
-}
-
-QString KCupsPasswordDialog::username() const
-{
-    return m_username;
-}
-
-QString KCupsPasswordDialog::password() const
-{
-    return m_password;
-}
diff --git a/print-manager/libkcups/KCupsPasswordDialog.h b/print-manager/libkcups/KCupsPasswordDialog.h
deleted file mode 100644 (file)
index 29634f0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPSPASSWORDDIALOG_H
-#define KCUPSPASSWORDDIALOG_H
-
-#include <QObject>
-#include <QWidget>
-
-class KCupsPasswordDialog : public QObject
-{
-    Q_OBJECT
-public:
-    explicit KCupsPasswordDialog(QObject *parent = 0);
-    void setMainWindow(WId mainwindow);
-
-public slots:
-    void exec(const QString &username, bool wrongPassword);
-
-    bool accepted() const;
-    QString username() const;
-    QString password() const;
-
-private:
-    bool m_accepted;
-    WId m_mainwindow;
-    QString m_username;
-    QString m_password;
-};
-
-#endif // KCUPSPASSWORDDIALOG_H
diff --git a/print-manager/libkcups/KCupsPrinter.cpp b/print-manager/libkcups/KCupsPrinter.cpp
deleted file mode 100644 (file)
index 7abce9f..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsPrinter.h"
-
-#include <KDebug>
-
-KCupsPrinter::KCupsPrinter() :
-    m_isClass(false)
-{
-}
-
-KCupsPrinter::KCupsPrinter(const QString &printer, bool isClass) :
-    m_printer(printer),
-    m_isClass(isClass)
-{
-}
-
-KCupsPrinter::KCupsPrinter(const QVariantHash &arguments) :
-    m_arguments(arguments)
-{
-    m_printer = arguments[KCUPS_PRINTER_NAME].toString();
-    m_isClass = arguments[KCUPS_PRINTER_TYPE].toInt() & CUPS_PRINTER_CLASS;
-}
-
-QString KCupsPrinter::name() const
-{
-    return m_printer;
-}
-
-bool KCupsPrinter::isClass() const
-{
-    return m_isClass;
-}
-
-bool KCupsPrinter::isDefault() const
-{
-    return m_arguments[KCUPS_PRINTER_TYPE].toUInt() & CUPS_PRINTER_DEFAULT;
-}
-
-bool KCupsPrinter::isShared() const
-{
-    return m_arguments[KCUPS_PRINTER_IS_SHARED].toBool();
-}
-
-bool KCupsPrinter::isAcceptingJobs() const
-{
-    return m_arguments[KCUPS_PRINTER_IS_ACCEPTING_JOBS].toBool();
-}
-
-cups_ptype_e KCupsPrinter::type() const
-{
-    return static_cast<cups_ptype_e>(m_arguments[KCUPS_PRINTER_TYPE].toUInt());
-}
-
-QString KCupsPrinter::location() const
-{
-    return m_arguments[KCUPS_PRINTER_LOCATION].toString();
-}
-
-QString KCupsPrinter::info() const
-{
-    if (m_arguments[KCUPS_PRINTER_INFO].toString().isEmpty()) {
-        return name();
-    }
-    return m_arguments[KCUPS_PRINTER_INFO].toString();
-}
-
-QString KCupsPrinter::makeAndModel() const
-{
-    return m_arguments[KCUPS_PRINTER_MAKE_AND_MODEL].toString();
-}
-
-QStringList KCupsPrinter::commands() const
-{
-    return m_arguments[KCUPS_PRINTER_COMMANDS].toStringList();
-}
-
-QStringList KCupsPrinter::memberNames() const
-{
-    return m_arguments[KCUPS_MEMBER_NAMES].toStringList();
-}
-
-QString KCupsPrinter::deviceUri() const
-{
-    return m_arguments[KCUPS_DEVICE_URI].toString();
-}
-
-QStringList KCupsPrinter::errorPolicy() const
-{
-    return m_arguments[KCUPS_PRINTER_ERROR_POLICY].toStringList();
-}
-
-QStringList KCupsPrinter::errorPolicySupported() const
-{
-    return m_arguments[KCUPS_PRINTER_ERROR_POLICY_SUPPORTED].toStringList();
-}
-
-QStringList KCupsPrinter::opPolicy() const
-{
-    return m_arguments[KCUPS_PRINTER_OP_POLICY].toStringList();
-}
-
-QStringList KCupsPrinter::opPolicySupported() const
-{
-    return m_arguments[KCUPS_PRINTER_OP_POLICY_SUPPORTED].toStringList();
-}
-
-QStringList KCupsPrinter::jobSheetsDefault() const
-{
-    return m_arguments[KCUPS_JOB_SHEETS_DEFAULT].toStringList();
-}
-
-QStringList KCupsPrinter::jobSheetsSupported() const
-{
-    return m_arguments[KCUPS_JOB_SHEETS_SUPPORTED].toStringList();
-}
-
-QStringList KCupsPrinter::requestingUserNameAllowed() const
-{
-    return m_arguments[KCUPS_REQUESTING_USER_NAME_ALLOWED].toStringList();
-}
-
-QStringList KCupsPrinter::requestingUserNameDenied() const
-{
-    return m_arguments[KCUPS_REQUESTING_USER_NAME_DENIED].toStringList();
-}
-
-QString KCupsPrinter::uriSupported() const
-{
-    return m_arguments[KCUPS_PRINTER_URI_SUPPORTED].toString();
-}
-
-KCupsPrinter::Status KCupsPrinter::state() const
-{
-    return static_cast<Status>(m_arguments[KCUPS_PRINTER_STATE].toUInt());
-}
-
-QString KCupsPrinter::stateMsg() const
-{
-    return m_arguments[KCUPS_PRINTER_STATE_MESSAGE].toString();
-}
-
-int KCupsPrinter::markerChangeTime() const
-{
-    return m_arguments[KCUPS_MARKER_CHANGE_TIME].toInt();
-}
-
-QVariant KCupsPrinter::argument(const QString &name) const
-{
-    return m_arguments.value(name);
-}
-
-KIcon KCupsPrinter::icon() const
-{
-    return icon(type());
-}
-
-KIcon KCupsPrinter::icon(cups_ptype_e type)
-{
-    return KIcon(iconName(type));
-}
-
-QString KCupsPrinter::iconName() const
-{
-    return iconName(type());
-}
-
-QString KCupsPrinter::iconName(cups_ptype_e type)
-{
-    // TODO get the ppd or something to get the real printer icon
-    if (!(type & CUPS_PRINTER_COLOR)) {
-        // If the printer is not color it is probably a laser one
-        return "printer-laser";
-    } else if (type & CUPS_PRINTER_SCANNER) {
-        return "scanner";
-    } else {
-        return "printer";
-    }
-}
diff --git a/print-manager/libkcups/KCupsPrinter.h b/print-manager/libkcups/KCupsPrinter.h
deleted file mode 100644 (file)
index ed08de2..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPSPRINTER_H
-#define KCUPSPRINTER_H
-
-#include <QString>
-
-#include <KIcon>
-
-#include <KCupsConnection.h>
-
-class KDE_EXPORT KCupsPrinter
-{
-    Q_GADGET
-    Q_ENUMS(Status)
-public:
-    typedef enum {
-        Idle = 3,
-        Printing,
-        Stopped
-    } Status;
-    KCupsPrinter();
-    explicit KCupsPrinter(const QString &printer, bool isClass = false);
-
-    QString name() const;
-    bool isClass() const;
-    bool isDefault() const;
-    bool isShared() const;
-    bool isAcceptingJobs() const;
-    cups_ptype_e type() const;
-    QString location() const;
-    QString info() const;
-    QString makeAndModel() const;
-    QStringList commands() const;
-    QStringList memberNames() const;
-    QString deviceUri() const;
-    QStringList errorPolicy() const;
-    QStringList errorPolicySupported() const;
-    QStringList opPolicy() const;
-    QStringList opPolicySupported() const;
-    QStringList jobSheetsDefault() const;
-    QStringList jobSheetsSupported() const;
-    QStringList requestingUserNameAllowed() const;
-    QStringList requestingUserNameDenied() const;
-    QString uriSupported() const;
-
-    Status state() const;
-    QString stateMsg() const;
-    int markerChangeTime() const;
-    QVariant argument(const QString &name) const;
-
-    /**
-      * Requires enum PrinterType to work properly
-      *
-      */
-    KIcon icon() const;
-    static KIcon icon(cups_ptype_e type);
-    QString iconName() const;
-    static QString iconName(cups_ptype_e type);
-
-protected:
-    KCupsPrinter(const QVariantHash &arguments);
-
-private:
-    friend class KCupsRequest;
-
-    QString m_printer;
-    bool    m_isClass;
-    QVariantHash m_arguments;
-};
-
-typedef QList<KCupsPrinter> KCupsPrinters;
-Q_DECLARE_METATYPE(KCupsPrinters)
-Q_DECLARE_METATYPE(KCupsPrinter)
-Q_DECLARE_METATYPE(KCupsPrinter::Status)
-
-#endif // KCUPSPRINTER_H
diff --git a/print-manager/libkcups/KCupsRequest.cpp b/print-manager/libkcups/KCupsRequest.cpp
deleted file mode 100644 (file)
index 06c5e79..0000000
+++ /dev/null
@@ -1,667 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsRequest.h"
-#include "KIppRequest.h"
-#include "KCupsJob.h"
-#include "KCupsPrinter.h"
-#include <KLocale>
-#include <KDebug>
-
-#include <cups/adminutil.h>
-#include <cups/ppd.h>
-
-#define CUPS_DATADIR    "/usr/share/cups"
-
-KCupsRequest::KCupsRequest(KCupsConnection *connection) :
-    m_connection(connection),
-    m_finished(true),
-    m_error(IPP_OK)
-{
-    // If no connection was specified use default one
-    if (m_connection == 0) {
-        m_connection = KCupsConnection::global();
-    }
-    connect(this, SIGNAL(finished()), &m_loop, SLOT(quit()));
-}
-
-QString KCupsRequest::serverError() const
-{
-    switch (error()) {
-    case IPP_SERVICE_UNAVAILABLE:
-        return i18n("Print service is unavailable");
-    case IPP_NOT_FOUND :
-        return i18n("Not found");
-    default : // In this case we don't want to map all enums
-        kWarning() << "status unrecognised: " << error();
-        return QString::fromUtf8(ippErrorString(error()));
-    }
-}
-
-void KCupsRequest::getPPDS(const QString &make)
-{
-    if (m_connection->readyToStart()) {
-        KIppRequest request(CUPS_GET_PPDS, "/");
-        if (!make.isEmpty()) {
-            request.addString(IPP_TAG_PRINTER, IPP_TAG_TEXT, KCUPS_PPD_MAKE_AND_MODEL, make);
-        }
-
-        m_ppds = m_connection->request(request, IPP_TAG_PRINTER);
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getPPDS", make);
-    }
-}
-
-static void choose_device_cb(const char *device_class,           /* I - Class */
-                             const char *device_id,              /* I - 1284 device ID */
-                             const char *device_info,            /* I - Description */
-                             const char *device_make_and_model,  /* I - Make and model */
-                             const char *device_uri,             /* I - Device URI */
-                             const char *device_location,        /* I - Location */
-                             void *user_data)                    /* I - Result object */
-{
-    /*
-     * Add the device to the array...
-     */
-    KCupsRequest *request = static_cast<KCupsRequest*>(user_data);
-    QMetaObject::invokeMethod(request,
-                              "device",
-                              Qt::QueuedConnection,
-                              Q_ARG(QString, QString::fromUtf8(device_class)),
-                              Q_ARG(QString, QString::fromUtf8(device_id)),
-                              Q_ARG(QString, QString::fromUtf8(device_info)),
-                              Q_ARG(QString, QString::fromUtf8(device_make_and_model)),
-                              Q_ARG(QString, QString::fromUtf8(device_uri)),
-                              Q_ARG(QString, QString::fromUtf8(device_location)));
-}
-
-void KCupsRequest::getDevices(int timeout)
-{
-    getDevices(timeout, QStringList(), QStringList());
-}
-
-void KCupsRequest::getDevices(int timeout, QStringList includeSchemes, QStringList excludeSchemes)
-{
-    if (m_connection->readyToStart()) {
-        do {
-            const char *include;
-            if (includeSchemes.isEmpty()) {
-                include = CUPS_INCLUDE_ALL;
-            } else {
-                include = includeSchemes.join(QLatin1String(",")).toUtf8();
-            }
-
-            const char *exclude;
-            if (excludeSchemes.isEmpty()) {
-                exclude = CUPS_EXCLUDE_NONE;
-            } else {
-                exclude = excludeSchemes.join(QLatin1String(",")).toUtf8();
-            }
-
-            // Scan for devices for "timeout" seconds
-            cupsGetDevices(CUPS_HTTP_DEFAULT,
-                           timeout,
-                           include,
-                           exclude,
-                           (cups_device_cb_t) choose_device_cb,
-                           this);
-        } while (m_connection->retry("/admin/", CUPS_GET_DEVICES));
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished(true);
-    } else {
-        invokeMethod("getDevices", timeout, includeSchemes, excludeSchemes);
-    }
-}
-
-// THIS function can get the default server dest through the
-// "printer-is-default" attribute BUT it does not get user
-// defined default printer, see cupsGetDefault() on www.cups.org for details
-
-void KCupsRequest::getPrinters(QStringList attributes, int mask)
-{
-    if (m_connection->readyToStart()) {
-        KIppRequest request(CUPS_GET_PRINTERS, "/");
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_PRINTER_TYPE, CUPS_PRINTER_LOCAL);
-        if (!attributes.isEmpty()) {
-            request.addStringList(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_REQUESTED_ATTRIBUTES, attributes);
-        }
-        if (mask != -1) {
-            request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_PRINTER_TYPE_MASK, mask);
-        }
-
-        ReturnArguments ret;
-        ret = m_connection->request(request, IPP_TAG_PRINTER);
-
-        foreach (const QVariantHash &arguments, ret) {
-            m_printers << KCupsPrinter(arguments);
-        }
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getPrinters", qVariantFromValue(attributes), mask);
-    }
-}
-
-void KCupsRequest::getPrinterAttributes(const QString &printerName, bool isClass, QStringList attributes)
-{
-    if (m_connection->readyToStart()) {
-        KIppRequest request(IPP_GET_PRINTER_ATTRIBUTES, "/");
-
-        request.addPrinterUri(printerName, isClass);
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_PRINTER_TYPE, CUPS_PRINTER_LOCAL);
-        request.addStringList(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_REQUESTED_ATTRIBUTES, attributes);
-
-        ReturnArguments ret;
-        ret = m_connection->request(request, IPP_TAG_PRINTER);
-
-        foreach (const QVariantHash &arguments, ret) {
-            // Inject the printer name back to the arguments hash
-            QVariantHash args = arguments;
-            args[KCUPS_PRINTER_NAME] = printerName;
-            m_printers << KCupsPrinter(args);
-        }
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getPrinterAttributes", printerName, isClass, qVariantFromValue(attributes));
-    }
-}
-
-void KCupsRequest::getJobs(const QString &printerName, bool myJobs, int whichJobs, QStringList attributes)
-{
-    if (m_connection->readyToStart()) {
-        KIppRequest request(IPP_GET_JOBS, "/");
-
-        // printer-uri makes the Name of the Job and owner came blank lol
-        request.addPrinterUri(printerName, false);
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_PRINTER_TYPE, CUPS_PRINTER_LOCAL);
-        request.addStringList(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_REQUESTED_ATTRIBUTES, attributes);
-
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_MY_JOBS, myJobs);
-
-        if (whichJobs == CUPS_WHICHJOBS_COMPLETED) {
-            request.addString(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_WHICH_JOBS, "completed");
-        } else if (whichJobs == CUPS_WHICHJOBS_ALL) {
-            request.addString(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_WHICH_JOBS, "all");
-        }
-
-        ReturnArguments ret;
-        ret = m_connection->request(request, IPP_TAG_JOB);
-
-        foreach (const QVariantHash &arguments, ret) {
-            m_jobs << KCupsJob(arguments);
-        }
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getJobs", printerName, myJobs, whichJobs, qVariantFromValue(attributes));
-    }
-}
-
-void KCupsRequest::getJobAttributes(int jobId, const QString &printerUri, QStringList attributes)
-{
-    if (m_connection->readyToStart()) {
-        KIppRequest request(IPP_GET_JOB_ATTRIBUTES, "/");
-
-        request.addString(IPP_TAG_OPERATION, IPP_TAG_URI, KCUPS_PRINTER_URI, printerUri);
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, KCUPS_PRINTER_TYPE, CUPS_PRINTER_LOCAL);
-        request.addStringList(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, KCUPS_REQUESTED_ATTRIBUTES, attributes);
-
-        request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-
-        ReturnArguments ret;
-        ret = m_connection->request(request, IPP_TAG_PRINTER);
-
-        foreach (const QVariantHash &arguments, ret) {
-            m_jobs << KCupsJob(arguments);
-        }
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getJobAttributes", jobId, printerUri, qVariantFromValue(attributes));
-    }
-}
-
-void KCupsRequest::getServerSettings()
-{
-    if (m_connection->readyToStart()) {
-        do {
-            int num_settings;
-            cups_option_t *settings;
-            QVariantHash arguments;
-            int ret = cupsAdminGetServerSettings(CUPS_HTTP_DEFAULT, &num_settings, &settings);
-            for (int i = 0; i < num_settings; ++i) {
-                QString name = QString::fromUtf8(settings[i].name);
-                QString value = QString::fromUtf8(settings[i].value);
-                arguments[name] = value;
-            }
-            cupsFreeOptions(num_settings, settings);
-            if (ret) {
-                setError(HTTP_OK, IPP_OK, QString());
-            } else {
-                setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-            }
-
-            m_server = KCupsServer(arguments);
-        } while (m_connection->retry("/admin/", -1));
-        setFinished();
-    } else {
-        invokeMethod("getServerSettings");
-    }
-}
-
-void KCupsRequest::getPrinterPPD(const QString &printerName)
-{
-    if (m_connection->readyToStart()) {
-        do {
-            const char  *filename;
-            filename = cupsGetPPD2(CUPS_HTTP_DEFAULT, printerName.toUtf8());
-            kDebug() << filename;
-            m_ppdFile = filename;
-            kDebug() << m_ppdFile;
-        } while (m_connection->retry("/", CUPS_GET_PPD));
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("getPrinterPPD", printerName);
-    }
-}
-
-void KCupsRequest::setServerSettings(const KCupsServer &server)
-{
-    if (m_connection->readyToStart()) {
-        do {
-            QVariantHash args = server.arguments();
-            int num_settings = 0;
-            cups_option_t *settings;
-
-            QVariantHash::const_iterator i = args.constBegin();
-            while (i != args.constEnd()) {
-                num_settings = cupsAddOption(i.key().toUtf8(),
-                                             i.value().toString().toUtf8(),
-                                             num_settings,
-                                             &settings);
-                ++i;
-            }
-
-            cupsAdminSetServerSettings(CUPS_HTTP_DEFAULT, num_settings, settings);
-            cupsFreeOptions(num_settings, settings);
-        } while (m_connection->retry("/admin/", -1));
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("setServerSettings", qVariantFromValue(server));
-    }
-}
-
-void KCupsRequest::addOrModifyPrinter(const QString &printerName, const QVariantHash &attributes, const QString &filename)
-{
-    KIppRequest request(CUPS_ADD_MODIFY_PRINTER, "/admin/", filename);
-    request.addPrinterUri(printerName);
-    request.addVariantValues(attributes);
-
-    process(request);
-}
-
-void KCupsRequest::addOrModifyClass(const QString &printerName, const QVariantHash &attributes)
-{
-    KIppRequest request(CUPS_ADD_MODIFY_CLASS, "/admin/");
-    request.addPrinterUri(printerName, true);
-    request.addVariantValues(attributes);
-
-    process(request);
-}
-
-void KCupsRequest::setShared(const QString &printerName, bool isClass, bool shared)
-{
-    KIppRequest request(isClass ? CUPS_ADD_MODIFY_CLASS : CUPS_ADD_MODIFY_PRINTER, "/admin/");
-    request.addPrinterUri(printerName, isClass);
-    request.addBoolean(IPP_TAG_OPERATION, KCUPS_PRINTER_IS_SHARED, shared);
-
-    process(request);
-}
-
-void KCupsRequest::pausePrinter(const QString &printerName)
-{
-    KIppRequest request(IPP_PAUSE_PRINTER, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::resumePrinter(const QString &printerName)
-{
-    KIppRequest request(IPP_RESUME_PRINTER, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::rejectJobs(const QString &printerName)
-{
-    KIppRequest request(CUPS_REJECT_JOBS, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::acceptJobs(const QString &printerName)
-{
-    KIppRequest request(CUPS_ACCEPT_JOBS, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::setDefaultPrinter(const QString &printerName)
-{
-    KIppRequest request(CUPS_SET_DEFAULT, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::deletePrinter(const QString &printerName)
-{
-    KIppRequest request(CUPS_DELETE_PRINTER, "/admin/");
-    request.addPrinterUri(printerName);
-
-    process(request);
-}
-
-void KCupsRequest::printTestPage(const QString &printerName, bool isClass)
-{
-    QString resource; /* POST resource path */
-    QString filename; /* Test page filename */
-    QString datadir;  /* CUPS_DATADIR env var */
-
-    /*
-     * Locate the test page file...
-     */
-    datadir = qgetenv("CUPS_DATADIR");
-    if (datadir.isEmpty()) {
-        datadir = CUPS_DATADIR;
-    }
-    filename = datadir + QLatin1String("/data/testprint");
-
-    /*
-     * Point to the printer/class...
-     */
-    if (isClass) {
-        resource = QLatin1String("/classes/") + printerName;
-    } else {
-        resource = QLatin1String("/printers/") + printerName;
-    }
-
-    KIppRequest request(IPP_PRINT_JOB, resource.toUtf8(), filename);
-    request.addPrinterUri(printerName);
-    request.addString(IPP_TAG_OPERATION, IPP_TAG_NAME, KCUPS_JOB_NAME, i18n("Test Page"));
-
-    process(request);
-}
-
-void KCupsRequest::printCommand(const QString &printerName, const QString &command, const QString &title)
-{
-    if (m_connection->readyToStart()) {
-        do {
-            int           job_id;                 /* Command file job */
-            char          command_file[1024];     /* Command "file" */
-            http_status_t status;                 /* Document status */
-            cups_option_t hold_option;            /* job-hold-until option */
-
-            /*
-             * Create the CUPS command file...
-             */
-            snprintf(command_file, sizeof(command_file), "#CUPS-COMMAND\n%s\n", command.toUtf8().data());
-
-            /*
-             * Send the command file job...
-             */
-            hold_option.name  = const_cast<char*>("job-hold-until");
-            hold_option.value = const_cast<char*>("no-hold");
-
-            if ((job_id = cupsCreateJob(CUPS_HTTP_DEFAULT,
-                                        printerName.toUtf8(),
-                                        title.toUtf8(),
-                                        1,
-                                        &hold_option)) < 1) {
-                qWarning() << "Unable to send command to printer driver!";
-
-                setError(HTTP_OK, IPP_NOT_POSSIBLE, i18n("Unable to send command to printer driver!"));
-                setFinished();
-                return;
-            }
-
-            status = cupsStartDocument(CUPS_HTTP_DEFAULT,
-                                       printerName.toUtf8(),
-                                       job_id,
-                                       NULL,
-                                       CUPS_FORMAT_COMMAND,
-                                       1);
-            if (status == HTTP_CONTINUE) {
-                status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, command_file,
-                                              strlen(command_file));
-            }
-
-            if (status == HTTP_CONTINUE) {
-                cupsFinishDocument(CUPS_HTTP_DEFAULT, printerName.toUtf8());
-            }
-
-            setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-            if (httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError() >= IPP_REDIRECTION_OTHER_SITE) {
-                qWarning() << "Unable to send command to printer driver!";
-
-                cupsCancelJob(printerName.toUtf8(), job_id);
-                setFinished();
-                return; // Return to avoid a new try
-            }
-        } while (m_connection->retry("/", IPP_CREATE_JOB));
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("printCommand", printerName, command, title);
-    }
-}
-
-void KCupsRequest::cancelJob(const QString &printerName, int jobId)
-{
-    KIppRequest request(IPP_CANCEL_JOB, "/jobs/");
-    request.addPrinterUri(printerName);
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-
-    process(request);
-}
-
-void KCupsRequest::holdJob(const QString &printerName, int jobId)
-{
-    KIppRequest request(IPP_HOLD_JOB, "/jobs/");
-    request.addPrinterUri(printerName);
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-
-    process(request);
-}
-
-void KCupsRequest::releaseJob(const QString &printerName, int jobId)
-{
-    KIppRequest request(IPP_RELEASE_JOB, "/jobs/");
-    request.addPrinterUri(printerName);
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-
-    process(request);
-}
-
-void KCupsRequest::restartJob(const QString &printerName, int jobId)
-{
-    KIppRequest request(IPP_RESTART_JOB, "/jobs/");
-    request.addPrinterUri(printerName);
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-
-    process(request);
-}
-
-void KCupsRequest::moveJob(const QString &fromPrinterName, int jobId, const QString &toPrinterName)
-{
-    if (jobId < -1 || fromPrinterName.isEmpty() || toPrinterName.isEmpty() || jobId == 0) {
-        qWarning() << "Internal error, invalid input data" << jobId << fromPrinterName << toPrinterName;
-        setFinished();
-        return;
-    }
-
-    KIppRequest request(CUPS_MOVE_JOB, "/jobs/");
-    request.addPrinterUri(fromPrinterName);
-    request.addInteger(IPP_TAG_OPERATION, IPP_TAG_INTEGER, KCUPS_JOB_ID, jobId);
-    request.addString(IPP_TAG_OPERATION, IPP_TAG_URI, KCUPS_JOB_PRINTER_URI, toPrinterName);
-
-    process(request);
-}
-
-void KCupsRequest::invokeMethod(const char *method,
-                                const QVariant &arg1,
-                                const QVariant &arg2,
-                                const QVariant &arg3,
-                                const QVariant &arg4,
-                                const QVariant &arg5,
-                                const QVariant &arg6,
-                                const QVariant &arg7,
-                                const QVariant &arg8)
-{
-    m_error = IPP_OK;
-    m_errorMsg.clear();
-    m_printers.clear();
-    m_jobs.clear();
-    m_ppds.clear();
-    m_ppdFile.clear();
-
-    // If this fails we get into a infinite loop
-    // Do not use global()->thread() which point
-    // to the KCupsConnection parent thread
-    moveToThread(m_connection);
-
-    m_finished = !QMetaObject::invokeMethod(this,
-                                            method,
-                                            Qt::QueuedConnection,
-                                            QGenericArgument(arg1.typeName(), arg1.data()),
-                                            QGenericArgument(arg2.typeName(), arg2.data()),
-                                            QGenericArgument(arg3.typeName(), arg3.data()),
-                                            QGenericArgument(arg4.typeName(), arg4.data()),
-                                            QGenericArgument(arg5.typeName(), arg5.data()),
-                                            QGenericArgument(arg6.typeName(), arg6.data()),
-                                            QGenericArgument(arg7.typeName(), arg7.data()),
-                                            QGenericArgument(arg8.typeName(), arg8.data()));
-    if (m_finished) {
-        setError(HTTP_ERROR, IPP_BAD_REQUEST, i18n("Failed to invoke method: %1", method));
-        setFinished();
-    }
-}
-
-void KCupsRequest::process(const KIppRequest &request)
-{
-    if (m_connection->readyToStart()) {
-        m_connection->request(request);
-
-        setError(httpGetStatus(CUPS_HTTP_DEFAULT), cupsLastError(), QString::fromUtf8(cupsLastErrorString()));
-        setFinished();
-    } else {
-        invokeMethod("process", qVariantFromValue(request));
-    }
-}
-
-ReturnArguments KCupsRequest::ppds() const
-{
-    return m_ppds;
-}
-
-KCupsServer KCupsRequest::serverSettings() const
-{
-    return m_server;
-}
-
-QString KCupsRequest::printerPPD() const
-{
-    return m_ppdFile;
-}
-
-KCupsPrinters KCupsRequest::printers() const
-{
-    return m_printers;
-}
-
-KCupsJobs KCupsRequest::jobs() const
-{
-    return m_jobs;
-}
-
-void KCupsRequest::waitTillFinished()
-{
-    if (m_finished) {
-        return;
-    }
-
-    m_loop.exec();
-}
-
-bool KCupsRequest::hasError() const
-{
-    return m_error;
-}
-
-ipp_status_t KCupsRequest::error() const
-{
-    return m_error;
-}
-
-http_status_t KCupsRequest::httpStatus() const
-{
-    return m_httpStatus;
-}
-
-QString KCupsRequest::errorMsg() const
-{
-    return m_errorMsg;
-}
-
-KCupsConnection *KCupsRequest::connection() const
-{
-    return m_connection;
-}
-
-void KCupsRequest::setError(http_status_t httpStatus, ipp_status_t error, const QString &errorMsg)
-{
-    m_httpStatus = httpStatus;
-    m_error = error;
-    m_errorMsg = errorMsg;
-}
-
-void KCupsRequest::setFinished(bool delayed)
-{
-    m_finished = true;
-    if (delayed) {
-        QTimer::singleShot(0, this, SIGNAL(finished()));
-    } else {
-        emit finished();
-    }
-}
diff --git a/print-manager/libkcups/KCupsRequest.h b/print-manager/libkcups/KCupsRequest.h
deleted file mode 100644 (file)
index fced387..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPS_REQUEST_H
-#define KCUPS_REQUEST_H
-
-#include <QObject>
-#include <QEventLoop>
-
-#include "KCupsConnection.h"
-#include "KCupsJob.h"
-#include "KCupsPrinter.h"
-#include "KCupsServer.h"
-#include "KIppRequest.h"
-
-class KDE_EXPORT KCupsRequest : public QObject
-{
-    Q_OBJECT
-public:
-    /**
-     * Default constructor, it takes no parent
-     * because it will move to KCupsConnection thread
-     *
-     * Before calling any method connect to finished() signal or
-     * use waitTillFinished().
-     * You must delete the object manually after finished
-     * using deleteLater().
-     */
-    explicit KCupsRequest(KCupsConnection *connection = 0);
-
-    /**
-     * This method creates an event loop
-     * and quits after the request is finished
-     */
-    void waitTillFinished();
-
-    /**
-     * This method returns true if there was an error with the request
-     */
-    bool hasError() const;
-    ipp_status_t error() const;
-    http_status_t httpStatus() const;
-    QString serverError() const;
-    QString errorMsg() const;
-
-    KCupsConnection* connection() const;
-
-    /**
-     * Non empty when getPrinters is called and finish is emitted
-     */
-    KCupsPrinters printers() const;
-
-    /**
-     * Non empty when getPPDs is called and finish is emitted
-     */
-    ReturnArguments ppds() const;
-
-    /**
-     * Non empty when getServerSettings() is called and finish is emitted
-     */
-    KCupsServer serverSettings() const;
-
-    /**
-     * Non empty when \sa getPrinterPPD() is called and finish is emitted
-     * \warning You must unlik the given file name
-     */
-    QString printerPPD() const;
-
-    /**
-     * Non empty when getJobs is called and finish is emitted
-     */
-    KCupsJobs jobs() const;
-
-    /**
-     * Get all available PPDs from the givem make
-     * @param make the maker of the printer
-     */
-    Q_INVOKABLE void getPPDS(const QString &make = QString());
-
-    /**
-     * Get all devices that could be added as a printer
-     * This method emits device()
-     */
-    Q_INVOKABLE void getDevices(int timeout = CUPS_TIMEOUT_DEFAULT);
-
-    /**
-     * Get all devices that could be added as a printer
-     * This method emits device()
-     */
-    Q_INVOKABLE void getDevices(int timeout, QStringList includeSchemes, QStringList excludeSchemes);
-
-    /**
-     * Get all available printers
-     * @param mask filter the kind of printer that will be emitted (-1 to no filter)
-     * @param requestedAttr the attibutes to retrieve from cups
-     * This method emits printer()
-     *
-     * THIS function can get the default server dest through the
-     * "printer-is-default" attribute BUT it does not get user
-     * defined default printer, see cupsGetDefault() on www.cups.org for details
-     */
-    Q_INVOKABLE void getPrinters(QStringList attributes, int mask = -1);
-
-    /**
-     * Get attributes from a given printer
-     * @param printer The printer to apply the change
-     * @param isClass True it is a printer class
-     * @param attributes The attributes you are requesting
-     *
-     * @return The return will be stored in \sa printers()
-     */
-    Q_INVOKABLE void getPrinterAttributes(const QString &printerName, bool isClass, QStringList attributes);
-
-    /**
-     * Get all jobs
-     * This method emits job()
-     * TODO we need to see if we authenticate as root to do some taks
-     *      the myJobs will return the user's jobs or the root's jobs
-     * @param printer which printer you are requiring jobs for (empty = all printers)
-     * @param myJobs true if you only want your jobs
-     * @param whichJobs which kind jobs should be sent
-     */
-    Q_INVOKABLE void getJobs(const QString &printerName, bool myJobs, int whichJobs, QStringList attributes);
-
-    /**
-     * Get attributes from a given printer
-     * @param printer The printer to apply the change
-     * @param isClass True it is a printer class
-     * @param attributes The attributes you are requesting
-     *
-     * @return The return will be stored in \sa printers()
-     */
-    Q_INVOKABLE void getJobAttributes(int jobId, const QString &printerUri, QStringList attributes);
-
-    /**
-     * Get the CUPS server settings
-     * This method emits server()
-     */
-    Q_INVOKABLE void getServerSettings();
-
-    /**
-     * Get the PPD associated with @arg printerName
-     * the result is stored at \sa printerPPD()
-     */
-    Q_INVOKABLE void getPrinterPPD(const QString &printerName);
-
-    /**
-     * Get the CUPS server settings
-     * @param userValues the new server settings
-     */
-    Q_INVOKABLE void setServerSettings(const KCupsServer &server);
-
-    // ---- Printer Methods
-    /**
-     * Add or Modify a Printer
-     * @param printerName The printer to apply the change
-     * @param attributes The new attributes of the printer
-     * @param filename The file name in case of changing the PPD
-     */
-    void addOrModifyPrinter(const QString &printerName,
-                            const QVariantHash &attributes,
-                            const QString &filename = QString());
-
-    /**
-     * Add or Modify a Class
-     * @param className The class to apply the change
-     * @param attributes The new attributes of the printer
-     */
-    void addOrModifyClass(const QString &className,
-                          const QVariantHash &attributes);
-
-    /**
-     * Set if a given printer should be shared among other cups
-     * @param printer The printer to apply the change
-     * @param isClass True it is a printer class
-     * @param shared True if it should be shared
-     */
-    void setShared(const QString &printerName, bool isClass, bool shared);
-
-    /**
-     * Set if a given printer should be the default one among others
-     * @param printer The printer to apply the change
-     */
-    void setDefaultPrinter(const QString &printerName);
-
-    /**
-     * Pause the given printer from receiving jobs
-     * @param printer The printer to apply the change
-     */
-    void pausePrinter(const QString &printerName);
-
-    /**
-     * Resume the given printer from receiving jobs
-     * @param printer The printer to apply the change
-     */
-    void resumePrinter(const QString &printerName);
-
-    /**
-     * Allows the given printer from receiving jobs
-     * @param printer The printer to apply the change
-     */
-    void acceptJobs(const QString &printerName);
-
-    /**
-     * Prevents the given printer from receiving jobs
-     * @param printer The printer to apply the change
-     */
-    void rejectJobs(const QString &printerName);
-
-    /**
-     * Delete the given printer, if it's not local it's not
-     * possible to delete it
-     * @param printer The printer to apply the change
-     */
-    void deletePrinter(const QString &printerName);
-
-    /**
-     * Print a test page
-     * @param printerName The printer where the test should be done
-     * @param isClass True it is a printer class
-     */
-    void printTestPage(const QString &printerName, bool isClass);
-
-    /**
-     * Print a command test
-     * @param printerName The printer where the test should be done
-     * @param command The command to print
-     * @param title The title of the command
-     */
-    Q_INVOKABLE void printCommand(const QString &printerName, const QString &command, const QString &title);
-
-    // Jobs methods
-    /**
-     * Cancels tries to cancel a given job
-     * @param printerName the destination name (printer)
-     * @param jobId the job identification
-     */
-    void cancelJob(const QString &printerName, int jobId);
-
-    /**
-     * Holds the printing of a given job
-     * @param printerName the destination name (printer)
-     * @param jobId the job identification
-     */
-    void holdJob(const QString &printerName, int jobId);
-
-    /**
-     * Holds the printing of a given job
-     * @param printerName the destination name (printer)
-     * @param jobId the job identification
-     */
-    void releaseJob(const QString &printerName, int jobId);
-
-    /**
-     * Restart the printing of a given job
-     * @param printerName the destination name (printer)
-     * @param jobId the job identification
-     */
-    void restartJob(const QString &printerName, int jobId);
-
-    /**
-     * Holds the printing of a given job
-     * @param fromDestName the destination name which holds the job
-     * @param jobId the job identification
-     * @param toDestName the destination to hold the job
-     */
-    void moveJob(const QString &fromPrinterName, int jobId, const QString &toPrinterName);
-
-signals:
-    void device(const QString &device_class,
-                const QString &device_id,
-                const QString &device_info,
-                const QString &device_make_and_model,
-                const QString &device_uri,
-                const QString &device_location);
-
-    void finished();
-
-private:
-    void invokeMethod(const char *method,
-                      const QVariant &arg1 = QVariant(),
-                      const QVariant &arg2 = QVariant(),
-                      const QVariant &arg3 = QVariant(),
-                      const QVariant &arg4 = QVariant(),
-                      const QVariant &arg5 = QVariant(),
-                      const QVariant &arg6 = QVariant(),
-                      const QVariant &arg7 = QVariant(),
-                      const QVariant &arg8 = QVariant());
-    Q_INVOKABLE void process(const KIppRequest &request);
-    void setError(http_status_t httpStatus, ipp_status_t error, const QString &errorMsg);
-    void setFinished(bool delayed = false);
-
-    KCupsConnection *m_connection;
-    QEventLoop m_loop;
-    bool m_finished;
-    ipp_status_t m_error;
-    http_status_t m_httpStatus;
-    QString m_errorMsg;
-    ReturnArguments m_ppds;
-    KCupsServer m_server;
-    QString m_ppdFile;
-    KCupsPrinters m_printers;
-    KCupsJobs m_jobs;
-};
-
-#endif // KCUPS_REQUEST_H
diff --git a/print-manager/libkcups/KCupsServer.cpp b/print-manager/libkcups/KCupsServer.cpp
deleted file mode 100644 (file)
index d5a81c5..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KCupsServer.h"
-
-#include <cups/adminutil.h>
-#include <cups/cups.h>
-
-#include <config.h>
-
-KCupsServer::KCupsServer()
-{
-}
-
-KCupsServer::KCupsServer(const QVariantHash &arguments)
-{
-    m_arguments = arguments;
-}
-
-bool KCupsServer::allowRemoteAdmin() const
-{
-    return m_arguments.value(CUPS_SERVER_REMOTE_ADMIN).toBool();
-}
-
-void KCupsServer::setAllowRemoteAdmin(bool allow)
-{
-    m_arguments[CUPS_SERVER_REMOTE_ADMIN] = allow ? QLatin1String("1") : QLatin1String("0");
-}
-
-bool KCupsServer::allowUserCancelAnyJobs() const
-{
-    return m_arguments.value(CUPS_SERVER_USER_CANCEL_ANY).toBool();
-}
-
-void KCupsServer::setAllowUserCancelAnyJobs(bool allow)
-{
-    m_arguments[CUPS_SERVER_USER_CANCEL_ANY] = allow ? QLatin1String("1") : QLatin1String("0");
-}
-
-bool KCupsServer::showSharedPrinters() const
-{
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    return m_arguments.value(CUPS_SERVER_REMOTE_PRINTERS).toBool();
-#else
-    return false;
-#endif
-}
-
-void KCupsServer::setShowSharedPrinters(bool show)
-{
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    m_arguments[CUPS_SERVER_REMOTE_PRINTERS] = show ? QLatin1String("1") : QLatin1String("0");
-#else
-    Q_UNUSED(show)
-#endif // CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-}
-
-bool KCupsServer::sharePrinters() const
-{
-    return m_arguments.value(CUPS_SERVER_SHARE_PRINTERS).toBool();
-}
-
-void KCupsServer::setSharePrinters(bool share)
-{
-    m_arguments[CUPS_SERVER_SHARE_PRINTERS] = share ? QLatin1String("1") : QLatin1String("0");
-}
-
-bool KCupsServer::allowPrintingFromInternet() const
-{
-    return m_arguments.value(CUPS_SERVER_REMOTE_ANY).toBool();
-}
-
-void KCupsServer::setAllowPrintingFromInternet(bool allow)
-{
-    m_arguments[CUPS_SERVER_REMOTE_ANY] = allow ? QLatin1String("1") : QLatin1String("0");
-}
-
-QVariantHash KCupsServer::arguments() const
-{
-    return m_arguments;
-}
diff --git a/print-manager/libkcups/KCupsServer.h b/print-manager/libkcups/KCupsServer.h
deleted file mode 100644 (file)
index 0c0c330..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KCUPSSERVER_H
-#define KCUPSSERVER_H
-
-#include <QString>
-#include <KCupsConnection.h>
-
-class KDE_EXPORT KCupsServer
-{
-public:
-    KCupsServer();
-
-    bool allowRemoteAdmin() const;
-    void setAllowRemoteAdmin(bool allow);
-
-    bool allowUserCancelAnyJobs() const;
-    void setAllowUserCancelAnyJobs(bool allow);
-
-    bool showSharedPrinters() const;
-    void setShowSharedPrinters(bool show);
-
-    bool sharePrinters() const;
-    void setSharePrinters(bool share);
-
-    bool allowPrintingFromInternet() const;
-    void setAllowPrintingFromInternet(bool allow);
-
-    QVariantHash arguments() const;
-
-protected:
-    KCupsServer(const QVariantHash &arguments);
-
-private:
-    friend class KCupsRequest;
-
-    QVariantHash m_arguments;
-};
-
-Q_DECLARE_METATYPE(KCupsServer)
-
-#endif // KCUPSSERVER_H
diff --git a/print-manager/libkcups/KIppRequest.cpp b/print-manager/libkcups/KIppRequest.cpp
deleted file mode 100644 (file)
index 9b28b06..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2013 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "KIppRequest.h"
-#include "KIppRequest_p.h"
-
-#include <KDebug>
-
-KIppRequest::KIppRequest() :
-    d_ptr(new KIppRequestPrivate)
-{
-}
-
-KIppRequest::KIppRequest(const KIppRequest &other) :
-    d_ptr(new KIppRequestPrivate)
-{
-    *this = other;
-}
-
-KIppRequest::KIppRequest(ipp_op_t operation, const char *resource, const QString &filename) :
-    d_ptr(new KIppRequestPrivate)
-{
-    Q_D(KIppRequest);
-
-    d->operation = operation;
-    d->resource = resource;
-    d->filename = filename;
-
-    // send our user name on the request too
-    addString(IPP_TAG_OPERATION, IPP_TAG_NAME, KCUPS_REQUESTING_USER_NAME, cupsUser());
-}
-
-KIppRequest::~KIppRequest()
-{
-    Q_D(KIppRequest);
-    delete d;
-}
-
-ipp_op_t KIppRequest::operation() const
-{
-    Q_D(const KIppRequest);
-    return d->operation;
-}
-
-QString KIppRequest::resource() const
-{
-    Q_D(const KIppRequest);
-    return d->resource;
-}
-
-QString KIppRequest::filename() const
-{
-    Q_D(const KIppRequest);
-    return d->filename;
-}
-
-ipp_t *KIppRequest::sendIppRequest() const
-{
-    Q_D(const KIppRequest);
-
-    ipp_t *request = ippNewRequest(d->operation);
-
-    d->addRawRequestsToIpp(request);
-
-    if (d->filename.isNull()) {
-        return cupsDoRequest(CUPS_HTTP_DEFAULT, request, d->resource.toUtf8());
-    } else {
-        return cupsDoFileRequest(CUPS_HTTP_DEFAULT, request, d->resource.toUtf8(), d->filename.toUtf8());
-    }
-}
-
-void KIppRequest::addString(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QString &value)
-{
-    Q_D(KIppRequest);
-
-    d->addRequest(group, valueTag, name.toUtf8(), value);
-}
-
-void KIppRequest::addStringList(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QStringList &value)
-{
-    Q_D(KIppRequest);
-
-    d->addRequest(group, valueTag, name.toUtf8(), value);
-}
-
-void KIppRequest::addInteger(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, int value)
-{
-    Q_D(KIppRequest);
-
-    d->addRequest(group, valueTag, name.toUtf8(), value);
-}
-
-void KIppRequest::addBoolean(ipp_tag_t group, const QString &name, bool value)
-{
-    Q_D(KIppRequest);
-
-    d->addRequest(group, IPP_TAG_ZERO, name.toUtf8(), value);
-}
-
-void KIppRequest::addVariantValues(const QVariantHash &values)
-{
-    QVariantHash::ConstIterator i = values.constBegin();
-    while (i != values.constEnd()) {
-        QString key = i.key();
-        QVariant value = i.value();
-        switch (value.type()) {
-        case QVariant::Bool:
-            // Still in use at add-printer/PageAddPrinter.cpp
-            if (key == QLatin1String(KCUPS_PRINTER_IS_ACCEPTING_JOBS)) {
-                addBoolean(IPP_TAG_PRINTER, key, value.toBool());
-            } else {
-                addBoolean(IPP_TAG_OPERATION, key, value.toBool());
-            }
-            break;
-        case QVariant::Int:
-            // Still in use at add-printer/PageAddPrinter.cpp
-            if (key == QLatin1String(KCUPS_PRINTER_STATE)) {
-                addInteger(IPP_TAG_PRINTER, IPP_TAG_ENUM, key, value.toInt());
-            } else {
-                addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, key, value.toInt());
-            }
-            break;
-        case QVariant::String:
-            // Still in use at add-printer/*
-            if (key == QLatin1String(KCUPS_DEVICE_URI)) {
-                // device uri has a different TAG
-                addString(IPP_TAG_PRINTER, IPP_TAG_URI, key, value.toString());
-            } else if (key == QLatin1String(KCUPS_PRINTER_OP_POLICY) ||
-                       key == QLatin1String(KCUPS_PRINTER_ERROR_POLICY) ||
-                       key == QLatin1String("ppd-name")) {
-                // printer-op-policy has a different TAG
-                addString(IPP_TAG_PRINTER, IPP_TAG_NAME, key, value.toString());
-            } else if (key == QLatin1String(KCUPS_JOB_NAME)) {
-                addString(IPP_TAG_OPERATION, IPP_TAG_NAME, key, value.toString());
-            } else if (key == QLatin1String(KCUPS_WHICH_JOBS)) {
-                addString(IPP_TAG_OPERATION, IPP_TAG_KEYWORD, key, value.toString());
-            } else {
-                addString(IPP_TAG_PRINTER, IPP_TAG_TEXT, key, value.toString());
-            }
-            break;
-        case QVariant::StringList:
-            if (key == QLatin1String(KCUPS_MEMBER_URIS)) {
-                addStringList(IPP_TAG_PRINTER, IPP_TAG_URI, key, value.toStringList());
-            } else {
-                addStringList(IPP_TAG_PRINTER, IPP_TAG_NAME, key, value.toStringList());
-            }
-            break;
-        case QVariant::UInt:
-            addInteger(IPP_TAG_OPERATION, IPP_TAG_ENUM, key, value.toInt());
-            break;
-        default:
-            kWarning() << "type NOT recognized! This will be ignored:" << key << "values" << i.value();
-        }
-        ++i;
-    }
-}
-
-void KIppRequest::addPrinterUri(const QString &printerName, bool isClass)
-{
-    QString uri = assembleUrif(printerName, isClass);
-    addString(IPP_TAG_OPERATION, IPP_TAG_URI, KCUPS_PRINTER_URI, uri);
-}
-
-QString KIppRequest::assembleUrif(const QString &name, bool isClass)
-{
-    char  uri[HTTP_MAX_URI]; // printer URI
-
-    QByteArray resourcef;
-    if (isClass) {
-        resourcef = "/classes/%s";
-    } else {
-        resourcef = "/printers/%s";
-    }
-    const QByteArray destination = name.toUtf8();
-
-    httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", cupsUser(), "localhost",
-                     ippPort(), resourcef.constData(), destination.constData());
-    return uri;
-}
-
-KIppRequest &KIppRequest::operator =(const KIppRequest &other)
-{
-    Q_D(KIppRequest);
-    if (this == &other)
-        return *this;
-
-    *d = *other.d_ptr;
-
-    return *this;
-}
-
-void KIppRequestPrivate::addRequest(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QVariant &value)
-{
-    KCupsRawRequest request;
-    request.group = group;
-    request.valueTag = valueTag;
-    request.name = name;
-    request.value = value;
-
-    rawRequests << request;
-}
-
-void KIppRequestPrivate::addRawRequestsToIpp(ipp_t *ipp) const
-{
-    // sort the values as CUPS requires it
-    qSort(rawRequests.begin(), rawRequests.end(), rawRequestGroupLessThan);
-
-    foreach (const KCupsRawRequest &request, rawRequests) {
-        switch (request.value.type()) {
-        case QVariant::Bool:
-            ippAddBoolean(ipp,
-                          request.group,
-                          request.name.toUtf8(),
-                          request.value.toBool());
-            break;
-        case QVariant::Int:
-        case QVariant::UInt:
-            ippAddInteger(ipp,
-                          request.group,
-                          request.valueTag,
-                          request.name.toUtf8(),
-                          request.value.toInt());
-            break;
-        case QVariant::String:
-            ippAddString(ipp,
-                         request.group,
-                         request.valueTag,
-                         request.name.toUtf8(),
-                         "utf-8",
-                         request.value.toString().toUtf8());
-            break;
-        case QVariant::StringList:
-        {
-            QStringList list = request.value.toStringList();
-            QList<QByteArray> valuesQByteArrayList;
-            const char **values = qStringListToCharPtrPtr(list, valuesQByteArrayList);
-
-            ippAddStrings(ipp,
-                          request.group,
-                          request.valueTag,
-                          request.name.toUtf8(),
-                          list.size(),
-                          "utf-8",
-                          values);
-
-            // ippAddStrings deep copies everything so we can throw away the values.
-            // the QBAList and content is auto discarded when going out of scope.
-            delete [] values;
-            break;
-        }
-        default:
-            kWarning() << "type NOT recognized! This will be ignored:" << request.name << "values" << request.value;
-        }
-    }
-}
diff --git a/print-manager/libkcups/KIppRequest.h b/print-manager/libkcups/KIppRequest.h
deleted file mode 100644 (file)
index c5c4c27..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2013 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KIPPREQUEST_H
-#define KIPPREQUEST_H
-
-#include <KCupsConnection.h>
-
-class KIppRequestPrivate;
-class KDE_EXPORT KIppRequest
-{
-    Q_DECLARE_PRIVATE(KIppRequest)
-public:
-    KIppRequest();
-    KIppRequest(const KIppRequest &other);
-    KIppRequest(ipp_op_t operation, const char *resource, const QString &filename = QString());
-    ~KIppRequest();
-
-    ipp_op_t operation() const;
-    QString resource() const;
-    QString filename() const;
-
-    ipp_t *sendIppRequest() const;
-
-    void addString(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QString &value);
-    void addStringList(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QStringList &value);
-    void addInteger(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, int value);
-    void addBoolean(ipp_tag_t group, const QString &name, bool value);
-    void addVariantValues(const QVariantHash &values);
-    void addPrinterUri(const QString &printerName, bool isClass = false);
-
-    static QString assembleUrif(const QString &name, bool isClass);
-
-    /**
-     * Makes a copy of the KIppRequest object other.
-     */
-    KIppRequest &operator=(const KIppRequest &other);
-
-
-private:
-    KIppRequestPrivate *d_ptr;
-};
-
-Q_DECLARE_METATYPE(KIppRequest)
-
-#endif // KIPPREQUEST_H
diff --git a/print-manager/libkcups/KIppRequest_p.h b/print-manager/libkcups/KIppRequest_p.h
deleted file mode 100644 (file)
index 0ba191c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2013 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef KIPPREQUEST_P_H
-#define KIPPREQUEST_P_H
-
-#include <KCupsConnection.h>
-
-class KCupsRawRequest
-{
-public:
-    ipp_tag_t group;
-    ipp_tag_t valueTag;
-    QString name;
-    QVariant value;
-};
-
-class KIppRequestPrivate
-{
-public:
-    void addRequest(ipp_tag_t group, ipp_tag_t valueTag, const QString &name, const QVariant &value);
-    void addRawRequestsToIpp(ipp_t *ipp) const;
-
-    ipp_op_t operation;
-    QString resource;
-    QString filename;
-    mutable QList<KCupsRawRequest> rawRequests;
-};
-
-static const char **qStringListToCharPtrPtr(const QStringList &list, QList<QByteArray> &qbaList)
-{
-    const char **ptr = new const char *[list.size() + 1];
-    qbaList.reserve(qbaList.size() + list.size());
-    QByteArray qba;
-    for (int i = 0; i < list.size(); ++i) {
-        qba = list.at(i).toUtf8();
-        qbaList.append(qba);
-        ptr[i] = qba.constData();
-    }
-    ptr[list.size()] = 0;
-    return ptr;
-}
-
-bool rawRequestGroupLessThan(const KCupsRawRequest &a, const KCupsRawRequest &b)
-{
-     return a.group < b.group;
-}
-
-#endif // KIPPREQUEST_P_H
diff --git a/print-manager/libkcups/NoSelectionRectDelegate.cpp b/print-manager/libkcups/NoSelectionRectDelegate.cpp
deleted file mode 100644 (file)
index b6e8289..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Daniel Nicoletti <dantti12@gmail.com>           *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "NoSelectionRectDelegate.h"
-
-NoSelectionRectDelegate::NoSelectionRectDelegate(QObject *parent) :
-    QStyledItemDelegate(parent)
-{
-}
-
-void NoSelectionRectDelegate::paint(QPainter *painter,
-                                    const QStyleOptionViewItem &option,
-                                    const QModelIndex &index) const
-{
-    // For some reason some styles don't honor the views SelectionRectVisible
-    // and I just hate that selection rect thing...
-    QStyleOptionViewItemV4 opt(option);
-    if (opt.state & QStyle::State_HasFocus) {
-        opt.state ^= QStyle::State_HasFocus;
-    }
-    QStyledItemDelegate::paint(painter, opt, index);
-}
diff --git a/print-manager/libkcups/NoSelectionRectDelegate.h b/print-manager/libkcups/NoSelectionRectDelegate.h
deleted file mode 100644 (file)
index cc319b1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Daniel Nicoletti <dantti12@gmail.com>           *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef NOSELECTIONRECTDELEGATEEGATE_H
-#define NOSELECTIONRECTDELEGATEEGATE_H
-
-#include <QStyledItemDelegate>
-
-#include <kdemacros.h>
-
-class KDE_EXPORT NoSelectionRectDelegate : public QStyledItemDelegate
-{
-    Q_OBJECT
-public:
-    explicit NoSelectionRectDelegate(QObject *parent = 0);
-    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-};
-
-#endif // NOSELECTIONRECTDELEGATEEGATE_H
diff --git a/print-manager/libkcups/PPDModel.cpp b/print-manager/libkcups/PPDModel.cpp
deleted file mode 100644 (file)
index 0383b8b..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PPDModel.h"
-
-#include <KLocale>
-#include <KDebug>
-
-PPDModel::PPDModel(QObject *parent) :
-    QStandardItemModel(parent)
-{
-}
-
-void PPDModel::setPPDs(const QList<QVariantHash> &ppds, const DriverMatchList &driverMatch)
-{
-    clear();
-
-    QStandardItem *recommended = 0;
-    foreach (const DriverMatch &driver, driverMatch) {
-        // Find the matched PPD on the PPDs list
-        foreach (const QVariantHash &ppd, ppds) {
-            if (ppd["ppd-name"].toString() == driver.ppd) {
-                // Create the PPD
-                QStandardItem *ppdItem = createPPDItem(ppd, true);
-
-                if (recommended == 0) {
-                    recommended = new QStandardItem;
-                    recommended->setText(i18n("Recommended Drivers"));
-                    appendRow(recommended);
-                }
-                recommended->appendRow(ppdItem);
-
-                break;
-            }
-        }
-    }
-
-    foreach (const QVariantHash &ppd, ppds) {
-        // Find or create the PPD parent (printer Make)
-        QStandardItem *makeItem = findCreateMake(ppd["ppd-make"].toString());
-
-        // Create the PPD
-        QStandardItem *ppdItem = createPPDItem(ppd, false);
-        makeItem->appendRow(ppdItem);
-    }
-}
-
-QStandardItem* PPDModel::findCreateMake(const QString &make)
-{
-    for (int i = 0; i < rowCount(); ++i) {
-        QStandardItem *makeItem = item(i);
-        if (makeItem->text() == make) {
-            return makeItem;
-        }
-    }
-
-    QStandardItem *makeItem = new QStandardItem(make);
-    appendRow(makeItem);
-    return makeItem;
-}
-
-Qt::ItemFlags PPDModel::flags(const QModelIndex &index) const
-{
-    Q_UNUSED(index)
-    return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
-}
-
-void PPDModel::clear()
-{
-    // Remove all rows from the model
-    removeRows(0, rowCount());
-}
-
-QStandardItem *PPDModel::createPPDItem(const QVariantHash &ppd, bool recommended)
-{
-    QStandardItem *ret = new QStandardItem;
-
-    QString make = ppd["ppd-make"].toString();
-    QString makeAndModel = ppd["ppd-make-and-model"].toString();
-    QString naturalLanguage = ppd["ppd-natural-language"].toString();
-    QString ppdName = ppd["ppd-name"].toString();
-
-    // Set this data before we change the makeAndModel
-    ret->setData(ppdName, PPDName);
-    ret->setData(make, PPDMake);
-    ret->setData(makeAndModel, PPDMakeAndModel);
-
-    QString text;
-    if (recommended) {
-        text = makeAndModel +
-                QLatin1String(" (") +
-                naturalLanguage +
-                QLatin1Char(')');
-    } else {
-        // Removes the Make part of the string
-        if (makeAndModel.startsWith(make)) {
-            makeAndModel.remove(0, make.size() + 1);
-        }
-
-        // Create the PPD
-        text = makeAndModel.trimmed() +
-                QLatin1String(" (") +
-                naturalLanguage +
-                QLatin1Char(')');
-    }
-    ret->setText(text);
-
-    return ret;
-}
diff --git a/print-manager/libkcups/PPDModel.h b/print-manager/libkcups/PPDModel.h
deleted file mode 100644 (file)
index 0317981..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PPD_MODEL_H
-#define PPD_MODEL_H
-
-#include <QStandardItemModel>
-#include <QtCore/qvariant.h>
-
-struct DriverMatch{
-    QString ppd;
-    QString match;
-};
-typedef QList<DriverMatch> DriverMatchList;
-class PPDModel : public QStandardItemModel
-{
-    Q_OBJECT
-    Q_ENUMS(Role)
-public:
-    typedef enum {
-        PPDName = Qt::UserRole,
-        PPDMake,
-        PPDMakeAndModel
-    } Role;
-
-    explicit PPDModel(QObject *parent = 0);
-    void setPPDs(const QList<QVariantHash> &ppds, const DriverMatchList &driverMatch = DriverMatchList());
-
-    Qt::ItemFlags flags(const QModelIndex &index) const;
-
-    void clear();
-
-private:
-    QStandardItem* createPPDItem(const QVariantHash &ppd, bool recommended);
-    QStandardItem* findCreateMake(const QString &make);
-
-    QList<QVariantHash> m_ppds;
-};
-
-Q_DECLARE_METATYPE(DriverMatchList)
-Q_DECLARE_METATYPE(DriverMatch)
-
-#endif
diff --git a/print-manager/libkcups/PrinterModel.cpp b/print-manager/libkcups/PrinterModel.cpp
deleted file mode 100644 (file)
index 201e13d..0000000
+++ /dev/null
@@ -1,553 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrinterModel.h"
-
-#include <QDateTime>
-#include <QMimeData>
-#include <QDBusConnection>
-#include <QtDBus/QDBusInterface>
-#include <QPointer>
-
-#include <KUser>
-#include <KDebug>
-#include <KLocale>
-#include <KMessageBox>
-
-#include <KCupsRequest.h>
-
-#include <cups/cups.h>
-
-PrinterModel::PrinterModel(QObject *parent) :
-    QStandardItemModel(parent),
-    m_unavailable(true)
-{
-    m_attributes << KCUPS_PRINTER_NAME;
-    m_attributes << KCUPS_PRINTER_STATE;
-    m_attributes << KCUPS_PRINTER_STATE_MESSAGE;
-    m_attributes << KCUPS_PRINTER_IS_SHARED;
-    m_attributes << KCUPS_PRINTER_IS_ACCEPTING_JOBS;
-    m_attributes << KCUPS_PRINTER_TYPE;
-    m_attributes << KCUPS_PRINTER_LOCATION;
-    m_attributes << KCUPS_PRINTER_INFO;
-    m_attributes << KCUPS_PRINTER_MAKE_AND_MODEL;
-    m_attributes << KCUPS_PRINTER_COMMANDS;
-    m_attributes << KCUPS_MARKER_CHANGE_TIME;
-    m_attributes << KCUPS_MARKER_COLORS;
-    m_attributes << KCUPS_MARKER_LEVELS;
-    m_attributes << KCUPS_MARKER_NAMES;
-    m_attributes << KCUPS_MARKER_TYPES;
-
-    QHash<int, QByteArray> roles = roleNames();
-    roles[DestStatus] = "stateMessage";
-    roles[DestName] = "printerName";
-    roles[DestState] = "printerState";
-    roles[DestIsDefault] = "isDefault";
-    roles[DestIsShared] = "isShared";
-    roles[DestIsAcceptingJobs] = "isAcceptingJobs";
-    roles[DestIsPaused] = "isPaused";
-    roles[DestIsClass] = "isClass";
-    roles[DestLocation] = "location";
-    roles[DestDescription] = "info";
-    roles[DestKind] = "kind";
-    roles[DestType] = "type";
-    roles[DestCommands] = "commands";
-    roles[DestMarkerChangeTime] = "markerChangeTime";
-    roles[DestMarkers] = "markers";
-    roles[DestIconName] = "iconName";
-    roles[DestRemote] = "remote";
-    setRoleNames(roles);
-
-    // This is emitted when a printer is added
-    connect(KCupsConnection::global(),
-            SIGNAL(printerAdded(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is modified
-    connect(KCupsConnection::global(),
-            SIGNAL(printerModified(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer has it's state changed
-    connect(KCupsConnection::global(),
-            SIGNAL(printerStateChanged(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is stopped
-    connect(KCupsConnection::global(),
-            SIGNAL(printerStopped(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is restarted
-    connect(KCupsConnection::global(),
-            SIGNAL(printerRestarted(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is shutdown
-    connect(KCupsConnection::global(),
-            SIGNAL(printerShutdown(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(insertUpdatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is removed
-    connect(KCupsConnection::global(),
-            SIGNAL(printerDeleted(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(printerRemoved(QString,QString,QString,uint,QString,bool)));
-
-    connect(KCupsConnection::global(), SIGNAL(serverAudit(QString)),
-            SLOT(serverChanged(QString)));
-    connect(KCupsConnection::global(), SIGNAL(serverStarted(QString)),
-            SLOT(serverChanged(QString)));
-    connect(KCupsConnection::global(), SIGNAL(serverStopped(QString)),
-            SLOT(serverChanged(QString)));
-    connect(KCupsConnection::global(), SIGNAL(serverRestarted(QString)),
-            SLOT(serverChanged(QString)));
-
-    // Deprecated stuff that works better than the above
-    connect(KCupsConnection::global(), SIGNAL(rhPrinterAdded(QString)),
-            this, SLOT(insertUpdatePrinter(QString)));
-
-    connect(KCupsConnection::global(), SIGNAL(rhPrinterRemoved(QString)),
-            this, SLOT(printerRemoved(QString)));
-
-    connect(KCupsConnection::global(), SIGNAL(rhQueueChanged(QString)),
-            this, SLOT(insertUpdatePrinter(QString)));
-
-    connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
-            this, SLOT(slotCountChanged()));
-    connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
-            this, SLOT(slotCountChanged()));
-    connect(this, SIGNAL(modelReset()),
-            this, SLOT(slotCountChanged()));
-
-    update();
-}
-
-void PrinterModel::getDestsFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest *>(sender());
-    // When there is no printer IPP_NOT_FOUND is returned
-    if (request->hasError() && request->error() != IPP_NOT_FOUND) {
-        // clear the model after so that the proper widget can be shown
-        clear();
-
-        emit error(request->error(), request->serverError(), request->errorMsg());
-        if (request->error() == IPP_SERVICE_UNAVAILABLE && !m_unavailable) {
-            m_unavailable = true;
-            emit serverUnavailableChanged(m_unavailable);
-        }
-    } else {
-        if (m_unavailable) {
-            m_unavailable = false;
-            emit serverUnavailableChanged(m_unavailable);
-        }
-
-        KCupsPrinters printers = request->printers();
-        for (int i = 0; i < printers.size(); ++i) {
-            // If there is a printer and it's not the current one add it
-            // as a new destination
-            int dest_row = destRow(printers.at(i).name());
-            if (dest_row == -1) {
-                // not found, insert new one
-                insertDest(i, printers.at(i));
-            } else if (dest_row == i) {
-                // update the printer
-                updateDest(item(i), printers.at(i));
-            } else {
-                // found at wrong position
-                // take it and insert on the right position
-                QList<QStandardItem *> row = takeRow(dest_row);
-                insertRow(i, row);
-                updateDest(item(i), printers.at(i));
-            }
-        }
-
-        // remove old printers
-        // The above code starts from 0 and make sure
-        // dest == modelIndex(x) and if it's not the
-        // case it either inserts or moves it.
-        // so any item > num_jobs can be safely deleted
-        while (rowCount() > printers.size()) {
-            removeRow(rowCount() - 1);
-        }
-
-        emit error(IPP_OK, QString(), QString());
-    }
-    request->deleteLater();
-}
-
-void PrinterModel::slotCountChanged()
-{
-    emit countChanged(rowCount());
-}
-
-QVariant PrinterModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-    if (section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole) {
-        return i18n("Printers");
-    }
-    return QVariant();
-}
-
-int PrinterModel::count() const
-{
-    return rowCount();
-}
-
-bool PrinterModel::serverUnavailable() const
-{
-    return m_unavailable;
-}
-
-void PrinterModel::pausePrinter(const QString &printerName)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->pausePrinter(printerName);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrinterModel::resumePrinter(const QString &printerName)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->resumePrinter(printerName);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrinterModel::rejectJobs(const QString &printerName)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->rejectJobs(printerName);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrinterModel::acceptJobs(const QString &printerName)
-{
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->acceptJobs(printerName);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrinterModel::update()
-{
-//                 kcmshell(6331) PrinterModel::update: (QHash(("printer-type", QVariant(int, 75534348) ) ( "marker-names" ,  QVariant(QStringList, ("Cyan", "Yellow", "Magenta", "Black") ) ) ( "printer-name" ,  QVariant(QString, "EPSON_Stylus_TX105") ) ( "marker-colors" ,  QVariant(QStringList, ("#00ffff", "#ffff00", "#ff00ff", "#000000") ) ) ( "printer-location" ,  QVariant(QString, "Luiz Vitor’s MacBook Pro") ) ( "marker-levels" ,  QVariant(QList<int>, ) ) ( "marker-types" ,  QVariant(QStringList, ("inkCartridge", "inkCartridge", "inkCartridge", "inkCartridge") ) ) ( "printer-is-shared" ,  QVariant(bool, true) ) ( "printer-state-message" ,  QVariant(QString, "") ) ( "printer-commands" ,  QVariant(QStringList, ("Clean", "PrintSelfTestPage", "ReportLevels") ) ) ( "marker-change-time" ,  QVariant(int, 1267903160) ) ( "printer-state" ,  QVariant(int, 3) ) ( "printer-info" ,  QVariant(QString, "EPSON Stylus TX105") ) ( "printer-make-and-model" ,  QVariant(QString, "EPSON TX105 Series") ) )  )
-    // Get destinations with these attributes
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(getDestsFinished()));
-    request->getPrinters(m_attributes);
-}
-
-void PrinterModel::insertDest(int pos, const KCupsPrinter &printer)
-{
-    // Create the printer item
-    QStandardItem *stdItem = new QStandardItem(printer.name());
-    stdItem->setData(printer.name(), DestName);
-    stdItem->setIcon(printer.icon());
-    // update the item
-    updateDest(stdItem, printer);
-
-    // insert the printer Item
-    insertRow(pos, stdItem);
-}
-
-void PrinterModel::updateDest(QStandardItem *destItem, const KCupsPrinter &printer)
-{
-    // store if the printer is the network default
-    bool isDefault = printer.isDefault();
-    if (isDefault != destItem->data(DestIsDefault).toBool()) {
-        destItem->setData(isDefault, DestIsDefault);
-    }
-
-    // store the printer state
-    KCupsPrinter::Status state = printer.state();
-    if (state != qvariant_cast<KCupsPrinter::Status>(destItem->data(DestState))) {
-        destItem->setData(state, DestState);
-    }
-    kDebug() << state << printer.name();
-
-    // store if the printer is accepting jobs
-    bool accepting = printer.isAcceptingJobs();
-    if (accepting != destItem->data(DestIsAcceptingJobs).toBool()) {
-        destItem->setData(accepting, DestIsAcceptingJobs);
-    }
-
-    // store the printer status message
-    QString status = destStatus(state, printer.stateMsg(), accepting);
-    if (status != destItem->data(DestStatus).toString()) {
-        destItem->setData(status, DestStatus);
-    }
-
-    bool paused = (state == KCupsPrinter::Stopped || !accepting);
-    if (paused != destItem->data(DestIsPaused).toBool()) {
-        destItem->setData(paused, DestIsPaused);
-    }
-
-    // store if the printer is shared
-    bool shared = printer.isShared();
-    if (shared != destItem->data(DestIsShared).toBool()) {
-        destItem->setData(shared, DestIsShared);
-    }
-
-    // store if the printer is a class
-    // the printer-type param is a flag
-    bool isClass = printer.isClass();
-    if (isClass != destItem->data(DestIsClass).toBool()) {
-        destItem->setData(isClass, DestIsClass);
-    }
-
-    // store if the printer type
-    // the printer-type param is a flag
-    uint printerType = printer.type();
-    if (printerType != destItem->data(DestType).toUInt()) {
-        destItem->setData(printerType, DestType);
-        destItem->setData(printerType & CUPS_PRINTER_REMOTE, DestRemote);
-    }
-
-    // store the printer location
-    QString location = printer.location();
-    if (location != destItem->data(DestLocation).toString()) {
-        destItem->setData(location, DestLocation);
-    }
-
-    // store the printer icon name
-    QString iconName = printer.iconName();
-    if (iconName != destItem->data(DestIconName).toString()) {
-        destItem->setData(iconName, DestIconName);
-    }
-
-    if (destItem->data(DestName).toString() != destItem->text()){
-        if (destItem->text() != destItem->data(DestName).toString()){
-            destItem->setText(destItem->data(DestName).toString());
-        }
-    }
-
-    // store the printer description
-    QString description = printer.info();
-    if (description != destItem->data(DestDescription).toString()){
-        destItem->setData(description, DestDescription);
-    }
-
-    // store the printer kind
-    QString kind = printer.makeAndModel();
-    if (kind != destItem->data(DestKind).toString()) {
-        destItem->setData(kind, DestKind);
-    }
-
-    // store the printer commands
-    QStringList commands = printer.commands();
-    if (commands != destItem->data(DestCommands).toStringList()) {
-        destItem->setData(commands, DestCommands);
-    }
-
-    int markerChangeTime = printer.markerChangeTime();
-    if (markerChangeTime != destItem->data(DestMarkerChangeTime).toInt()) {
-        destItem->setData(printer.markerChangeTime(), DestMarkerChangeTime);
-        QVariantHash markers;
-        markers["marker-change-time"] = printer.markerChangeTime();
-        markers["marker-colors"] = printer.argument("marker-colors");
-        markers["marker-levels"] = printer.argument("marker-levels");
-        markers["marker-names"] = printer.argument("marker-names");
-        markers["marker-types"] = printer.argument("marker-types");
-        destItem->setData(markers, DestMarkers);
-    }
-}
-
-int PrinterModel::destRow(const QString &destName)
-{
-    // find the position of the jobId inside the model
-    for (int i = 0; i < rowCount(); i++) {
-        if (destName == item(i)->data(DestName).toString())
-        {
-            return i;
-        }
-    }
-    // -1 if not found
-    return -1;
-}
-
-QString PrinterModel::destStatus(KCupsPrinter::Status state, const QString &message, bool isAcceptingJobs) const
-{
-    switch (state) {
-    case KCupsPrinter::Idle:
-        if (message.isEmpty()){
-            return isAcceptingJobs ? i18n("Idle") : i18n("Idle, rejecting jobs");
-        } else {
-            return isAcceptingJobs ? i18n("Idle - '%1'", message) : i18n("Idle, rejecting jobs - '%1'", message);
-        }
-    case KCupsPrinter::Printing:
-        if (message.isEmpty()){
-            return i18n("In use");
-        } else {
-            return i18n("In use - '%1'", message);
-        }
-    case KCupsPrinter::Stopped:
-        if (message.isEmpty()){
-            return isAcceptingJobs ? i18n("Paused") : i18n("Paused, rejecting jobs");
-        } else {
-            return isAcceptingJobs ? i18n("Paused - '%1'", message) : i18n("Paused, rejecting jobs - '%1'", message);
-        }
-    default :
-        if (message.isEmpty()){
-            return i18n("Unknown");
-        } else {
-            return i18n("Unknown - '%1'", message);
-        }
-    }
-}
-
-void PrinterModel::clear()
-{
-    removeRows(0, rowCount());
-}
-
-Qt::ItemFlags PrinterModel::flags(const QModelIndex &index) const
-{
-    Q_UNUSED(index)
-    return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
-}
-
-
-void PrinterModel::insertUpdatePrinter(const QString &printerName)
-{
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(insertUpdatePrinterFinished()));
-    // TODO how do we know if it's a class if this DBus signal
-    // does not tell us
-    request->getPrinterAttributes(printerName, false, m_attributes);
-}
-
-void PrinterModel::insertUpdatePrinter(const QString &text,
-                                       const QString &printerUri,
-                                       const QString &printerName,
-                                       uint printerState,
-                                       const QString &printerStateReasons,
-                                       bool printerIsAcceptingJobs)
-{
-    Q_UNUSED(text)
-    Q_UNUSED(printerUri)
-    Q_UNUSED(printerState)
-    Q_UNUSED(printerStateReasons)
-    Q_UNUSED(printerIsAcceptingJobs)
-
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-    insertUpdatePrinter(printerName);
-}
-
-void PrinterModel::insertUpdatePrinterFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest *>(sender());
-    if (!request->hasError()) {
-        foreach (const KCupsPrinter &printer, request->printers()) {
-            // If there is a printer and it's not the current one add it
-            // as a new destination
-            int dest_row = destRow(printer.name());
-            if (dest_row == -1) {
-                // not found, insert new one
-                insertDest(0, printer);
-            } else {
-                // update the printer
-                updateDest(item(dest_row), printer);
-            }
-        }
-    }
-    request->deleteLater();
-}
-
-void PrinterModel::printerRemoved(const QString &printerName)
-{
-    kDebug() << printerName;
-
-    // Look for the removed printer
-    int dest_row = destRow(printerName);
-    if (dest_row != -1) {
-        removeRows(dest_row, 1);
-    }
-}
-
-void PrinterModel::printerRemoved(const QString &text,
-                                  const QString &printerUri,
-                                  const QString &printerName,
-                                  uint printerState,
-                                  const QString &printerStateReasons,
-                                  bool printerIsAcceptingJobs)
-{
-    // REALLY? all these parameters just to say foo was deleted??
-    Q_UNUSED(text)
-    Q_UNUSED(printerUri)
-    Q_UNUSED(printerState)
-    Q_UNUSED(printerStateReasons)
-    Q_UNUSED(printerIsAcceptingJobs)
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-
-    // Look for the removed printer
-    int dest_row = destRow(printerName);
-    if (dest_row != -1) {
-        removeRows(dest_row, 1);
-    }
-}
-
-void PrinterModel::printerStateChanged(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-}
-void PrinterModel::printerStopped(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-}
-
-void PrinterModel::printerRestarted(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-}
-
-void PrinterModel::printerShutdown(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-}
-
-void PrinterModel::printerModified(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    kDebug() << text << printerUri << printerName << printerState << printerStateReasons << printerIsAcceptingJobs;
-}
-
-void PrinterModel::serverChanged(const QString &text)
-{
-    kDebug() << text;
-    update();
-}
-
-#include "moc_PrinterModel.cpp"
diff --git a/print-manager/libkcups/PrinterModel.h b/print-manager/libkcups/PrinterModel.h
deleted file mode 100644 (file)
index 62c9fad..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTER_MODEL_H
-#define PRINTER_MODEL_H
-
-#include <QStandardItemModel>
-#include <QTimer>
-
-#include <KCupsPrinter.h>
-
-class KDE_EXPORT PrinterModel : public QStandardItemModel
-{
-    Q_OBJECT
-    Q_ENUMS(JobAction)
-    Q_ENUMS(Role)
-    Q_PROPERTY(int count READ count NOTIFY countChanged)
-    Q_PROPERTY(bool serverUnavailable READ serverUnavailable NOTIFY serverUnavailableChanged)
-public:
-    enum Role {
-        DestStatus = Qt::UserRole,
-        DestState,
-        DestName,
-        DestIsDefault,
-        DestIsShared,
-        DestIsAcceptingJobs,
-        DestIsPaused,
-        DestIsClass,
-        DestLocation,
-        DestDescription,
-        DestKind,
-        DestType,
-        DestCommands,
-        DestMarkerChangeTime,
-        DestMarkers,
-        DestIconName,
-        DestRemote
-    };
-
-    enum JobAction {
-        Cancel,
-        Hold,
-        Release,
-        Move
-    };
-
-    explicit PrinterModel(QObject *parent = 0);
-
-    Qt::ItemFlags flags(const QModelIndex &index) const;
-    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
-    int count() const;
-    bool serverUnavailable() const;
-
-    Q_INVOKABLE void pausePrinter(const QString &printerName);
-    Q_INVOKABLE void resumePrinter(const QString &printerName);
-    Q_INVOKABLE void rejectJobs(const QString &printerName);
-    Q_INVOKABLE void acceptJobs(const QString &printerName);
-
-public slots:
-    void update();
-    void getDestsFinished();
-    void slotCountChanged();
-
-signals:
-    void countChanged(int count);
-    void serverUnavailableChanged(bool unavailable);
-    void error(int lastError, const QString &errorTitle, const QString &errorMsg);
-
-private slots:
-    void insertUpdatePrinter(const QString &printerName);
-    void insertUpdatePrinter(const QString &text,
-                             const QString &printerUri,
-                             const QString &printerName,
-                             uint printerState,
-                             const QString &printerStateReasons,
-                             bool printerIsAcceptingJobs);
-    void insertUpdatePrinterFinished();
-    void printerRemoved(const QString &printerName);
-    void printerRemoved(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void printerStateChanged(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void printerStopped(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void printerRestarted(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void printerShutdown(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void printerModified(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs);
-    void serverChanged(const QString &text);
-
-private:
-    WId m_parentId;
-    QStringList m_attributes;
-    bool m_unavailable;
-
-    int destRow(const QString &destName);
-    void insertDest(int pos, const KCupsPrinter &printer);
-    void updateDest(QStandardItem *item, const KCupsPrinter &printer);
-
-    QString destStatus(KCupsPrinter::Status state, const QString &message, bool isAcceptingJobs) const;
-    void clear();
-};
-
-#endif // PRINTER_MODEL_H
diff --git a/print-manager/libkcups/PrinterSortFilterModel.cpp b/print-manager/libkcups/PrinterSortFilterModel.cpp
deleted file mode 100644 (file)
index 7b97bed..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-#include "PrinterSortFilterModel.h"
-
-#include "PrinterModel.h"
-
-#include <KDebug>
-
-PrinterSortFilterModel::PrinterSortFilterModel(QObject *parent) :
-    QSortFilterProxyModel(parent)
-{
-    setDynamicSortFilter(true);
-    setSortCaseSensitivity(Qt::CaseInsensitive);
-    sort(0);
-
-    connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
-            this, SIGNAL(countChanged()));
-    connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
-            this, SIGNAL(countChanged()));
-    connect(this, SIGNAL(modelReset()),
-            this, SIGNAL(countChanged()));
-}
-
-void PrinterSortFilterModel::setModel(QAbstractItemModel *model)
-{
-    if (model == sourceModel()) {
-        return;
-    }
-
-    QSortFilterProxyModel::setSourceModel(model);
-    emit sourceModelChanged(model);
-}
-
-void PrinterSortFilterModel::setFilteredPrinters(const QString &printers)
-{
-    kDebug() << rowCount() << printers << printers.split(QLatin1Char('|'));
-    if (printers.isEmpty()) {
-        m_filteredPrinters.clear();
-    } else {
-        m_filteredPrinters = printers.split(QLatin1Char('|'));
-    }
-    invalidateFilter();
-    emit filteredPrintersChanged();
-}
-
-QString PrinterSortFilterModel::filteredPrinters() const
-{
-    return m_filteredPrinters.join(QLatin1String("|"));
-}
-
-int PrinterSortFilterModel::count() const
-{
-    return rowCount();
-}
-
-bool PrinterSortFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
-{
-    QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
-
-    // check if the printer is on the blacklist
-    if (!m_filteredPrinters.isEmpty()) {
-        return m_filteredPrinters.contains(index.data(PrinterModel::DestName).toString());
-    }
-
-    return true;
-}
-
-bool PrinterSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
-{
-    bool leftIsRemote = sourceModel()->data(left, PrinterModel::DestRemote).toBool();
-    bool rightIsRemote = sourceModel()->data(right, PrinterModel::DestRemote).toBool();
-
-    if (leftIsRemote != rightIsRemote) {
-        // If the right item is a remote the left should move right
-        return rightIsRemote;
-    }
-
-    return QSortFilterProxyModel::lessThan(left, right);
-}
diff --git a/print-manager/libkcups/PrinterSortFilterModel.h b/print-manager/libkcups/PrinterSortFilterModel.h
deleted file mode 100644 (file)
index 6b9d88d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-#ifndef PRINTERSORTFILTERMODEL_H
-#define PRINTERSORTFILTERMODEL_H
-
-#include <QSortFilterProxyModel>
-
-#include <QDeclarativeItem>
-
-#include <kdemacros.h>
-
-class KDE_EXPORT PrinterSortFilterModel : public QSortFilterProxyModel
-{
-    Q_OBJECT
-    Q_PROPERTY(QString filteredPrinters READ filteredPrinters WRITE setFilteredPrinters NOTIFY filteredPrintersChanged)
-    Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setModel NOTIFY sourceModelChanged)
-    Q_PROPERTY(int count READ count NOTIFY countChanged)
-public:
-    explicit PrinterSortFilterModel(QObject *parent = 0);
-
-    void setModel(QAbstractItemModel *model);
-    void setFilteredPrinters(const QString &printers);
-    QString filteredPrinters() const;
-    int count() const;
-
-signals:
-    void countChanged();
-    void sourceModelChanged(QObject *);
-    void filteredPrintersChanged();
-
-private:
-    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
-    bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
-
-    QStringList m_filteredPrinters;
-};
-
-#endif // PRINTERSORTFILTERMODEL_H
diff --git a/print-manager/libkcups/SelectMakeModel.cpp b/print-manager/libkcups/SelectMakeModel.cpp
deleted file mode 100644 (file)
index 35380c2..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "SelectMakeModel.h"
-#include "ui_SelectMakeModel.h"
-
-#include "PPDModel.h"
-
-#include "KCupsRequest.h"
-#include "NoSelectionRectDelegate.h"
-
-#include <QStandardItemModel>
-#include <QLineEdit>
-#include <QtGui/qitemselectionmodel.h>
-
-#include <QtDBus/QDBusMessage>
-#include <QtDBus/QDBusConnection>
-#include <QtDBus/QDBusReply>
-#include <QtDBus/QDBusMetaType>
-
-#include <KMessageBox>
-#include <KDebug>
-#include <KLocale>
-
-// Marshall the MyStructure data into a D-Bus argument
-QDBusArgument &operator<<(QDBusArgument &argument, const DriverMatch &driverMatch)
-{
-    argument.beginStructure();
-    argument << driverMatch.ppd << driverMatch.match;
-    argument.endStructure();
-    return argument;
-}
-
-// Retrieve the MyStructure data from the D-Bus argument
-const QDBusArgument &operator>>(const QDBusArgument &argument, DriverMatch &driverMatch)
-{
-    argument.beginStructure();
-    argument >> driverMatch.ppd >> driverMatch.match;
-    argument.endStructure();
-    return argument;
-}
-
-SelectMakeModel::SelectMakeModel(QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui_SelectMakeModel),
-    m_ppdRequest(0),
-    m_gotBestDrivers(false),
-    m_hasRecommended(false)
-{
-    ui->setupUi(this);
-
-    // Configure the erro message widget
-    ui->messageWidget->setMessageType(KMessageWidget::Error);
-    ui->messageWidget->hide();
-
-    m_sourceModel = new PPDModel(this);
-
-    ui->makeView->setModel(m_sourceModel);
-    ui->makeView->setItemDelegate(new NoSelectionRectDelegate(this));
-    // Updates the PPD view to the selected Make
-    connect(ui->makeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
-            ui->ppdsLV, SLOT(setRootIndex(QModelIndex)));
-
-    ui->ppdsLV->setModel(m_sourceModel);
-    ui->ppdsLV->setItemDelegate(new NoSelectionRectDelegate(this));
-    connect(m_sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(checkChanged()));
-
-    // Clear the PPD view selection, so the Next/Finish button gets disabled
-    connect(ui->makeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
-            ui->ppdsLV->selectionModel(), SLOT(clearSelection()));
-
-    // Make sure we update the Next/Finish button if a PPD is selected
-    connect(ui->ppdsLV->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-            this, SLOT(checkChanged()));    
-
-    // When the radio button changes the signal must be emitted
-    connect(ui->ppdFileRB, SIGNAL(toggled(bool)), this, SLOT(checkChanged()));
-    connect(ui->ppdFilePathUrl, SIGNAL(textChanged(QString)), this, SLOT(checkChanged()));
-
-    qDBusRegisterMetaType<DriverMatch>();
-    qDBusRegisterMetaType<DriverMatchList>();
-}
-
-SelectMakeModel::~SelectMakeModel()
-{
-    delete ui;
-}
-
-void SelectMakeModel::setDeviceInfo(const QString &deviceId, const QString &make, const QString &makeAndModel, const QString &deviceUri)
-{
-    kDebug() << "===================================" << deviceId << makeAndModel << deviceUri;
-    m_gotBestDrivers = false;
-    m_hasRecommended = false;
-    m_make = make;
-    m_makeAndModel = makeAndModel;
-
-    // Get the best drivers
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("/org/fedoraproject/Config/Printing"),
-                                             QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("GetBestDrivers"));
-    message << deviceId;
-    message << makeAndModel;
-    message << deviceUri;
-    QDBusConnection::sessionBus().callWithCallback(message,
-                                                   this,
-                                                   SLOT(getBestDriversFinished(QDBusMessage)),
-                                                   SLOT(getBestDriversFailed(QDBusError,QDBusMessage)));
-
-    if (!m_ppdRequest) {
-        m_ppdRequest = new KCupsRequest;
-        connect(m_ppdRequest, SIGNAL(finished()), this, SLOT(ppdsLoaded()));
-        m_ppdRequest->getPPDS();
-    }
-}
-
-void SelectMakeModel::setMakeModel(const QString &make, const QString &makeAndModel)
-{
-    if (!m_ppdRequest) {
-        // We won't try to get the best driver
-        // we should be we need more info and testing
-        // TODO
-        m_gotBestDrivers = true;
-        m_hasRecommended = false;
-        m_make = make;
-        m_makeAndModel = makeAndModel;
-
-        m_ppdRequest = new KCupsRequest;
-        connect(m_ppdRequest, SIGNAL(finished()), this, SLOT(ppdsLoaded()));
-        m_ppdRequest->getPPDS();
-    } else {
-        // TODO test this
-        setModelData();
-    }
-}
-
-void SelectMakeModel::ppdsLoaded()
-{
-    if (m_ppdRequest->hasError()) {
-        kWarning() << "Failed to get PPDs" << m_ppdRequest->errorMsg();
-        ui->messageWidget->setText(i18n("Failed to get a list of drivers: '%1'", m_ppdRequest->errorMsg()));
-        ui->messageWidget->animatedShow();
-
-        // Force the changed signal to be sent
-        checkChanged();
-
-        m_ppdRequest = 0;
-    } else {
-        m_ppds = m_ppdRequest->ppds();
-
-        // Try to show the PPDs
-        setModelData();
-    }
-    sender()->deleteLater();
-}
-
-void SelectMakeModel::checkChanged()
-{
-    kDebug();
-    if (isFileSelected()) {
-        emit changed(!selectedPPDFileName().isNull());
-    } else {
-        // enable or disable the job action buttons if something is selected
-        emit changed(!selectedPPDName().isNull());
-
-        selectFirstMake();
-    }
-}
-
-QString SelectMakeModel::selectedPPDName() const
-{
-    QItemSelection ppdSelection = ui->ppdsLV->selectionModel()->selection();
-    if (!isFileSelected() && !ppdSelection.indexes().isEmpty()) {
-        QModelIndex index = ppdSelection.indexes().first();
-        return index.data(PPDModel::PPDName).toString();
-    }
-    return QString();
-}
-
-QString SelectMakeModel::selectedPPDMakeAndModel() const
-{
-    QItemSelection ppdSelection = ui->ppdsLV->selectionModel()->selection();
-    if (!isFileSelected() && !ppdSelection.indexes().isEmpty()) {
-        QModelIndex index = ppdSelection.indexes().first();
-        return index.data(PPDModel::PPDMakeAndModel).toString();
-    }
-    return QString();
-}
-
-QString SelectMakeModel::selectedPPDFileName() const
-{
-    if (isFileSelected()) {
-        QFileInfo file = ui->ppdFilePathUrl->url().toLocalFile();
-        kDebug() << ui->ppdFilePathUrl->url().toLocalFile() << file.isFile() << file.filePath();
-        if (file.isFile()) {
-            return file.filePath();
-        }
-    }
-    return QString();
-}
-
-bool SelectMakeModel::isFileSelected() const
-{
-    kDebug() << ui->ppdFileRB->isChecked();
-    return ui->ppdFileRB->isChecked();
-}
-
-void SelectMakeModel::getBestDriversFinished(const QDBusMessage &message)
-{
-    if (message.type() == QDBusMessage::ReplyMessage && message.arguments().size() == 1) {
-        QDBusArgument argument = message.arguments().first().value<QDBusArgument>();
-        m_driverMatchList = qdbus_cast<DriverMatchList>(argument);
-        m_hasRecommended = !m_driverMatchList.isEmpty();
-        foreach (const DriverMatch &driverMatch, m_driverMatchList) {
-            kDebug() << driverMatch.ppd << driverMatch.match;
-        }
-    } else {
-        kWarning() << "Unexpected message" << message;
-    }
-    m_gotBestDrivers = true;
-    setModelData();
-}
-
-void SelectMakeModel::getBestDriversFailed(const QDBusError &error, const QDBusMessage &message)
-{
-    kWarning() << "Failed to get best drivers" << error << message;
-
-    // Show the PPDs anyway
-    m_gotBestDrivers = true;
-    ui->messageWidget->setText(i18n("Failed to search for a recommended driver: '%1'", error.message()));
-    ui->messageWidget->animatedShow();
-    setModelData();
-}
-
-void SelectMakeModel::setModelData()
-{
-    if (!m_ppds.isEmpty() && m_gotBestDrivers) {
-        m_sourceModel->setPPDs(m_ppds, m_driverMatchList);
-
-        // Pre-select the first Recommended PPD
-        if (m_hasRecommended) {
-            selectRecommendedPPD();
-        } else if (!m_ppds.isEmpty() && !m_make.isEmpty()) {
-            selectMakeModelPPD();
-        }
-
-        // Force changed signal to be emitted
-        checkChanged();
-    }
-}
-
-void SelectMakeModel::selectFirstMake()
-{
-    QItemSelection selection;
-    selection = ui->makeView->selectionModel()->selection();
-    // Make sure the first make is selected
-    if (selection.indexes().isEmpty() && m_sourceModel->rowCount() > 0) {
-        ui->makeView->selectionModel()->setCurrentIndex(m_sourceModel->index(0, 0),
-                                                        QItemSelectionModel::SelectCurrent);
-    }
-}
-
-void SelectMakeModel::selectMakeModelPPD()
-{
-    QList<QStandardItem*> makes = m_sourceModel->findItems(m_make);
-    foreach (QStandardItem *make, makes) {
-        // Check if the item is in this make
-        for (int i = 0; i < make->rowCount(); i++) {
-            if (make->child(i)->data(PPDModel::PPDMakeAndModel).toString() == m_makeAndModel) {
-                ui->makeView->selectionModel()->setCurrentIndex(make->index(),
-                                                                QItemSelectionModel::SelectCurrent);
-                ui->ppdsLV->selectionModel()->setCurrentIndex(make->child(i)->index(),
-                                                              QItemSelectionModel::SelectCurrent);
-                return;
-            }
-        }
-    }
-
-    // the exact PPD wasn't found try to select just the make
-    if (!makes.isEmpty()) {
-        ui->makeView->selectionModel()->setCurrentIndex(makes.first()->index(),
-                                                        QItemSelectionModel::SelectCurrent);
-    }
-}
-
-void SelectMakeModel::selectRecommendedPPD()
-{
-    // Force the first make to be selected
-    selectFirstMake();
-
-    QItemSelection ppdSelection = ui->ppdsLV->selectionModel()->selection();
-    if (ppdSelection.indexes().isEmpty()) {
-        QItemSelection makeSelection = ui->makeView->selectionModel()->selection();
-        QModelIndex parent = makeSelection.indexes().first();
-        if (parent.isValid()) {
-            ui->ppdsLV->selectionModel()->setCurrentIndex(m_sourceModel->index(0, 0, parent),
-                                                          QItemSelectionModel::SelectCurrent);
-        }
-    }
-}
diff --git a/print-manager/libkcups/SelectMakeModel.h b/print-manager/libkcups/SelectMakeModel.h
deleted file mode 100644 (file)
index 199b764..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef SELECT_MAKE_MODEL_H
-#define SELECT_MAKE_MODEL_H
-
-#include <QWidget>
-#include <QDBusMessage>
-
-#include <kdemacros.h>
-
-#include "KCupsConnection.h"
-#include "PPDModel.h"
-
-QT_BEGIN_NAMESPACE
-class Ui_SelectMakeModel;
-QT_END_NAMESPACE
-
-class KCupsRequest;
-class KDE_EXPORT SelectMakeModel : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit SelectMakeModel(QWidget *parent = 0);
-    ~SelectMakeModel();
-
-    void setDeviceInfo(const QString &deviceId, const QString &make, const QString &makeAndModel, const QString &deviceUri);
-    void setMakeModel(const QString &make, const QString &makeAndModel);
-    QString selectedPPDName() const;
-    QString selectedPPDMakeAndModel() const;
-    QString selectedPPDFileName() const;
-    bool isFileSelected() const;
-
-public slots:
-    void checkChanged();
-    void ppdsLoaded();
-
-signals:
-    void changed(bool);
-
-private slots:
-    void getBestDriversFinished(const QDBusMessage &message);
-    void getBestDriversFailed(const QDBusError &error, const QDBusMessage &message);
-
-private:
-    void setModelData();
-    void selectFirstMake();
-    void selectMakeModelPPD();
-    void selectRecommendedPPD();
-
-    Ui_SelectMakeModel *ui;
-    PPDModel *m_sourceModel;
-    KCupsRequest *m_ppdRequest;
-    ReturnArguments m_ppds;
-    DriverMatchList m_driverMatchList;
-    bool m_gotBestDrivers;
-    bool m_hasRecommended;
-    QString m_make;
-    QString m_makeAndModel;
-};
-
-#endif
diff --git a/print-manager/libkcups/SelectMakeModel.ui b/print-manager/libkcups/SelectMakeModel.ui
deleted file mode 100644 (file)
index 822f47c..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SelectMakeModel</class>
- <widget class="QWidget" name="SelectMakeModel">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>467</width>
-    <height>358</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Select a Driver</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="verticalSpacing">
-    <number>0</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="3" column="1">
-    <widget class="KUrlRequester" name="ppdFilePathUrl">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="filter">
-      <string>*.ppd *.ppd.gz|PostScript Printer Description files</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QSplitter" name="splitter">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="childrenCollapsible">
-      <bool>false</bool>
-     </property>
-     <widget class="QListView" name="makeView">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-     </widget>
-     <widget class="QListView" name="ppdsLV">
-      <property name="editTriggers">
-       <set>QAbstractItemView::NoEditTriggers</set>
-      </property>
-     </widget>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="2">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QRadioButton" name="radioButton_2">
-       <property name="text">
-        <string>Choose the driver from the list</string>
-       </property>
-       <property name="checked">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="3" column="0">
-    <widget class="QRadioButton" name="ppdFileRB">
-     <property name="text">
-      <string>Manually Provide a PPD File:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" colspan="2">
-    <widget class="KMessageWidget" name="messageWidget" native="true"/>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KUrlRequester</class>
-   <extends>QFrame</extends>
-   <header>kurlrequester.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KMessageWidget</class>
-   <extends>QWidget</extends>
-   <header location="global">kmessagewidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections>
-  <connection>
-   <sender>ppdFileRB</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ppdFilePathUrl</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>138</x>
-     <y>341</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>406</x>
-     <y>342</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>ppdFileRB</sender>
-   <signal>clicked()</signal>
-   <receiver>ppdFilePathUrl</receiver>
-   <slot>setFocus()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>82</x>
-     <y>340</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>462</x>
-     <y>344</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>radioButton_2</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>makeView</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>100</x>
-     <y>15</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>99</x>
-     <y>65</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>radioButton_2</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ppdsLV</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>291</x>
-     <y>12</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>297</x>
-     <y>119</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/print-manager/plasmoid/CMakeLists.txt b/print-manager/plasmoid/CMakeLists.txt
deleted file mode 100644 (file)
index 71b1c3c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-set(printmanager_config_SRCS
-    KPrintManagerConfigPlugin.cpp
-)
-
-kde4_add_plugin(printmanagerwidget ${printmanager_config_SRCS})
-
-target_link_libraries(printmanagerwidget
-    ${KDE4_KDEUI_LIBS}
-    kcupslib
-)
-
-install(TARGETS printmanagerwidget DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}/plugins/designer)
-
-# QML Stuff
-install(FILES package/metadata.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} RENAME plasma-applet-printmanager.desktop)
-install(DIRECTORY package/ DESTINATION ${KDE4_DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.printmanager)
diff --git a/print-manager/plasmoid/KPrintManagerConfigPlugin.cpp b/print-manager/plasmoid/KPrintManagerConfigPlugin.cpp
deleted file mode 100644 (file)
index 556dbb7..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti <dantti12@gmail.com>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include "KPrintManagerConfigPlugin.h"
-#include "ClassListWidget.h"
-
-#include <QtCore/qplugin.h>
-
-#include <KGlobal>
-
-static const KCatalogLoader loader(QLatin1String("print-manager"));
-
-KPrintManagerConfigPlugin::KPrintManagerConfigPlugin(QObject *parent)
-: QObject(parent)
-{
-}
-
-bool KPrintManagerConfigPlugin::isContainer() const
-{
-    return false;
-}
-
-QIcon KPrintManagerConfigPlugin::icon() const
-{
-    return QIcon();
-}
-
-QString KPrintManagerConfigPlugin::group() const
-{
-    return QString();
-}
-
-QString KPrintManagerConfigPlugin::includeFile() const
-{
-    return "ClassListWidget.h";
-}
-
-QString KPrintManagerConfigPlugin::name() const
-{
-    return "ClassListWidget";
-}
-
-QString KPrintManagerConfigPlugin::toolTip() const
-{
-    return QString();
-}
-
-QString KPrintManagerConfigPlugin::whatsThis() const
-{
-    return QString();
-}
-
-QWidget * KPrintManagerConfigPlugin::createWidget(QWidget *parent)
-{
-    return new ClassListWidget(parent);
-}
-
-Q_EXPORT_PLUGIN2(printmanagerwidget, KPrintManagerConfigPlugin)
-
diff --git a/print-manager/plasmoid/KPrintManagerConfigPlugin.h b/print-manager/plasmoid/KPrintManagerConfigPlugin.h
deleted file mode 100644 (file)
index 4c6d4df..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012-2013 by Daniel Nicoletti <dantti12@gmail.com>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#ifndef KPRINT_MANAGER_CONFIG_H
-#define KPRINT_MANAGER_CONFIG_H
-
-#include <QObject>
-#ifdef QT_KATIE
-#include <QtUiTools/customwidget.h>
-#else
-#include <QtDesigner/customwidget.h>
-#endif
-
-class KPrintManagerConfigPlugin : public QObject, public QDesignerCustomWidgetInterface
-{
-    Q_OBJECT
-    Q_INTERFACES(QDesignerCustomWidgetInterface)
-public:
-    explicit KPrintManagerConfigPlugin(QObject *parent = 0);
-
-    bool isContainer() const;
-    QIcon icon() const;
-    QString group() const;
-    QString includeFile() const;
-    QString name() const;
-    QString toolTip() const;
-    QString whatsThis() const;
-    QWidget *createWidget(QWidget *parent);
-};
-
-#endif // KPRINT_MANAGER_CONFIG_H
diff --git a/print-manager/plasmoid/package/contents/config/main.xml b/print-manager/plasmoid/package/contents/config/main.xml
deleted file mode 100644 (file)
index ef41e3a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
-      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
-      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
-  <kcfgfile name=""/>
-
-  <group name="General">
-    <entry name="activeJobs" type="Bool">
-      <default>true</default>
-    </entry>
-    <entry name="completedJobs" type="Bool">
-    </entry>
-    <entry name="allJobs" type="Bool">
-    </entry>
-    <entry name="filterPrinters" type="Bool">
-    </entry>
-    <entry name="selectedPrinters" type="String">
-    </entry>
-  </group>
-
-</kcfg>
diff --git a/print-manager/plasmoid/package/contents/ui/CompactRepresentation.qml b/print-manager/plasmoid/package/contents/ui/CompactRepresentation.qml
deleted file mode 100644 (file)
index bd88087..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *   Copyright 2013 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2 or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-import QtQuick 1.1
-import org.kde.qtextracomponents 0.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-
-Item {
-    id: panelIconWidget;
-
-    property alias tooltipText: tooltip.subText
-
-    PlasmaCore.SvgItem {
-        id: connectionIcon
-        anchors.fill: parent
-        svg: PlasmaCore.Svg {
-            imagePath: "icons/printer";
-        }
-        elementId: "printer";
-    }
-
-    MouseArea {
-        id: mouseAreaPopup
-
-        anchors.fill: parent
-        hoverEnabled: true
-        onClicked: plasmoid.togglePopup()
-
-        PlasmaCore.ToolTip {
-             id: tooltip
-             target: mouseAreaPopup
-             image: QIcon("printer")
-        }
-    }
-}
diff --git a/print-manager/plasmoid/package/contents/ui/JobItem.qml b/print-manager/plasmoid/package/contents/ui/JobItem.qml
deleted file mode 100644 (file)
index 1b3c0d3..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- *   Copyright 2012-2013 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2 or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-import QtQuick 1.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.qtextracomponents 0.1
-
-Item {
-    id: jobItem
-    clip: true
-    width: jobItem.ListView.view.width
-    height: items.height + padding.margins.top + padding.margins.bottom
-
-    Behavior on height { PropertyAnimation {} }
-
-    property bool currentItem: ListView.isCurrentItem
-    property bool highlight: highlightPrinter === jobPrinter
-
-    Keys.onDeletePressed: cancelJob()
-    Keys.onReturnPressed: cancelJob()
-
-    onCurrentItemChanged: updateSelection();
-    onHighlightChanged: updateSelection();
-
-    function updateSelection() {
-        var containsMouse = mouseArea.containsMouse;
-
-        if (highlight || currentItem && containsMouse) {
-            padding.opacity = 1;
-        } else if (currentItem) {
-            padding.opacity = 0.8;
-        } else if (containsMouse) {
-            padding.opacity = 0.65;
-        } else {
-            padding.opacity = 0;
-        }
-    }
-
-    function cancelJob() {
-        cancelButton.enabled = false;
-        jobsModel.cancel(jobPrinter, jobId);
-        cancelButton.enabled = true;
-    }
-
-    PlasmaCore.FrameSvgItem {
-        id: padding
-        imagePath: "widgets/viewitem"
-        prefix: "hover"
-        opacity: 0
-        Behavior on opacity { PropertyAnimation {} }
-        anchors.fill: parent
-    }
-
-    MouseArea {
-        id: mouseArea
-        anchors.fill: parent
-        hoverEnabled: true
-        onEntered: updateSelection()
-        onExited: updateSelection()
-        onClicked: {
-            if (currentItem) {
-                jobItem.ListView.view.currentIndex = -1;
-            } else {
-                jobItem.ListView.view.currentIndex = index;
-                jobItem.forceActiveFocus();
-            }
-            updateSelection();
-        }
-        onDoubleClicked: toggleChangelog()
-    }
-        
-    Column {
-        id: items
-        spacing: 4
-        anchors.left: parent.left
-        anchors.top: parent.top
-        anchors.right: parent.right
-        anchors.topMargin: padding.margins.top
-        anchors.leftMargin: padding.margins.left
-        anchors.rightMargin: padding.margins.right
-        anchors.bottomMargin: padding.margins.bottom
-        Row {
-            id: jobRow
-            spacing: 4
-            width: parent.width
-            QIconItem {
-                id: jobIcon
-                width: parent.height
-                height: width
-                anchors.verticalCenter: parent.verticalCenter
-                icon: QIcon(jobIconName)
-            }
-            PlasmaComponents.Label {
-                // 12 = 3 * spacing
-                id: jobNameLabel
-                width: parent.width - pagesLabel.width - jobIcon.width - parent.spacing * 2
-                anchors.verticalCenter: parent.verticalCenter
-                height: paintedHeight
-                elide: Text.ElideRight
-                text: jobName
-            }
-            PlasmaComponents.Label {
-                id: pagesLabel
-                visible: jobPages != 0
-                width: paintedWidth
-                height: paintedHeight
-                anchors.verticalCenter: parent.verticalCenter
-                horizontalAlignment: Text.AlignRight
-                text: jobPages
-                font.pointSize: theme.smallestFont.pointSize
-                color: "#99"+(theme.textColor.toString().substr(1))
-            }
-        }
-
-        Column {
-            id: actionRow
-            opacity: currentItem ? 1 : 0
-            width: parent.width
-            spacing: 4
-
-            PlasmaCore.SvgItem {
-                svg: PlasmaCore.Svg {
-                    id: lineSvg
-                    imagePath: "widgets/line"
-                }
-                elementId: "horizontal-line"
-                height: lineSvg.elementSize("horizontal-line").height
-                width: parent.width
-            }
-
-            Row {
-                id: columnButton
-                width: parent.width
-                spacing: 2
-
-                PlasmaComponents.Button {
-                    id: cancelButton
-                    focus: true
-                    width: holdButton.visible ? parent.width * 0.5 - parent.spacing : minimumWidth
-                    KeyNavigation.tab: holdButton
-                    KeyNavigation.backtab: holdButton
-                    iconSource: "dialog-cancel"
-                    text:  i18n("Cancel")
-                    visible: jobCancelEnabled
-                    onClicked: cancelJob()
-                }
-                PlasmaComponents.Button {
-                    id: holdButton
-                    focus: true
-                    width: holdButton.visible ? parent.width * 0.5 - parent.spacing : minimumWidth
-                    KeyNavigation.tab: cancelButton
-                    KeyNavigation.backtab: cancelButton
-                    iconSource: "document-open-recent"
-                    text: jobRestartEnabled ?  i18n("Reprint") : (jobHoldEnabled ?  i18n("Hold") :  i18n("Release"))
-                    visible: jobCancelEnabled || jobRestartEnabled
-                    onClicked: {
-                        enabled = false;
-                        if (jobHoldEnabled) {
-                            jobsModel.hold(jobPrinter, jobId);
-                        } else {
-                            jobsModel.release(jobPrinter, jobId);
-                        }
-                        enabled = true;
-                    }
-                }
-            }
-            Row {
-                id: detailsRow
-                width: parent.width
-                spacing: 4
-
-                Column {
-                    id: labelsColumn
-                    PlasmaComponents.Label {
-                        id: ownerLabel
-                        height: paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignRight
-                        onPaintedWidthChanged: {
-                            if (paintedWidth > parent.width) {
-                                parent.width = paintedWidth;
-                            }
-                        }
-                        text: i18n("Owner:")
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                    PlasmaComponents.Label {
-                        id: sizeLabel
-                        height: paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignRight
-                        onPaintedWidthChanged: {
-                            if (paintedWidth > parent.width) {
-                                parent.width = paintedWidth;
-                            }
-                        }
-                        text: i18n("Size:")
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                    PlasmaComponents.Label {
-                        id: createdLabel
-                        height: paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignRight
-                        onPaintedWidthChanged: {
-                            if (paintedWidth > parent.width) {
-                                parent.width = paintedWidth;
-                            }
-                        }
-                        text: i18n("Created:")
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                }
-                Column {
-                    width: parent.width - labelsColumn.width - parent.spacing * 2
-                    PlasmaComponents.Label {
-                        height: paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignLeft
-                        elide: Text.ElideRight
-                        text: jobOwner
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                    PlasmaComponents.Label {
-                        height:paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignLeft
-                        elide: Text.ElideRight
-                        text: jobSize
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                    PlasmaComponents.Label {
-                        height: paintedHeight
-                        width: parent.width
-                        horizontalAlignment: Text.AlignLeft
-                        elide: Text.ElideRight
-                        text: jobCreatedAt
-                        font.pointSize: theme.smallestFont.pointSize
-                        color: "#99"+(theme.textColor.toString().substr(1))
-                    }
-                }
-            }
-        }
-    }
-}
-
diff --git a/print-manager/plasmoid/package/contents/ui/NIHSwitch.qml b/print-manager/plasmoid/package/contents/ui/NIHSwitch.qml
deleted file mode 100644 (file)
index 7d3422f..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
-*   Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
-*   Copyright (C) 2013 by Daniel Nicoletti <dantti12@gmail.com>
-*
-*   This program is free software; you can redistribute it and/or modify
-*   it under the terms of the GNU Library General Public License as
-*   published by the Free Software Foundation; either version 2, or
-*   (at your option) any later version.
-*
-*   This program is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details
-*
-*   You should have received a copy of the GNU Library General Public
-*   License along with this program; if not, write to the
-*   Free Software Foundation, Inc.,
-*   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*/
-
-import QtQuick 1.0
-import org.kde.plasma.core 0.1 as PlasmaCore
-import "private" as Private
-
-/**
- * An interactive draggable switch component with Plasma look and feel.
- * Modified as the license above said I can :)
- */
-Item {
-    id: switcher
-
-    /**
-     * type:bool
-     *
-     * True if the Switch is being pressed.
-     */
-    property alias pressed: mouseArea.pressed
-
-    // Plasma API
-    /**
-     * type:bool
-     * This property holds if the switch is on or off.
-     *
-     * The default value is false (which means off).
-     */
-    property bool on: false
-
-    /**
-     * type:bool
-     * This property holds if the mouse area of
-     * our switch contains the mouse cursor, which
-     * is needed to keep the list highlight
-     */
-    property alias containsMouse: mouseArea.containsMouse
-
-    /**
-     * This signal is emitted only when the user
-     * manually change the state.
-     */
-    signal toggled(bool enabled)
-
-    width: handle.width * 2.3
-    height: theme.defaultFont.mSize.height*1.8
-    opacity: enabled ? 1.0 : 0.5
-
-    Keys.onLeftPressed: {
-        if (!enabled)
-            return;
-
-        value -= stepSize;
-    }
-
-    Keys.onRightPressed: {
-        if (!enabled)
-            return;
-
-        value += stepSize;
-    }
-
-    onOnChanged: updateSwitcher()
-
-    function updateSwitcher() {
-        if (switcher.on) {
-            handle.x = contents.width - handle.width
-        } else {
-            handle.x = 0
-        }
-    }
-
-    Item {
-        id: contents
-
-        // Plasma API
-        property bool animated: true
-        property real handleWidth: grooveSvg.elementSize("horizontal-slider-handle").width
-        property real handleHeight: grooveSvg.elementSize("horizontal-slider-handle").height
-
-        width: switcher.width
-        height: switcher.height
-
-        anchors.centerIn: parent
-
-        PlasmaCore.Svg {
-            id: grooveSvg
-            imagePath: "widgets/slider"
-        }
-        PlasmaCore.FrameSvgItem {
-            id: groove
-            imagePath: "widgets/slider"
-            prefix: "groove"
-            height: handle.height * 0.85
-            anchors {
-                left: parent.left
-                right: parent.right
-                margins: handle.width / 4
-                verticalCenter: parent.verticalCenter
-            }
-            opacity: switcher.on ? 1 : 0.5
-        }
-        PlasmaCore.FrameSvgItem {
-            id: highlight
-            imagePath: "widgets/slider"
-            prefix: "groove-highlight"
-            height: groove.height
-            anchors.left: groove.left
-            anchors.right: handle.horizontalCenter
-            anchors.verticalCenter: parent.verticalCenter
-        }
-
-        Private.RoundShadow {
-            id: shadow
-            imagePath: "widgets/slider"
-            focusElement: "horizontal-slider-focus"
-            hoverElement: "horizontal-slider-hover"
-            shadowElement: "horizontal-slider-shadow"
-            state: switcher.activeFocus ? "focus" : (mouseArea.containsMouse ? "hover" : "shadow")
-            anchors.fill: handle
-        }
-
-        PlasmaCore.SvgItem {
-            id: handle
-            anchors {
-                verticalCenter: groove.verticalCenter
-            }
-            width: contents.handleWidth
-            height: contents.handleHeight
-            opacity: switcher.enabled ? 1 : 0.5
-            svg: PlasmaCore.Svg { imagePath: "widgets/slider" }
-            elementId: "horizontal-slider-handle"
-
-            Behavior on x {
-                id: behavior
-                enabled: !mouseArea.drag.active && contents.animated
-
-                PropertyAnimation {
-                    duration: behavior.enabled ? 150 : 0
-                    easing.type: Easing.OutSine
-                }
-            }
-
-            Rectangle {
-                property bool showOn: handle.x >= (contents.width - handle.width) / 2
-                anchors.topMargin: 6
-                anchors.bottomMargin: 6
-                anchors.top: parent.top
-                anchors.bottom: parent.bottom
-                anchors.horizontalCenter: parent.horizontalCenter
-                width: showOn ? 1.5 : height
-                color: showOn ? theme.textColor : "transparent"
-                border.width: showOn ? 0 : 2
-                border.color: theme.textColor
-                radius: showOn ? 0 : height
-                smooth: true
-            }
-        }
-
-        MouseArea {
-            id: mouseArea
-
-            anchors.fill: parent
-            enabled: switcher.enabled
-            drag {
-                target: handle
-                axis: Drag.XAxis
-                minimumX: 0 //range.positionAtMinimum
-                maximumX: contents.width - handle.width //range.positionAtMaximum
-            }
-            hoverEnabled: true
-
-            onClicked: {
-                switcher.on = !switcher.on
-                toggled(switcher.on)
-            }
-
-            onPressed: switcher.forceActiveFocus()
-            onReleased: {
-                var xValue = handle.x
-                var onBefore = switcher.on
-                switcher.on = xValue >= (contents.width - handle.width) / 2
-                if (onBefore === switcher.on && (xValue !== contents.width - handle.width || xValue === 0)) {
-                    updateSwitcher()
-                } else if (onBefore !== switcher.on) {
-                    toggled(switcher.on)
-                }
-            }
-        }
-    }
-}
diff --git a/print-manager/plasmoid/package/contents/ui/PrinterItem.qml b/print-manager/plasmoid/package/contents/ui/PrinterItem.qml
deleted file mode 100644 (file)
index 2b9bc81..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *   Copyright 2012 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2 or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-import QtQuick 1.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.qtextracomponents 0.1
-
-Item {
-    id: printerItem
-    width: ListView.view.width
-    height: items.height + padding.margins.top + padding.margins.bottom
-    state: isPaused ? "PAUSED" : "*"
-
-    property bool currentItem: ListView.isCurrentItem
-    property bool multipleItems: false
-
-    Keys.onSpacePressed: toggleSelection()
-
-    onCurrentItemChanged: updateSelection();
-
-    function updateSelection() {
-        var containsMouse = mouseArea.containsMouse || switchAction.containsMouse;
-
-        if (currentItem && containsMouse) {
-            highlightPrinter = printerName;
-            padding.opacity = 1;
-        } else if (currentItem) {
-            highlightPrinter = "";
-            padding.opacity = 0.9;
-        } else if (containsMouse) {
-            highlightPrinter = printerName;
-            padding.opacity = 0.7;
-        } else {
-            if (highlightPrinter === printerName) {
-                highlightPrinter = "";
-            }
-            padding.opacity = 0;
-        }
-    }
-
-    function toggleSelection() {
-        switchAction.enabled = false;
-        if (isPaused) {
-            if (!isAcceptingJobs) {
-                printersModel.acceptJobs(printerName);
-            }
-            if (printerState === 5) {
-                printersModel.resumePrinter(printerName);
-            }
-        } else {
-            printersModel.pausePrinter(printerName);
-        }
-        switchAction.enabled = true;
-    }
-
-    PlasmaCore.FrameSvgItem {
-        id: padding
-        imagePath: "widgets/viewitem"
-        prefix: "hover"
-        visible: multipleItems
-        opacity: 0
-        Behavior on opacity { PropertyAnimation {} }
-        anchors.fill: parent
-    }
-
-    MouseArea {
-        id: mouseArea
-        anchors.fill: parent
-        hoverEnabled: multipleItems
-        onEntered: updateSelection()
-        onExited: updateSelection()
-        onClicked: {
-            if (currentItem) {
-                printerItem.ListView.view.currentIndex = -1;
-                filterJobs = "";
-            } else if (multipleItems) {
-                printerItem.ListView.view.currentIndex = index;
-                printerItem.forceActiveFocus();
-                // We need to unset the filter before applying a new one
-                // otherwise, the filter model get's rowCount() == 0 and
-                // the popup hides
-                filterJobs = "";
-                filterJobs = printerName;
-            }
-            updateSelection();
-        }
-        onDoubleClicked: plasmoid.runCommand("kde-print-queue", [printerName])
-    }
-
-    Row {
-        id: items
-        width: parent.width - padding.margins.left - padding.margins.right
-        anchors.topMargin: padding.margins.top
-        anchors.leftMargin: padding.margins.left
-        anchors.rightMargin: padding.margins.right
-        anchors.bottomMargin: padding.margins.bottom
-        anchors.centerIn: parent
-        spacing: 4
-
-        QIconItem {
-            id: printerIcon
-            width: parent.height
-            height: width
-            icon: QIcon(iconName)
-            Behavior on opacity { PropertyAnimation {} }
-        }
-
-        Column {
-            id: labelsColumn
-            width: parent.width - printerIcon.width - switchAction.width - parent.spacing * 2
-            spacing: padding.margins.top/2
-            Row {
-                id: nameRow
-                anchors.left: parent.left
-                anchors.right: parent.right
-                spacing: 4
-                PlasmaComponents.Label {
-                    id: printerLabel
-                    height: paintedHeight
-                    elide: Text.ElideRight
-                    text: printerName
-                }
-                PlasmaComponents.Label {
-                    id: printerDescription
-                    width: parent.width - printerLabel.paintedWidth
-                    height: printerLabel.height
-                    elide: Text.ElideRight
-                    verticalAlignment: Text.AlignBottom
-                    font.pointSize: theme.smallestFont.pointSize
-                    color: "#99"+(theme.textColor.toString().substr(1))
-                    text: info
-                }
-            }
-            PlasmaComponents.Label {
-                height: paintedHeight
-                anchors.left: parent.left
-                anchors.right: parent.right
-                verticalAlignment: Text.AlignTop
-                text: stateMessage
-                elide: Text.ElideRight
-                font.italic: true
-                font.pointSize: theme.smallestFont.pointSize
-                color: "#99"+(theme.textColor.toString().substr(1))
-            }
-        }
-
-        NIHSwitch {
-            id: switchAction
-            anchors.verticalCenter: parent.verticalCenter
-            focus: !multipleItems
-            on: !isPaused
-            onContainsMouseChanged: updateSelection()
-            onToggled: toggleSelection()
-        }
-    }
-
-    states: [
-        State {
-            name: "PAUSED"
-            PropertyChanges { target: labelsColumn; opacity: 0.6}
-            PropertyChanges { target: printerIcon; opacity: 0.6}
-        }
-    ]
-}
diff --git a/print-manager/plasmoid/package/contents/ui/ScrollableListView.qml b/print-manager/plasmoid/package/contents/ui/ScrollableListView.qml
deleted file mode 100644 (file)
index 238f1bd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *   Copyright 2012 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2 or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-import QtQuick 1.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.qtextracomponents 0.1
-
-FocusScope {
-    property alias delegate: list.delegate
-    property alias model: list.model
-    property alias view: list
-    property alias interactive: list.interactive
-    property alias currentIndex: list.currentIndex
-    signal countChanged()
-    
-    Component.onCompleted: {
-        list.countChanged.connect(countChanged)
-    }
-
-    ListView {
-        id: list
-        clip: true
-        focus: true
-        anchors {
-            left:   parent.left
-            right:  scrollBar.visible ? scrollBar.left : parent.right
-            top :   parent.top
-            bottom: parent.bottom
-        }
-        boundsBehavior: Flickable.StopAtBounds
-    }
-    PlasmaComponents.ScrollBar {
-        id: scrollBar
-        flickableItem: list
-        anchors {
-            right: parent.right
-            top: list.top
-            bottom: list.bottom
-        }
-    }
-}
diff --git a/print-manager/plasmoid/package/contents/ui/StatusView.qml b/print-manager/plasmoid/package/contents/ui/StatusView.qml
deleted file mode 100644 (file)
index 56d4afb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012  Daniel Nicoletti <dantti12@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 1.1
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.qtextracomponents 0.1
-
-Item {
-    id: statusView
-
-    property alias title: titleText.text
-    property string iconName: ""
-    property int iconSize: 128
-    property alias preferedHeight: column.height
-
-    Column {
-        id: column
-        width: parent.width
-        anchors.centerIn: parent
-        spacing: 4
-        Item {
-            id: image
-            width: iconSize
-            height: iconSize
-            anchors.horizontalCenter: parent.horizontalCenter
-
-            QIconItem {
-                id: statusIcon
-                anchors.fill: parent
-                icon: QIcon(iconName)
-            }
-        }
-        PlasmaComponents.Label {
-            id: titleText
-            width: parent.width
-            height: paintedHeight
-            wrapMode: Text.WordWrap
-            horizontalAlignment: Text.AlignHCenter
-        }
-    }
-}
diff --git a/print-manager/plasmoid/package/contents/ui/config.ui b/print-manager/plasmoid/package/contents/ui/config.ui
deleted file mode 100644 (file)
index b5df4e0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>printmanagerConfig</class>
- <widget class="QWidget" name="printmanagerConfig">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>611</width>
-    <height>378</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item row="3" column="0">
-    <widget class="QGroupBox" name="kcfg_filterPrinters">
-     <property name="title">
-      <string>Only show jobs from the following printers:</string>
-     </property>
-     <property name="checkable">
-      <bool>true</bool>
-     </property>
-     <layout class="QGridLayout" name="gridLayout_2">
-      <item row="0" column="0">
-       <widget class="ClassListWidget" name="kcfg_selectedPrinters">
-        <property name="showClasses">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="2" column="0">
-    <widget class="QRadioButton" name="kcfg_allJobs">
-     <property name="text">
-      <string>All jobs</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QRadioButton" name="kcfg_completedJobs">
-     <property name="text">
-      <string>Completed jobs only</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0">
-    <widget class="QRadioButton" name="kcfg_activeJobs">
-     <property name="text">
-      <string>Active jobs only</string>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>ClassListWidget</class>
-   <extends>QListView</extends>
-   <header>ClassListWidget.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/plasmoid/package/contents/ui/printmanager.qml b/print-manager/plasmoid/package/contents/ui/printmanager.qml
deleted file mode 100644 (file)
index d4dc632..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- *   Copyright 2012-2013 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2 or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-import QtQuick 1.1
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.printmanager 0.1 as PrintManager
-
-FocusScope   {
-    id: printmanager
-    state: "NO_PRINTER"
-
-    property int minimumWidth: horizontalLayout ? 500 : 300
-    property int minimumHeight: 270
-    
-    property string highlightPrinter
-    property bool horizontalLayout: false
-    property string filterPrinters
-    property string tooltipText
-    property string plasmoidStatus: "PassiveStatus"
-    property string jobsTooltipText
-    property string printersModelError: ""
-    property alias serverUnavailable: printersModel.serverUnavailable
-
-    property Component compactRepresentation: CompactRepresentation {
-        tooltipText: printmanager.tooltipText
-    }
-
-    PlasmaCore.Theme {
-        id: theme
-    }
-
-    Component.onCompleted: {
-        // This allows the plasmoid to shrink when the layout changes
-        plasmoid.aspectRatioMode = IgnoreAspectRatio
-        plasmoid.addEventListener('ConfigChanged', configChanged);
-        plasmoid.popupEvent.connect(popupEventSlot);
-        configChanged();
-    }
-
-    function configChanged() {
-        printersView.currentIndex = -1;
-        jobsView.currentIndex = -1;
-
-        if (plasmoid.readConfig("completedJobs") == true) {
-            jobsModel.setWhichJobs(PrintManager.JobModel.WhichCompleted);
-        } else if (plasmoid.readConfig("allJobs") == true) {
-            jobsModel.setWhichJobs(PrintManager.JobModel.WhichAll);
-        } else {
-            jobsModel.setWhichJobs(PrintManager.JobModel.WhichActive);
-        }
-
-        if (plasmoid.readConfig("filterPrinters") == true) {
-            filterPrinters = plasmoid.readConfig("selectedPrinters");
-        } else {
-            filterPrinters = "";
-        }
-
-        updateJobStatus();
-        updatePrinterStatus();
-    }
-
-    function updateJobStatus() {
-        var activeCount = jobsFilterModel.activeCount;
-        if (activeCount === 0) {
-            plasmoidStatus = "PassiveStatus";
-            jobsTooltipText = i18n("Print queue is empty");
-        } else {
-            plasmoidStatus = "ActiveStatus";
-            jobsTooltipText = i18np("There is one print job in the queue",
-                                    "There are %1 print jobs in the queue",
-                                    activeCount);
-        }
-    }
-
-    function updatePrinterStatus() {
-        var printersFilterCount = printersFilterModel.count;
-        if (printersFilterCount > 1) {
-            horizontalLayout = true;
-            printmanager.state = "JOBS_PRINTER";
-        } else if (printersFilterCount === 1) {
-            horizontalLayout = false;
-            printmanager.state = "JOBS_PRINTER";
-        } else if (printersFilterCount === 0 &&
-                   printersModel.count > 0) {
-            printmanager.state = "PRINTER_FILTER";
-        } else {
-            printmanager.state = "NO_PRINTER";
-        }
-    }
-
-    function popupEventSlot(popped) {
-        if (popped) {
-            printmanager.forceActiveFocus();
-            printersView.currentIndex = -1;
-            jobsView.currentIndex = -1;
-        } else {
-            updateJobStatus();
-        }
-    }
-
-    Column {
-        id: columnLayout
-        spacing: 2
-        anchors.fill: parent
-        opacity: 0
-
-        state: horizontalLayout ? "horizontal" : "vertical"
-        states: [
-            State {
-                name: "vertical"
-                ParentChange { target: printersView; parent: columnLayout }
-                ParentChange { target: headerSeparator; parent: columnLayout }
-                ParentChange { target: jobsView; parent: columnLayout }
-            },
-            State {
-                name: "horizontal"
-                ParentChange { target: printersView; parent: rowLayout }
-                ParentChange { target: headerSeparator; parent: rowLayout }
-                ParentChange { target: jobsView; parent: rowLayout }
-            }
-        ]
-    }
-    Row {
-        id: rowLayout
-        spacing: 2
-        anchors.fill: parent
-        opacity: 0
-        ListView {
-            id: printersView
-            focus: true
-            width:  horizontalLayout ? parent.width * 0.5 - headerSeparator.width : parent.width
-            height: horizontalLayout ? parent.height : 50
-            KeyNavigation.tab: jobsView
-            KeyNavigation.backtab: jobsView
-            currentIndex: -1
-            boundsBehavior: Flickable.StopAtBounds
-            model: PrintManager.PrinterSortFilterModel {
-                id: printersFilterModel
-                sourceModel: PrintManager.PrinterModel {
-                    id: printersModel
-                    onCountChanged: updatePrinterStatus()
-                    onError: printersModelError = errorTitle
-                }
-                filteredPrinters: filterPrinters
-            }
-            onCountChanged: updatePrinterStatus()
-            delegate: PrinterItem {
-                multipleItems: horizontalLayout
-            }
-        }
-        
-        PlasmaCore.SvgItem {
-            id: headerSeparator
-            svg: PlasmaCore.Svg {
-                id: lineSvg
-                imagePath: "widgets/line"
-            }
-            elementId: horizontalLayout ? "vertical-line" : "horizontal-line"
-            height:    horizontalLayout ? parent.height : lineSvg.elementSize("horizontal-line").height
-            width:     horizontalLayout ? lineSvg.elementSize("vertical-line").width : parent.width
-        }
-
-        ScrollableListView {
-            id: jobsView
-            width:  horizontalLayout ? parent.width * 0.5 - headerSeparator.width : parent.width
-            height: horizontalLayout ? parent.height : printmanager.height - headerSeparator.height - printersView.height
-            KeyNavigation.tab: printersView
-            KeyNavigation.backtab: printersView
-            currentIndex: -1
-            model: PrintManager.JobSortFilterModel {
-                id: jobsFilterModel
-                sourceModel: PrintManager.JobModel {
-                    id: jobsModel
-                }
-                filteredPrinters: filterPrinters
-                onActiveCountChanged: updateJobStatus()
-            }
-            delegate: JobItem {}
-        }
-    }
-
-    StatusView {
-        id: statusNoPrinter
-        anchors.fill: parent
-        opacity: 0
-        iconName: serverUnavailable ? "dialog-error" : "dialog-information"
-        title: serverUnavailable ?
-                   printersModelError :
-                   i18n("No printers have been configured or discovered")
-    }
-
-    StatusView {
-        id: statusPrinterFilter
-        anchors.fill: parent
-        opacity: 0
-        iconName: "dialog-information"
-        title: i18n("There is currently no available printer matching the selected filters")
-    }
-
-    states: [
-        State {
-            name: "NO_PRINTER"
-            PropertyChanges { target: statusNoPrinter; opacity: 1 }
-            PropertyChanges { target: printmanager; tooltipText: statusNoPrinter.title }
-            PropertyChanges { target: plasmoid; status: "PassiveStatus" }
-        },
-        State {
-            name: "PRINTER_FILTER"
-            PropertyChanges { target: statusPrinterFilter; opacity: 1 }
-            PropertyChanges { target: printmanager; tooltipText: statusPrinterFilter.title }
-            PropertyChanges { target: plasmoid; status: "PassiveStatus" }
-        },
-        State {
-            name: "JOBS_PRINTER"
-            PropertyChanges { target: columnLayout; opacity: 1 }
-            PropertyChanges { target: rowLayout; opacity: 1 }
-            PropertyChanges { target: printmanager; tooltipText: jobsTooltipText }
-            PropertyChanges { target: plasmoid; status: plasmoidStatus }
-        }
-    ]
-}
diff --git a/print-manager/plasmoid/package/contents/ui/private/RoundShadow.qml b/print-manager/plasmoid/package/contents/ui/private/RoundShadow.qml
deleted file mode 100644 (file)
index a1518b4..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *   Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
- *   Copyright (C) 2011 by Marco Martin <mart@kde.org>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library General Public License as
- *   published by the Free Software Foundation; either version 2, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU Library General Public License for more details
- *
- *   You should have received a copy of the GNU Library General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-/**Documented API
-Inherits:
-        Item
-
-Imports:
-        QtQuick 1.0
-        org.kde.plasma.core
-
-Description:
-        It is a simple Radio button which is using the plasma theme.
-        TODO Do we need more info?
-
-Properties:
-        TODO needs more info??
-**/
-
-import QtQuick 1.0
-import org.kde.plasma.core 0.1 as PlasmaCore
-
-Item {
-    id: main
-    state: parent.state
-    property alias imagePath: shadowSvg.imagePath
-    property string hoverElement: "hover"
-    property string focusElement: "focus"
-    property alias shadowElement: shadow.elementId
-
-    //used to tell apart this implementation with the touch components one
-    property bool hasOverState: true
-
-    PlasmaCore.Svg {
-        id: shadowSvg
-        imagePath: "widgets/actionbutton"
-    }
-
-    PlasmaCore.SvgItem {
-        id: hover
-        svg: shadowSvg
-        elementId: "hover"
-
-        anchors.fill: parent
-
-        opacity: 0
-    }
-
-    PlasmaCore.SvgItem {
-        id: shadow
-        svg: shadowSvg
-        elementId: "shadow"
-
-        anchors.fill: parent
-    }
-
-    states: [
-        State {
-            name: "shadow"
-            PropertyChanges {
-                target: shadow
-                opacity: 1
-            }
-            PropertyChanges {
-                target: hover
-                opacity: 0
-                elementId: hoverElement
-            }
-        },
-        State {
-            name: "hover"
-            PropertyChanges {
-                target: shadow
-                opacity: 0
-            }
-            PropertyChanges {
-                target: hover
-                opacity: 1
-                elementId: hoverElement
-            }
-        },
-        State {
-            name: "focus"
-            PropertyChanges {
-                target: shadow
-                opacity: 0
-            }
-            PropertyChanges {
-                target: hover
-                opacity: 1
-                elementId: focusElement
-            }
-        },
-        State {
-            name: "hidden"
-            PropertyChanges {
-                target: shadow
-                opacity: 0
-            }
-            PropertyChanges {
-                target: hover
-                opacity: 0
-                elementId: hoverElement
-            }
-        }
-    ]
-
-    transitions: [
-        Transition {
-            PropertyAnimation {
-                properties: "opacity"
-                duration: 250
-                easing.type: Easing.OutQuad
-            }
-        }
-    ]
-}
diff --git a/print-manager/plasmoid/package/metadata.desktop b/print-manager/plasmoid/package/metadata.desktop
deleted file mode 100644 (file)
index dfecd83..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-[Desktop Entry]
-Name=Manage Print Jobs
-Name[bg]=Управление на задачите за печат
-Name[bs]=Upravljanje poslovima štampe
-Name[ca]=Gestió de treballs d'impressió
-Name[ca@valencia]=Gestió de treballs d'impressió
-Name[cs]=Spravovat tiskové úlohy
-Name[da]=Håndtér udskriftsjob
-Name[de]=Druckaufträge verwalten
-Name[el]=Διαχείριση εργασιών εκτύπωσης
-Name[en_GB]=Manage Print Jobs
-Name[es]=Gestión de trabajos de impresión
-Name[et]=Trükitööde haldus
-Name[eu]=Kudeatu inprimatze-lanak
-Name[fi]=Tulostustöiden hallinta
-Name[fr]=Gère les tâches d'impression
-Name[ga]=Bainistigh Jabanna Priontála
-Name[gl]=Xestionar os traballos de impresión
-Name[hu]=Nyomtatási feladatok kezelése
-Name[ia]=Gere cargas pro imprimer
-Name[it]=Gestisci i processi di stampa
-Name[kk]=Басып шығаруды басқару
-Name[km]=គ្រប់គ្រង​ការងារ​បោះពុម្ព
-Name[ko]=인쇄 작업 관리
-Name[lt]=Tvarkyti spausdinimo užduotis
-Name[mr]=छपाई कार्ये व्यवस्थापन करा
-Name[nb]=Håndter utskriftsjobber
-Name[nds]=Druckopgaven plegen
-Name[nl]=Afdruktaken beheren
-Name[pa]=ਪਰਿੰਟ ਜਾਬ ਪਰਬੰਧ
-Name[pl]=Prace wydruku
-Name[pt]=Gerir as Tarefas de Impressão
-Name[pt_BR]=Gerenciar os trabalhos de impressão
-Name[ro]=Administrează sarcini de imprimare
-Name[ru]=Управление заданиями печати
-Name[sk]=Spravovať tlačové úlohy
-Name[sl]=Upravljajte tiskalna opravila
-Name[sr]=Управљање пословима штампања
-Name[sr@ijekavian]=Управљање пословима штампања
-Name[sr@ijekavianlatin]=Upravljanje poslovima štampanja
-Name[sr@latin]=Upravljanje poslovima štampanja
-Name[sv]=Hantera skrivarjobb
-Name[tr]=Yazdırma Görevlerini Yönet
-Name[uk]=Керування завданнями з друку
-Name[x-test]=xxManage Print Jobsxx
-Name[zh_CN]=管理打印任务
-Name[zh_TW]=管理列印工作
-Comment=List print jobs and manage them
-Comment[bg]=Показване и управление на задачите за печат
-Comment[bs]=Prikaz i upravljanje poslovima štampe
-Comment[ca]=Llista els treballs d'impressió i els gestiona
-Comment[ca@valencia]=Llista els treballs d'impressió i els gestiona
-Comment[cs]=Vypsat tiskové úlohy a spravovat je
-Comment[da]=Vis udskriftsjob og håndtér dem
-Comment[de]=Druckaufträge anzeigen und verwalten
-Comment[el]=Εμφάνιση και διαχείριση των εργασιών εκτύπωσης
-Comment[en_GB]=List print jobs and manage them
-Comment[es]=Listar los trabajos de impresión y gestionarlos
-Comment[et]=Trükitööde kuvamine ja nende haldamine
-Comment[eu]=Zerrendatu eta kudeatu inprimatze-lanak
-Comment[fi]=Luettele tulostustyöt ja hallitse niitä
-Comment[fr]=Liste les tâches d'impression et les gère
-Comment[gl]=Listar os traballos de impresión e xestionalos.
-Comment[hu]=Nyomtatási feladatok listázása és kezelése
-Comment[ia]=Lista cargas de imprimer e gere los
-Comment[it]=Elenca i processi di stampa e li gestisce
-Comment[kk]=Басу тапсырмалар кезегі мен оны басқару
-Comment[km]=រាយ​ការងារ​បោះពុម្ព​ និង​គ្រប់គ្រង​ពួកវា
-Comment[ko]=인쇄 작업을 보여 주고 관리하기
-Comment[lt]=Rikiuoti spausdinimo užduotis ir jas tvarkyti
-Comment[mr]=छपाई कार्यांची यादी व व्यवस्थापन करतो
-Comment[nb]=List utskriftsjobber og håndter dem
-Comment[nds]=Druckopgaven oplisten un plegen
-Comment[nl]=Toon afdruktaken en beheer ze
-Comment[pl]=Pokaż listę prac wydruku i zarządzaj nimi
-Comment[pt]=Imprimir as tarefas de impressão e geri-las
-Comment[pt_BR]=Lista os trabalhos de impressão e os gerencia
-Comment[ro]=Enumeră sarcinile de imprimare și le gestionează
-Comment[ru]=Показ списка заданий печати и управление ими
-Comment[sk]=Vypísať tlačové úlohy a spravovať ich
-Comment[sl]=Pregledovanje in upravljanje tiskalnih opravil
-Comment[sr]=Прегледајте и управљајте пословима штампања
-Comment[sr@ijekavian]=Прегледајте и управљајте пословима штампања
-Comment[sr@ijekavianlatin]=Pregledajte i upravljajte poslovima štampanja
-Comment[sr@latin]=Pregledajte i upravljajte poslovima štampanja
-Comment[sv]=Lista skrivarjobb och hantera dem
-Comment[tr]=Yazdırma görevlerini listele ve bunları yönet
-Comment[uk]=Показ списку завдань і керування ними
-Comment[x-test]=xxList print jobs and manage themxx
-Comment[zh_CN]=显示和管理打印任务
-Comment[zh_TW]=列出列印工作並管理
-
-Icon=printer
-Type=Service
-X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet
-
-X-Plasma-API=declarativeappletscript
-X-Plasma-MainScript=ui/printmanager.qml
-X-Plasma-DefaultSize=650,270
-X-Plasma-NotificationArea=true
-X-Plasma-ConfigPlugins=kcm_printer_manager
-X-Plasma-OptionalExtensions=LaunchApp
-
-X-KDE-PluginInfo-Author=Daniel Nicoletti
-X-KDE-PluginInfo-Email=dantti12@gmail.com
-X-KDE-PluginInfo-Name=org.kde.printmanager
-X-KDE-PluginInfo-Version=0.3
-X-KDE-PluginInfo-Website=http://www.kde.org
-X-KDE-PluginInfo-Category=Utilities
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=true
-
diff --git a/print-manager/print-manager-kded/CMakeLists.txt b/print-manager/print-manager-kded/CMakeLists.txt
deleted file mode 100644 (file)
index efc0c93..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-set(printmanagerkded_SRCS
-    NewPrinterNotification.cpp
-    PrintManagerKded.cpp
-)
-
-qt4_add_dbus_adaptor(printmanagerkded_SRCS
-    com.redhat.NewPrinterNotification.xml
-    NewPrinterNotification.h
-    NewPrinterNotification
-)
-
-kde4_add_plugin(kded_printmanager ${printmanagerkded_SRCS})
-
-target_link_libraries(kded_printmanager
-    ${KDE4_KDEUI_LIBS}
-    kcupslib
-)
-
-install(TARGETS kded_printmanager DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-install(FILES printmanager.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}/kded)
-install(FILES printmanager.notifyrc DESTINATION ${KDE4_DATA_INSTALL_DIR}/printmanager)
diff --git a/print-manager/print-manager-kded/NewPrinterNotification.cpp b/print-manager/print-manager-kded/NewPrinterNotification.cpp
deleted file mode 100644 (file)
index 6478d4b..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "NewPrinterNotification.h"
-#include "newprinternotificationadaptor.h"
-
-#include <KLocale>
-#include <KNotification>
-#include <KIcon>
-#include <KToolInvocation>
-#include <KDebug>
-
-#include <KCupsRequest.h>
-
-#include <QThread>
-#include <QPointer>
-#include <QtDBus/QDBusMessage>
-#include <QtDBus/QDBusConnection>
-#include <QtDBus/QDBusServiceWatcher>
-#include <QtDBus/QDBusReply>
-
-#define STATUS_SUCCESS        0
-#define STATUS_MODEL_MISMATCH 1
-#define STATUS_GENERIC_DRIVER 2
-#define STATUS_NO_DRIVER      3
-
-#define PRINTER_NAME "PrinterName"
-#define DEVICE_ID "DeviceId"
-
-NewPrinterNotification::NewPrinterNotification()
-{
-    // Make sure the password dialog is created on the main threas
-    KCupsConnection::global();
-
-    // Make all our init code run on the thread since
-    // the DBus calls were made blocking
-    QTimer::singleShot(0, this, SLOT(init()));
-
-    m_thread = new QThread(this);
-    moveToThread(m_thread);
-    m_thread->start();
-}
-
-NewPrinterNotification::~NewPrinterNotification()
-{
-}
-
-void NewPrinterNotification::GetReady()
-{
-    kDebug();
-    // This method is all about telling the user a new printer was detected
-    KNotification *notify = new KNotification("GetReady");
-    notify->setComponentData(KComponentData("printmanager"));
-    notify->setPixmap(KIcon("printer").pixmap(64, 64));
-    notify->setTitle(i18n("A New Printer was detected"));
-    notify->setText(i18n("Configuring new printer..."));
-    notify->sendEvent();
-}
-
-//status: 0
-//name: PSC_1400_series
-//mfg: HP
-//mdl: PSC 1400 series
-//des:
-//cmd: LDL,MLC,PML,DYN
-void NewPrinterNotification::NewPrinter(int status,
-                                        const QString &name,
-                                        const QString &make,
-                                        const QString &model,
-                                        const QString &description,
-                                        const QString &cmd)
-{
-    kDebug() << status << name << make << model << description << cmd;
-    // 1
-    // "usb://Samsung/SCX-3400%20Series?serial=Z6Y1BQAC500079K&interface=1"
-    // mfg "Samsung"
-    // mdl "SCX-3400 Series" "" "SPL,FWV,PIC,BDN,EXT"
-    // This method is all about telling the user a new printer was detected
-    KNotification *notify = new KNotification("NewPrinterNotification");
-    notify->setComponentData(KComponentData("printmanager"));
-    notify->setPixmap(KIcon("printer").pixmap(64, 64));
-    notify->setFlags(KNotification::Persistent);
-
-    QString title;
-    QString text;
-    QString devid;
-    QStringList actions;
-    devid = QString("MFG:%1;MDL:%2;DES:%3;CMD:%4;").arg(make, model, description, cmd);
-
-    if (name.contains(QLatin1Char('/'))) {
-        // name is a URI, no queue was generated, because no suitable
-        // driver was found
-        title = i18n("Missing printer driver");
-        if (!make.isEmpty() && !model.isEmpty()) {
-            text = i18n("No printer driver for %1 %2.", make, model);
-        } else if (!description.isEmpty()) {
-            text = i18n("No printer driver for %1.", description);
-        } else {
-            text = i18n("No driver for this printer.");
-        }
-
-        actions << i18n("Search");
-        connect(notify, SIGNAL(action1Activated()), this, SLOT(setupPrinter()));
-    } else {
-        // name is the name of the queue which hal_lpadmin has set up
-        // automatically.
-
-        if (status < STATUS_GENERIC_DRIVER) {
-            title = i18n("The New Printer was Added");
-        } else {
-            title = i18n("The New Printer is Missing Drivers");
-        }
-
-        QStringList attr;
-        attr << KCUPS_PRINTER_MAKE_AND_MODEL;
-
-        // Get the new printer attributes
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        request->getPrinterAttributes(name, false, attr);
-        request->waitTillFinished();
-        if (!request) {
-            return;
-        }
-
-        QString driver;
-        // Get the new printer driver
-        if (!request->printers().isEmpty()){
-            KCupsPrinter printer = request->printers().first();
-            driver = printer.makeAndModel();
-        }
-        request->deleteLater();
-
-        QString ppdFileName;
-        request = new KCupsRequest;
-        request->getPrinterPPD(name);
-        request->waitTillFinished();
-        if (!request) {
-            return;
-        }
-        ppdFileName = request->printerPPD();
-        request->deleteLater();
-
-        // Get a list of missing executables
-        QStringList missingExecutables = getMissingExecutables(ppdFileName);
-
-        if (!missingExecutables.isEmpty()) {
-            // TODO check with PackageKit about missing drivers
-            kWarning();
-        } else if (status == STATUS_SUCCESS) {
-            text = i18n("'%1' is ready for printing.", name);
-            actions << i18n("Print test page");
-            connect(notify, SIGNAL(action1Activated()), this, SLOT(printTestPage()));
-            actions << i18n("Configure");
-            connect(notify, SIGNAL(action2Activated()), this, SLOT(configurePrinter()));
-        } else {
-            // Model mismatch
-
-
-            // The cups request might have failed
-            if (driver.isEmpty()) {
-                text = i18n("'%1' has been added, please check its driver.", name);
-                actions << i18n("Configure");
-                connect(notify, SIGNAL(action1Activated()), this, SLOT(configurePrinter()));
-            } else {
-                text = i18n("'%1' has been added, using the '%2' driver.", name, driver);
-                actions << i18n("Print test page");
-                connect(notify, SIGNAL(action1Activated()), this, SLOT(printTestPage()));
-                actions << i18n("Find driver");
-                connect(notify, SIGNAL(action2Activated()), this, SLOT(findDriver()));
-            }
-        }
-    }
-    notify->setTitle(title);
-    notify->setText(text);
-    notify->setProperty(PRINTER_NAME, name);
-    notify->setProperty(DEVICE_ID, devid);
-    notify->setActions(actions);
-    notify->sendEvent();
-}
-
-void NewPrinterNotification::init()
-{
-    // Creates our new adaptor
-    (void) new NewPrinterNotificationAdaptor(this);
-
-    // Register the com.redhat.NewPrinterNotification interface
-    if (!registerService()) {
-        // in case registration fails due to another user or application running
-        // keep an eye on it so we can register when available
-        QDBusServiceWatcher *watcher;
-        watcher = new QDBusServiceWatcher(QLatin1String("com.redhat.NewPrinterNotification"),
-                                          QDBusConnection::systemBus(),
-                                          QDBusServiceWatcher::WatchForUnregistration,
-                                          this);
-        connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(registerService()));
-    }
-}
-
-bool NewPrinterNotification::registerService()
-{
-    if (!QDBusConnection::systemBus().registerService("com.redhat.NewPrinterNotification")) {
-        kDebug() << "unable to register service to dbus";
-        return false;
-    }
-
-    if (!QDBusConnection::systemBus().registerObject("/com/redhat/NewPrinterNotification", this)) {
-        kDebug() << "unable to register object to dbus";
-        return false;
-    }
-    return true;
-}
-
-void NewPrinterNotification::configurePrinter()
-{
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("/"),
-                                             QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("ConfigurePrinter"));
-    // TODO setup wid
-    message << sender()->property(PRINTER_NAME);
-    QDBusConnection::sessionBus().send(message);
-}
-
-void NewPrinterNotification::searchDrivers()
-{
-}
-
-void NewPrinterNotification::printTestPage()
-{
-    kDebug();
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    request->printTestPage(sender()->property(PRINTER_NAME).toString(), false);
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void NewPrinterNotification::findDriver()
-{
-    kDebug();
-    // This function will show the PPD browser dialog
-    // to choose a better PPD to the already added printer
-    QStringList args;
-    args << "--change-ppd";
-    args << sender()->property(PRINTER_NAME).toString();
-    KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
-}
-
-void NewPrinterNotification::installDriver()
-{
-    kDebug();
-}
-
-void NewPrinterNotification::setupPrinter()
-{
-    kDebug();
-    // This function will show the PPD browser dialog
-    // to choose a better PPD, queue name, location
-    // in this case the printer was not added
-    QStringList args;
-    args << "--new-printer-from-device";
-    args << sender()->property(PRINTER_NAME).toString() + QLatin1Char('/') + sender()->property(DEVICE_ID).toString();
-    KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
-}
-
-QStringList NewPrinterNotification::getMissingExecutables(const QString &ppdFileName) const
-{
-    kDebug();
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("/org/fedoraproject/Config/Printing"),
-                                             QLatin1String("org.fedoraproject.Config.Printing"),
-                                             QLatin1String("MissingExecutables"));
-    message << ppdFileName;
-    QDBusReply<QStringList> reply = QDBusConnection::sessionBus().call(message);
-    if (!reply.isValid()) {
-        kWarning() << "Invalid reply" << reply.error();
-    }
-    return reply;
-}
diff --git a/print-manager/print-manager-kded/NewPrinterNotification.h b/print-manager/print-manager-kded/NewPrinterNotification.h
deleted file mode 100644 (file)
index 643ff4c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef NEW_PRINTER_NOTIFICATION_H
-#define NEW_PRINTER_NOTIFICATION_H
-
-#include <QtDBus/QDBusContext>
-#include <QThread>
-
-class NewPrinterNotification : public QObject, protected QDBusContext
-{
-    Q_OBJECT
-    Q_CLASSINFO("D-Bus Interface", "com.redhat.NewPrinterNotification")
-public:
-    NewPrinterNotification();
-    ~NewPrinterNotification();
-
-public slots:
-    void GetReady();
-    void NewPrinter(int status, const QString &name, const QString &make, const QString &model, const QString &des, const QString &cmd);
-
-private slots:
-    void init();
-    bool registerService();
-    void configurePrinter();
-    void searchDrivers();
-    void printTestPage();
-    void findDriver();
-    void installDriver();
-    void setupPrinter();
-
-private:
-    QStringList getMissingExecutables(const QString &ppdFileName) const;
-    QThread *m_thread;
-    QString m_destName;
-};
-
-#endif // NEW_PRINTER_NOTIFICATION_H
diff --git a/print-manager/print-manager-kded/PrintManagerKded.cpp b/print-manager/print-manager-kded/PrintManagerKded.cpp
deleted file mode 100644 (file)
index 51d5492..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrintManagerKded.h"
-
-#include "NewPrinterNotification.h"
-
-#include <QTimer>
-
-#include <KPluginFactory>
-
-K_PLUGIN_FACTORY(PrintDFactory, registerPlugin<PrintManagerKded>();)
-K_EXPORT_PLUGIN(PrintDFactory("printmanager", "print-manager"))
-
-PrintManagerKded::PrintManagerKded(QObject *parent, const QVariantList &args) :
-    KDEDModule(parent),
-    m_newPrinterNotification(0)
-{
-    Q_UNUSED(args)
-
-    QTimer::singleShot(0, this, SLOT(loadThread()));
-}
-
-PrintManagerKded::~PrintManagerKded()
-{
-    if (m_newPrinterNotification) {
-        m_newPrinterNotification->deleteLater();
-    }
-}
-
-void PrintManagerKded::loadThread()
-{
-    m_newPrinterNotification = new NewPrinterNotification;
-}
diff --git a/print-manager/print-manager-kded/PrintManagerKded.h b/print-manager/print-manager-kded/PrintManagerKded.h
deleted file mode 100644 (file)
index 388bb72..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTMANAGERKDED_H
-#define PRINTMANAGERKDED_H
-
-#include <KDEDModule>
-
-#include <QtCore/qvariant.h>
-
-class NewPrinterNotification;
-class PrintManagerKded : public KDEDModule
-{
-    Q_OBJECT
-public:
-    PrintManagerKded(QObject *parent, const QVariantList &args);
-    ~PrintManagerKded();
-    
-private slots:
-    void loadThread();
-
-private:
-    NewPrinterNotification *m_newPrinterNotification;
-};
-
-#endif // PRINTMANAGERKDED_H
diff --git a/print-manager/print-manager-kded/com.redhat.NewPrinterNotification.xml b/print-manager/print-manager-kded/com.redhat.NewPrinterNotification.xml
deleted file mode 100644 (file)
index cb70e14..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/com/redhat/NewPrinterNotification">
-    <interface name="com.redhat.NewPrinterNotification">
-        <method name="GetReady">
-        </method>
-        <method name="NewPrinter">
-            <arg direction="in" type="i" name="status" />
-            <arg direction="in" type="s" name="name" />
-            <arg direction="in" type="s" name="mfg" />
-            <arg direction="in" type="s" name="mdl" />
-            <arg direction="in" type="s" name="des" />
-            <arg direction="in" type="s" name="cmd" />
-        </method>
-    </interface>
-</node>
diff --git a/print-manager/print-manager-kded/printmanager.desktop b/print-manager/print-manager-kded/printmanager.desktop
deleted file mode 100644 (file)
index 1d383cd..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-[Desktop Entry]
-Type=Service
-
-X-KDE-ServiceTypes=KDEDModule
-X-KDE-Library=printmanager
-X-KDE-Kded-autoload=true
-X-KDE-Kded-phase=1
-
-Name=Print Manager
-Name[bg]=Управление на принтери
-Name[bs]=Menadžer štampe
-Name[ca]=Gestor d'impressió
-Name[ca@valencia]=Gestor d'impressió
-Name[cs]=Správce tisku
-Name[da]=Udskriftshåndtering
-Name[de]=Druckerverwaltung
-Name[el]=Διαχειριστής εκτυπώσεων
-Name[en_GB]=Print Manager
-Name[es]=Gestor de impresión
-Name[et]=Trükkimise haldur
-Name[eu]=Inprimatze-kudeatzailea
-Name[fi]=Tulostuksenhallinta
-Name[fr]=Gestionnaire d'impression
-Name[ga]=Bainisteoir Priontála
-Name[gl]=Xestor da impresión
-Name[hu]=Nyomtatáskezelő
-Name[ia]=Gerente de imprimer
-Name[it]=Gestione stampanti
-Name[kk]=Басып шығару менеджері
-Name[km]=កម្មវិធី​គ្រប់គ្រង​ការ​បោះពុម្ព
-Name[ko]=인쇄 관리자
-Name[lt]=Spausdinimo tvarkyklė
-Name[mr]=छपाई व्यवस्थापक
-Name[nb]=Utskriftsbehandler
-Name[nds]=Druckpleger
-Name[nl]=Afdrukbeheer
-Name[pa]=ਪਰਿੰਟ ਮੈਨੇਜਰ
-Name[pl]=Zarządzanie wydrukiem
-Name[pt]=Gestor de Impressão
-Name[pt_BR]=Gerenciador de impressão
-Name[ro]=Administrator de imprimare
-Name[ru]=Диспетчер печати
-Name[sk]=Správca tlače
-Name[sl]=Upravljalnik tiskanja
-Name[sr]=Менаџер штампања
-Name[sr@ijekavian]=Менаџер штампања
-Name[sr@ijekavianlatin]=Menadžer štampanja
-Name[sr@latin]=Menadžer štampanja
-Name[sv]=Utskriftshanterare
-Name[tr]=Yazdırma Yöneticisi
-Name[uk]=Керування друком
-Name[x-test]=xxPrint Managerxx
-Name[zh_CN]=打印机管理器
-Name[zh_TW]=列印管理員
-Comment=Inform when a new printer is detected, and print problems
-Comment[bg]=Известяване при засичане на нов принтер и проблеми с печата
-Comment[bs]=Informiši ako je novi štampač prepoznat i prikaži probleme
-Comment[ca]=Informa quan es detecta una impressora nova, dels problemes d'impressió
-Comment[ca@valencia]=Informa quan es detecta una impressora nova, dels problemes d'impressió
-Comment[cs]=Informovat, když je detekována nová tiskárna a při tiskových problémech
-Comment[da]=Giv besked når en ny printer detekteres eller der er udskriftsproblemer
-Comment[de]=Benachrichtigung über neu erkannte Drucker und Probleme beim Drucken
-Comment[el]=Ειδοποίηση κατά την ανίχνευση νέου εκτυπωτή και παρουσίαση προβλημάτων
-Comment[en_GB]=Inform when a new printer is detected, and print problems
-Comment[es]=Informar cuando se detecta una nueva impresora y de los problemas de impresión
-Comment[et]=Teavitamine uue printeri tuvastamisest ja trükkimisprobleemidest
-Comment[eu]=Informatu inprimagailu berri bat detektatzen denean, eta inprimatze arazoak daudenean
-Comment[fi]=Ilmoita, kun havaitaan uusi tulostin tai tulostusongelmia
-Comment[fr]=Informe lors de la détection d'une nouvelle imprimante et affiche les problèmes
-Comment[gl]=Informar cando se detecte unha nova impresora, e ante calquera problema.
-Comment[hu]=Informálás új nyomtató észleléséről, és a problémák nyomtatása
-Comment[ia]=Informa quando un nove imrimitor es relevate, e problemas de imprimer
-Comment[it]=Informa quando viene rilevata una nuova stampante o ci sono problemi di stampa
-Comment[kk]=Жаңа принтер байқалғанын және басу мәселелер туралы хабарлау
-Comment[km]=ប្រាប់​នៅ​ពេល​រកឃើញ​ម៉ាស៊ីន​បោះពុម្ព​ថ្មី និង​បញ្ហា​ក្នុង​ការ​បោះពុម្ព
-Comment[ko]=새 프린터가 감지되거나 문제가 생겼을 때 알림
-Comment[lt]=Informuoti kai aptiktas naujas spausdintuvas ir esant spausdinimo problemoms
-Comment[mr]=नवीन छपाईयंत्र सापडल्यास व छपाई समस्या झाल्यास सूचना द्या
-Comment[nb]=Si fra når det oppdages en ny skriver, og skriv ut problemer
-Comment[nds]=Informeren, wenn en nieg Drucker opdeckt warrt, un Problemen wiesen
-Comment[nl]=Toon wanneer een nieuwe printer is ontdekt en toon problemen
-Comment[pl]=Informuj o wykryciu nowej drukarki i o problemach z wydrukiem
-Comment[pt]=Informar quando detectar uma nova impressora ou erros de impressão
-Comment[pt_BR]=Informa quando uma nova impressora for detectada ou ocorrerem erros de impressão
-Comment[ro]=Informează cînd este descoperită o nouă imprimantă, notifică problemele de tipărire
-Comment[ru]=Сообщает об обнаружении новых принтеров и проблем с печатью
-Comment[sk]=Informuje, keď sa nájde nová tlačiareň, a vytlačí problémy
-Comment[sl]=Obveščanje o zaznavi novih tiskalnikov in težav s tiskanjem
-Comment[sr]=Обавештава када се открије нови штампач и исписује проблеме
-Comment[sr@ijekavian]=Обавештава када се открије нови штампач и исписује проблеме
-Comment[sr@ijekavianlatin]=Obaveštava kada se otkrije novi štampač i ispisuje probleme
-Comment[sr@latin]=Obaveštava kada se otkrije novi štampač i ispisuje probleme
-Comment[sv]=Informera om när en ny skrivare detekteras, och om utskriftsproblem
-Comment[tr]=Yeni bir yazıcı algılandığında ve yazdırma sorunlarında bilgilendir
-Comment[uk]=Повідомлення щодо виявлення принтера та щодо проблем з принтером
-Comment[x-test]=xxInform when a new printer is detected, and print problemsxx
-Comment[zh_CN]=提示新检测到的打印机,并显示存在打问题
-Comment[zh_TW]=偵測到新印表機與列印問題時發出通知
diff --git a/print-manager/print-manager-kded/printmanager.notifyrc b/print-manager/print-manager-kded/printmanager.notifyrc
deleted file mode 100644 (file)
index e066246..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-[Global]
-IconName=printer
-Name=printmanager
-Name[bg]=printmanager
-Name[bs]=printmanager
-Name[ca]=printmanager
-Name[ca@valencia]=printmanager
-Name[cs]=printmanager
-Name[da]=udskriftshåndtering
-Name[de]=Druckerverwaltung
-Name[el]=διαχειριστής εκτυπώσεων
-Name[en_GB]=printmanager
-Name[es]=Gestor de impresión
-Name[et]=Trükkimise haldur
-Name[eu]=inprimatze-kudeatzailea
-Name[fi]=Tulostuksenhallinta
-Name[fr]=gestionnaire d'impression
-Name[ga]=Bainisteoir Priontála
-Name[gl]=Xestor da impresión
-Name[hu]=printmanager
-Name[ia]=printmanager(Gerente de imprimitores)
-Name[it]=printmanager
-Name[kk]=басуды басқару
-Name[km]=កម្មវិធី​គ្រប់គ្រង​ការ​បោះពុម្ព
-Name[ko]=printmanager
-Name[lt]=printmanager
-Name[mr]=छपाई व्यवस्थापक
-Name[nb]=utskriftsbehandler
-Name[nds]=Druckpleger
-Name[nl]=afdrukbeheerder
-Name[pa]=printmanager
-Name[pl]=Zarządzanie wydrukiem
-Name[pt]=printmanager
-Name[pt_BR]=printmanager
-Name[ro]=printmanager
-Name[ru]=Диспетчер печати
-Name[sk]=printmanager
-Name[sl]=printmanager
-Name[sr]=Менаџер штампања
-Name[sr@ijekavian]=Менаџер штампања
-Name[sr@ijekavianlatin]=Menadžer štampanja
-Name[sr@latin]=Menadžer štampanja
-Name[sv]=Utskriftshanterare
-Name[tr]=printmanager
-Name[uk]=керування друком
-Name[x-test]=xxprintmanagerxx
-Name[zh_CN]=打印管理器
-Name[zh_TW]=列印管理員
-Comment=Notifies when a new printer is detected
-Comment[bg]=Уведомява при засичане на нов принтер
-Comment[bs]=Informiše kada je novi printer prepoznat
-Comment[ca]=Notifica quan es detecta una impressora nova
-Comment[ca@valencia]=Notifica quan es detecta una impressora nova
-Comment[cs]=Informuje o zjištění nových tiskáren
-Comment[da]=Bekendtgør når en ny printer detekteres
-Comment[de]=Benachrichtigung wenn ein neuer Drucker erkannt wurde
-Comment[el]=Ειδοποίηση κατά την ανίχνευση νέου εκτυπωτή
-Comment[en_GB]=Notifies when a new printer is detected
-Comment[es]=Informa cuando se detecta una nueva impresora
-Comment[et]=Teavitamine uue printeri tuvastamisest
-Comment[eu]=Inprimagailu berri bat detektatzen denean jakinarazten du
-Comment[fi]=Ilmoittaa, kun havaitaan uusi tulostin
-Comment[fr]=Envoie une notification lors de la détection d'une nouvelle imprimante
-Comment[gl]=Notifícao cando se detecta unha nova impresora.
-Comment[hu]=Értesítés új nyomtató észleléséről
-Comment[ia]=Notifica quando un nove imprimitor es relevate
-Comment[it]=Notifica quando viene rilevata una nuova stampante
-Comment[kk]=Жаңа принтер байқалғанын хабарлау
-Comment[km]=ជូនដំណឹង​នៅ​ពេល​រកឃើញ​ម៉ាស៊ីន​បោះពុម្ព​ថ្មី
-Comment[ko]=새 프린터가 감지되었을 때 알림
-Comment[lt]=Informuoja kai aptinkamas naujas spausdintuvas
-Comment[mr]=नवीन छपाईयंत्र सापडल्यास सूचना देतो
-Comment[nb]=Varsler når en ny skriver oppdages
-Comment[nds]=Gifft Bescheed, wenn en nieg Drucker opdeckt warrt
-Comment[nl]=Toont wanneer een nieuwe printer is ontdekt
-Comment[pl]=Powiadamia, gdy zostanie wykryta nowa drukarka
-Comment[pt]=Notifica quando é detectada uma nova impressora
-Comment[pt_BR]=Avisa quando uma nova impressora for detectada
-Comment[ro]=Notifică la descoperirea unei noi imprimante
-Comment[ru]=Уведомления при обнаружении нового принтера
-Comment[sk]=Upozorní, keď sa nájde nová tlačiareň
-Comment[sl]=Obvešča o zaznavi novega tiskalnika
-Comment[sr]=Обавештава када се дода нови штампач
-Comment[sr@ijekavian]=Обавештава када се дода нови штампач
-Comment[sr@ijekavianlatin]=Obaveštava kada se doda novi štampač
-Comment[sr@latin]=Obaveštava kada se doda novi štampač
-Comment[sv]=Underrättar om när en ny skrivare detekteras
-Comment[tr]=Yeni bir yazıcı tespit edildiğinde bildirir
-Comment[uk]=Сповіщає про виявлення нового принтера
-Comment[x-test]=xxNotifies when a new printer is detectedxx
-Comment[zh_CN]=提示新检测到的打印机
-Comment[zh_TW]=偵測到新印表機時發出通知
-
-[Event/GetReady]
-Name=A New Printer was detected
-Name[bg]=Засечен е нов принтер
-Name[bs]=Novi printer je prepoznat
-Name[ca]=S'ha detectat una impressora nova
-Name[ca@valencia]=S'ha detectat una impressora nova
-Name[cs]=Byla zjištěna nová tiskárna
-Name[da]=En ny printer er blevet fundet
-Name[de]=Ein neuer Drucker wurde erkannt
-Name[el]=Ανιχνεύθηκε ένας νέος εκτυπωτής
-Name[en_GB]=A New Printer was detected
-Name[es]=Se ha detectado una nueva impresora
-Name[et]=Leiti uus printer
-Name[eu]=Inprimagailu berri bat detektatu da
-Name[fi]=Havaittiin uusi tulostin
-Name[fr]=Une nouvelle imprimante a été détectée
-Name[gl]=Detectouse unha nova impresora
-Name[hu]=Új nyomtató lett észlelve
-Name[ia]=Un nove imprimitor esseva relevate
-Name[it]=È stata rilevata una nuova stampante
-Name[kk]=Жаңа принтер байқалды
-Name[km]=រក​ឃើញ​ម៉ាស៊ីន​បោះ​ពុម្ព​ថ្មី
-Name[ko]=새 프린터가 감지됨
-Name[lt]=Aptiktas naujas spausdintuvas
-Name[mr]=नवीन छपाईयंत्र सापडले
-Name[nb]=En ny skriver ble funnet
-Name[nds]=En nieg Drucker wöör funnen
-Name[nl]=Er is een nieuwe printer ontdekt
-Name[pa]=ਨਵਾਂ ਪਰਿੰਟਰ ਖੋਜਿਆ ਗਿਆ
-Name[pl]=Znaleziono nową drukarkę
-Name[pt]=Foi detectada uma nova impressora
-Name[pt_BR]=Uma nova impressora foi detectada
-Name[ro]=A fost descoperită o nouă imprimantă
-Name[ru]=Обнаружен новый принтер
-Name[sk]=Bola zistená nová tlačiareň
-Name[sl]=Zaznan je bil nov tiskalnik
-Name[sr]=Откривен је нови штампач
-Name[sr@ijekavian]=Откривен је нови штампач
-Name[sr@ijekavianlatin]=Otkriven je novi štampač
-Name[sr@latin]=Otkriven je novi štampač
-Name[sv]=En ny skrivare detekterades
-Name[tr]=Yeni Bir Yazıcı tespit edildi
-Name[ug]=بىر يېڭى پرىنتېر بايقالدى
-Name[uk]=Виявлено новий принтер
-Name[x-test]=xxA New Printer was detectedxx
-Name[zh_CN]=检测到一个新的打印机
-Name[zh_TW]=偵測到新印表機
-Action=Sound|Popup
-
-[Event/NewPrinterNotification]
-Name=The New Printer was added
-Name[bg]=Новият принтер беше добавен
-Name[bs]=Novi printer je dodan
-Name[ca]=S'ha afegit la impressora nova
-Name[ca@valencia]=S'ha afegit la impressora nova
-Name[cs]=Nová tiskárna byla přidána
-Name[da]=Den ny printer er blevet tilføjet
-Name[de]=Der neue Drucker wurde hinzugefügt
-Name[el]=Προστέθηκε ένας νέος εκτυπωτής
-Name[en_GB]=The New Printer was added
-Name[es]=Se ha añadido la nueva impresora
-Name[et]=Lisati uus printer
-Name[eu]=Inprimagailu berria gehitu da
-Name[fi]=Lisättiin uusi tulostin
-Name[fr]=La nouvelle imprimante a été ajoutée
-Name[gl]=Engadiuse a nova impresora
-Name[hu]=Új nyomtató lett hozzáadva
-Name[ia]=Un nove imprimitor esseva addite
-Name[it]=La nuova stampante è stata aggiunta
-Name[kk]=Жаңа принтер қосылды
-Name[km]=រក​ឃើញ​ម៉ាស៊ីន​បោះ​ពុម្ព​ថ្មី
-Name[ko]=새 프린터가 추가됨
-Name[lt]=Naujas spausdintuvas buvo pridėtas
-Name[mr]=नवीन छपाईयंत्र जोडले
-Name[nb]=Den nye skriveren ble lagt til
-Name[nds]=De niege Drucker wöör toföögt
-Name[nl]=De nieuwe printer is toegevoegd
-Name[pa]=ਨਵਾਂ ਪਰਿੰਟਰ ਜੋੜਿਆ ਗਿਆ ਸੀ
-Name[pl]=Dodano nową drukarkę
-Name[pt]=Foi adicionada a impressora nova
-Name[pt_BR]=A nova impressora foi adicionada
-Name[ro]=Noua imprimantă a fost adăugată
-Name[ru]=Добавлен новый принтер
-Name[sk]=Nová tlačiareň bola pridaná
-Name[sl]=Novi tiskalnik je bil dodan
-Name[sr]=Додат је нови штампач
-Name[sr@ijekavian]=Додат је нови штампач
-Name[sr@ijekavianlatin]=Dodat je novi štampač
-Name[sr@latin]=Dodat je novi štampač
-Name[sv]=Den nya skrivaren har lagts till
-Name[tr]=Yeni Yazıcı eklendi
-Name[uk]=Додано новий принтер
-Name[x-test]=xxThe New Printer was addedxx
-Name[zh_CN]=添加了新打印机
-Name[zh_TW]=新印表機已加入
-Action=Sound|Popup
diff --git a/print-manager/printer-manager-kcm/CMakeLists.txt b/print-manager/printer-manager-kcm/CMakeLists.txt
deleted file mode 100644 (file)
index 3fedd48..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-set(kcm_print_SRCS
-    PrinterDelegate.cpp
-    PrinterDescription.cpp
-    PrintKCM.cpp
-    PrintKCM.ui
-    PrinterDescription.ui
-)
-
-kde4_add_plugin(kcm_printer_manager ${kcm_print_SRCS})
-
-target_link_libraries(kcm_printer_manager
-    ${KDE4_KDEUI_LIBS}
-    kcupslib
-)
-
-install(TARGETS kcm_printer_manager DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
-install(FILES kcm_printer_manager.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
diff --git a/print-manager/printer-manager-kcm/PrintKCM.cpp b/print-manager/printer-manager-kcm/PrintKCM.cpp
deleted file mode 100644 (file)
index c6c8808..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrintKCM.h"
-
-#include "ui_PrintKCM.h"
-
-#include <config.h>
-
-#include <PrinterModel.h>
-#include <PrinterSortFilterModel.h>
-#include "PrinterDelegate.h"
-#include "PrinterDescription.h"
-
-#include <KMessageBox>
-#include <KPluginFactory>
-#include <KAboutData>
-#include <KToolInvocation>
-#include <KIcon>
-#include <KCupsRequest.h>
-#include <KCupsServer.h>
-#include <NoSelectionRectDelegate.h>
-
-#include <QMenu>
-
-#include <cups/cups.h>
-
-K_PLUGIN_FACTORY(PrintKCMFactory, registerPlugin<PrintKCM>();)
-K_EXPORT_PLUGIN(PrintKCMFactory("kcm_print", "print-manager"))
-
-PrintKCM::PrintKCM(QWidget *parent, const QVariantList &args) :
-    KCModule(PrintKCMFactory::componentData(), parent, args),
-    ui(new Ui_PrintKCM),
-    m_lastError(-1), // Force the error to run on the first time
-    m_serverRequest(0)
-{
-    KAboutData *aboutData;
-    aboutData = new KAboutData("kcm_print",
-                               "print-manager",
-                               ki18n("Print settings"),
-                               PM_VERSION,
-                               ki18n("Print settings"),
-                               KAboutData::License_GPL,
-                               ki18n("(C) 2010-2013 Daniel Nicoletti"));
-    setAboutData(aboutData);
-    setButtons(NoAdditionalButton);
-
-    ui->setupUi(this);
-    
-    connect(ui->printerDesc, SIGNAL(updateNeeded()), SLOT(update()));
-
-    // The printer list needs to increase in width according to the icon sizes
-    // default dialog icon size is 32, this times 6 is 192 which is roughly the original width
-    ui->printersTV->setMinimumWidth(IconSize(KIconLoader::Dialog) * 6);
-
-    QMenu *addMenu = new QMenu(this);
-    addMenu->addAction(i18nc("@action:intoolbar","Add a Printer Class"),
-                       this, SLOT(addClass()));
-    ui->addTB->setIcon(KIcon("list-add"));
-    ui->addTB->setToolTip(i18n("Add a new printer or a printer class"));
-    ui->addTB->setMenu(addMenu);
-
-    ui->removeTB->setIcon(KIcon("list-remove"));
-    ui->removeTB->setToolTip(i18n("Remove Printer"));
-
-    QMenu *systemMenu = new QMenu(this);
-    connect(systemMenu, SIGNAL(aboutToShow()), this, SLOT(getServerSettings()));
-    connect(systemMenu, SIGNAL(triggered(QAction*)), this, SLOT(systemPreferencesTriggered()));
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    m_showSharedPrinters = systemMenu->addAction(i18nc("@action:intoolbar","Show printers shared by other systems"));
-    m_showSharedPrinters->setCheckable(true);
-    systemMenu->addSeparator();
-#endif // CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    m_shareConnectedPrinters = systemMenu->addAction(i18nc("@action:intoolbar","Share printers connected to this system"));
-    m_shareConnectedPrinters->setCheckable(true);
-    m_allowPrintringFromInternet = systemMenu->addAction(i18nc("@action:intoolbar","Allow printing from the Internet"));
-    m_allowPrintringFromInternet->setCheckable(true);
-    m_allowPrintringFromInternet->setEnabled(false);
-    connect(m_shareConnectedPrinters, SIGNAL(toggled(bool)), m_allowPrintringFromInternet, SLOT(setEnabled(bool)));
-    connect(m_shareConnectedPrinters, SIGNAL(toggled(bool)), ui->printerDesc, SLOT(enableShareCheckBox(bool)));
-    systemMenu->addSeparator();
-    m_allowRemoteAdmin = systemMenu->addAction(i18nc("@action:intoolbar","Allow remote administration"));
-    m_allowRemoteAdmin->setCheckable(true);
-    m_allowUsersCancelAnyJob = systemMenu->addAction(i18nc("@action:intoolbar","Allow users to cancel any job (not just their own)"));
-    m_allowUsersCancelAnyJob->setCheckable(true);
-
-    ui->systemPreferencesTB->setIcon(KIcon("configure"));
-    ui->systemPreferencesTB->setToolTip(i18n("Configure the global preferences"));
-    ui->systemPreferencesTB->setMenu(systemMenu);
-
-    m_model = new PrinterModel(this);
-    PrinterSortFilterModel *sortModel = new PrinterSortFilterModel(this);
-    sortModel->setSourceModel(m_model);
-    ui->printersTV->setModel(sortModel);
-    ui->printersTV->setItemDelegate(new NoSelectionRectDelegate(this));
-    ui->printersTV->setItemDelegate(new PrinterDelegate(this));
-    connect(ui->printersTV->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-            this, SLOT(update()));
-    connect(sortModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
-            this, SLOT(update()));
-    connect(sortModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
-            this, SLOT(update()));
-    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(update()));
-    connect(m_model, SIGNAL(error(int,QString,QString)),
-            this, SLOT(error(int,QString,QString)));
-
-    ui->addPrinterBtn->setIcon(KIcon("list-add"));
-    connect(ui->addPrinterBtn, SIGNAL(clicked()), this, SLOT(on_addTB_clicked()));
-
-    // Force the model update AFTER we setup the error signal
-    m_model->update();
-
-    // Make sure we update our server settings if the user change it on
-    // another interface
-    connect(KCupsConnection::global(), SIGNAL(serverAudit(QString)), this, SLOT(getServerSettings()));
-    connect(KCupsConnection::global(), SIGNAL(serverRestarted(QString)), this, SLOT(getServerSettings()));
-    connect(KCupsConnection::global(), SIGNAL(serverStarted(QString)), this, SLOT(getServerSettings()));
-    connect(KCupsConnection::global(), SIGNAL(serverStopped(QString)), this, SLOT(getServerSettings()));
-
-    // We need to know the server settings so we disable the
-    // share printer checkbox if sharing is disabled on the server
-    getServerSettings();
-}
-
-PrintKCM::~PrintKCM()
-{
-    delete ui;
-}
-
-void PrintKCM::error(int lastError, const QString &errorTitle, const QString &errorMsg)
-{
-    if (lastError) {
-        // The user has no printer
-        // allow him to add a new one
-        if (lastError == IPP_NOT_FOUND) {
-            showInfo(KIcon("dialog-information"),
-                     i18n("No printers have been configured or discovered"),
-                     QString(),
-                     true,
-                     true);
-        } else {
-            showInfo(KIcon("printer", KIconLoader::global(), QStringList() << "" << "dialog-error"),
-                     QString("<strong>%1</strong>").arg(errorTitle),
-                     errorMsg,
-                     false,
-                     false);
-        }
-    }
-
-    if (m_lastError != lastError) {
-        // if no printer was found the server
-        // is still working
-        if (lastError == IPP_NOT_FOUND) {
-            ui->addTB->setEnabled(true);
-            ui->systemPreferencesTB->setEnabled(true);
-        } else {
-            ui->addTB->setEnabled(!lastError);
-            ui->systemPreferencesTB->setEnabled(!lastError);
-        }
-
-        m_lastError = lastError;
-        // Force an update
-        update();
-    }
-}
-
-void PrintKCM::showInfo(const KIcon &icon, const QString &title, const QString &comment, bool showAddPrinter, bool showToolButtons)
-{
-    ui->hugeIcon->setPixmap(icon.pixmap(128, 128));
-    ui->errorText->setText(title);
-    ui->errorComment->setVisible(!comment.isEmpty());
-    ui->errorComment->setText(comment);
-    ui->addPrinterBtn->setVisible(showAddPrinter);
-
-    // Well, when there is no printer, there is nothing to add to a printer class
-    // so we can actually hide the Add button nontheless?
-    ui->addTB->setVisible(!showAddPrinter && showToolButtons);
-    ui->removeTB->setVisible(!showAddPrinter && showToolButtons);
-    ui->lineTB->setVisible(!showAddPrinter && showToolButtons);
-    ui->printersTV->setVisible(!showAddPrinter && showToolButtons);
-
-    // Make sure we are visible
-    ui->stackedWidget->setCurrentIndex(1);
-}
-
-void PrintKCM::update()
-{
-    if (m_model->rowCount()) {
-        m_lastError = -1; // if the model has printers reset the error code
-        if (ui->stackedWidget->currentIndex() != 0) {
-            ui->stackedWidget->setCurrentIndex(0);
-        }
-
-        QItemSelection selection;
-        // we need to map the selection to source to get the real indexes
-        selection = ui->printersTV->selectionModel()->selection();
-        // select the first printer if there are printers
-        if (selection.indexes().isEmpty()) {
-            ui->printersTV->selectionModel()->select(m_model->index(0, 0), QItemSelectionModel::Select);
-            return;
-        }
-
-        QModelIndex index = selection.indexes().first();
-        QString destName = index.data(PrinterModel::DestName).toString();
-        if (ui->printerDesc->destName() != destName) {
-            ui->printerDesc->setPrinterIcon(index.data(Qt::DecorationRole).value<QIcon>());
-            int type = index.data(PrinterModel::DestType).toUInt();
-            // If we remove discovered printers, they will come
-            // back to hunt us a bit later
-            ui->removeTB->setEnabled(!(type & CUPS_PRINTER_DISCOVERED));
-        }
-        ui->printerDesc->setDestName(index.data(PrinterModel::DestName).toString(),
-                                     index.data(PrinterModel::DestDescription).toString(),
-                                     index.data(PrinterModel::DestIsClass).toBool(),
-                                     m_model->rowCount() == 1);
-        ui->printerDesc->setDestStatus(index.data(PrinterModel::DestStatus).toString());
-        ui->printerDesc->setLocation(index.data(PrinterModel::DestLocation).toString());
-        ui->printerDesc->setKind(index.data(PrinterModel::DestKind).toString());
-        ui->printerDesc->setIsShared(index.data(PrinterModel::DestIsShared).toBool());
-        ui->printerDesc->setAcceptingJobs(index.data(PrinterModel::DestIsAcceptingJobs).toBool());
-        ui->printerDesc->setIsDefault(index.data(PrinterModel::DestIsDefault).toBool());
-        ui->printerDesc->setCommands(index.data(PrinterModel::DestCommands).toStringList());
-        ui->printerDesc->setMarkers(index.data(PrinterModel::DestMarkers).value<QVariantHash>());
-
-        ui->addTB->show();
-        ui->removeTB->show();
-        ui->lineTB->show();
-        // Show the printer list only if there are more than 1 printer
-        ui->printersTV->setVisible(m_model->rowCount() > 1);
-    } else {
-        // disable the printer action buttons if there is nothing to selected
-        ui->removeTB->setEnabled(false);
-
-        if (m_lastError == IPP_OK) {
-            // the model is empty and no problem happened
-            showInfo(KIcon("dialog-information"),
-                     i18n("No printers have been configured or discovered"),
-                     QString(),
-                     true,
-                     true);
-        }
-    }
-}
-
-void PrintKCM::on_addTB_clicked()
-{
-    QStringList args;
-    args << "--add-printer";
-    KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
-}
-
-void PrintKCM::addClass()
-{
-    QStringList args;
-    args << "--add-class";
-    KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), args);
-}
-
-void PrintKCM::on_removeTB_clicked()
-{
-    QItemSelection selection;
-    // we need to map the selection to source to get the real indexes
-    selection = ui->printersTV->selectionModel()->selection();
-    // enable or disable the job action buttons if something is selected
-    if (!selection.indexes().isEmpty()) {
-        QModelIndex index = selection.indexes().first();
-        int resp;
-        QString msg, title;
-        if (index.data(PrinterModel::DestIsClass).toBool()) {
-            title = i18n("Remove class");
-            msg = i18n("Are you sure you want to remove the class '%1'?",
-                       index.data(Qt::DisplayRole).toString());
-        } else {
-            title = i18n("Remove printer");
-            msg = i18n("Are you sure you want to remove the printer '%1'?",
-                       index.data(Qt::DisplayRole).toString());
-        }
-        resp = KMessageBox::warningYesNo(this, msg, title);
-        if (resp == KMessageBox::Yes) {
-            QPointer<KCupsRequest> request = new KCupsRequest;
-            request->deletePrinter(index.data(PrinterModel::DestName).toString());
-            request->waitTillFinished();
-            if (request) {
-                request->deleteLater();
-            }
-        }
-    }
-}
-
-void PrintKCM::getServerSettings()
-{
-    if (!m_serverRequest) {
-        QMenu *systemMenu = qobject_cast<QMenu*>(sender());
-        m_serverRequest = new KCupsRequest;
-        m_serverRequest->setProperty("interactive", static_cast<bool>(systemMenu));
-        connect(m_serverRequest, SIGNAL(finished()),
-                this, SLOT(getServerSettingsFinished()));
-        m_serverRequest->getServerSettings();
-    }
-}
-
-void PrintKCM::getServerSettingsFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest *>(sender());
-
-    // When we don't have any destinations error is set to IPP_NOT_FOUND
-    // we can safely ignore the error since it DOES bring the server settings
-    bool error = request->hasError() && request->error() != IPP_NOT_FOUND;
-
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    m_showSharedPrinters->setEnabled(!error);
-#endif // CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    m_shareConnectedPrinters->setEnabled(!error);
-    m_allowRemoteAdmin->setEnabled(!error);
-    m_allowUsersCancelAnyJob->setEnabled(!error);
-
-    if (error) {
-        if (request->property("interactive").toBool()) {
-            KMessageBox::detailedSorry(this,
-                                       i18nc("@info", "Failed to get server settings"),
-                                       request->errorMsg(),
-                                       i18nc("@title:window", "Failed"));
-        }
-    } else {
-        KCupsServer server = request->serverSettings();
-
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-        m_showSharedPrinters->setChecked(server.showSharedPrinters());
-#endif // CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-        m_shareConnectedPrinters->setChecked(server.sharePrinters());
-        m_allowPrintringFromInternet->setChecked(server.allowPrintingFromInternet());
-        m_allowRemoteAdmin->setChecked(server.allowRemoteAdmin());
-        m_allowUsersCancelAnyJob->setChecked(server.allowUserCancelAnyJobs());
-    }
-
-    request->deleteLater();
-
-    m_serverRequest = 0;
-}
-
-void PrintKCM::updateServerFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest *>(sender());
-    if (request->hasError()) {
-        if (request->error() == IPP_SERVICE_UNAVAILABLE ||
-            request->error() == IPP_INTERNAL_ERROR ||
-            request->error() == IPP_AUTHENTICATION_CANCELED) {
-            // Server is restarting, or auth was canceled, update the settings in one second
-            QTimer::singleShot(1000, this, SLOT(update()));
-        } else {
-            KMessageBox::detailedSorry(this,
-                                       i18nc("@info", "Failed to configure server settings"),
-                                       request->errorMsg(),
-                                       request->serverError());
-
-            // Force the settings to be retrieved again
-            update();
-        }
-    }
-    request->deleteLater();
-}
-
-void PrintKCM::systemPreferencesTriggered()
-{
-    KCupsServer server;
-#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    server.setShowSharedPrinters(m_showSharedPrinters->isChecked());
-#endif // CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 6
-    server.setSharePrinters(m_shareConnectedPrinters->isChecked());
-    server.setAllowPrintingFromInternet(m_allowPrintringFromInternet->isChecked());
-    server.setAllowRemoteAdmin(m_allowRemoteAdmin->isChecked());
-    server.setAllowUserCancelAnyJobs(m_allowUsersCancelAnyJob->isChecked());
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(updateServerFinished()));
-    request->setServerSettings(server);
-}
diff --git a/print-manager/printer-manager-kcm/PrintKCM.h b/print-manager/printer-manager-kcm/PrintKCM.h
deleted file mode 100644 (file)
index fbc7437..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINT_KCM_H
-#define PRINT_KCM_H
-
-#include <KCModule>
-#include <KIcon>
-
-#include <QAction>
-
-#include <KCupsServer.h>
-
-class KCupsRequest;
-class PrinterModel;
-
-QT_BEGIN_NAMESPACE
-class Ui_PrintKCM;
-QT_END_NAMESPACE
-
-class PrintKCM : public KCModule
-{
-    Q_OBJECT
-public:
-    PrintKCM(QWidget *parent, const QVariantList &args);
-    ~PrintKCM();
-
-private slots:
-    void update();
-    void on_addTB_clicked();
-    void addClass();
-    void on_removeTB_clicked();
-
-    void error(int lastError, const QString &errorTitle, const QString &errorMsg);
-    void showInfo(const KIcon &icon, const QString &title, const QString &comment, bool showAddPrinter, bool showToolButtons);
-
-    void getServerSettings();
-    void getServerSettingsFinished();
-    void updateServerFinished();
-    void systemPreferencesTriggered();
-
-private:
-    Ui_PrintKCM *ui;
-    PrinterModel *m_model;
-    int m_lastError;
-
-    KCupsRequest *m_serverRequest;
-    QAction *m_showSharedPrinters;
-    QAction *m_shareConnectedPrinters;
-    QAction *m_allowPrintringFromInternet;
-    QAction *m_allowRemoteAdmin;
-    QAction *m_allowUsersCancelAnyJob;
-};
-
-#endif
diff --git a/print-manager/printer-manager-kcm/PrintKCM.ui b/print-manager/printer-manager-kcm/PrintKCM.ui
deleted file mode 100644 (file)
index 79cec78..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrintKCM</class>
- <widget class="QWidget" name="PrintKCM">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>631</width>
-    <height>485</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_5">
-     <item>
-      <widget class="QToolButton" name="addTB">
-       <property name="text">
-        <string>Add Printer</string>
-       </property>
-       <property name="toolButtonStyle">
-        <enum>Qt::ToolButtonTextUnderIcon</enum>
-       </property>
-       <property name="autoRaise">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QToolButton" name="removeTB">
-       <property name="text">
-        <string>Remove Printer</string>
-       </property>
-       <property name="toolButtonStyle">
-        <enum>Qt::ToolButtonTextUnderIcon</enum>
-       </property>
-       <property name="autoRaise">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="Line" name="lineTB">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QToolButton" name="systemPreferencesTB">
-       <property name="text">
-        <string>System Preferences</string>
-       </property>
-       <property name="popupMode">
-        <enum>QToolButton::InstantPopup</enum>
-       </property>
-       <property name="toolButtonStyle">
-        <enum>Qt::ToolButtonTextUnderIcon</enum>
-       </property>
-       <property name="autoRaise">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_6">
-     <item>
-      <widget class="QTreeView" name="printersTV">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="showDropIndicator" stdset="0">
-        <bool>false</bool>
-       </property>
-       <property name="alternatingRowColors">
-        <bool>true</bool>
-       </property>
-       <property name="rootIsDecorated">
-        <bool>false</bool>
-       </property>
-       <property name="itemsExpandable">
-        <bool>false</bool>
-       </property>
-       <property name="expandsOnDoubleClick">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QStackedWidget" name="stackedWidget">
-       <property name="currentIndex">
-        <number>1</number>
-       </property>
-       <widget class="QWidget" name="descriptionPage">
-        <layout class="QGridLayout" name="gridLayout_4">
-         <property name="margin">
-          <number>0</number>
-         </property>
-         <item row="0" column="0">
-          <widget class="QScrollArea" name="scrollArea">
-           <property name="frameShape">
-            <enum>QFrame::NoFrame</enum>
-           </property>
-           <property name="widgetResizable">
-            <bool>true</bool>
-           </property>
-           <widget class="QWidget" name="scrollAreaWidgetContents">
-            <property name="geometry">
-             <rect>
-              <x>0</x>
-              <y>0</y>
-              <width>100</width>
-              <height>30</height>
-             </rect>
-            </property>
-            <layout class="QGridLayout" name="gridLayout_5">
-             <property name="margin">
-              <number>0</number>
-             </property>
-             <item row="0" column="0">
-              <widget class="PrinterDescription" name="printerDesc" native="true"/>
-             </item>
-            </layout>
-           </widget>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="errorPage">
-        <layout class="QGridLayout" name="gridLayout_3">
-         <item row="1" column="2">
-          <spacer name="horizontalSpacer_3">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item row="2" column="1">
-          <spacer name="verticalSpacer">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item row="0" column="0" colspan="3">
-          <layout class="QGridLayout" name="gridLayout_2">
-           <item row="1" column="0">
-            <widget class="QLabel" name="hugeIcon">
-             <property name="text">
-              <string/>
-             </property>
-             <property name="alignment">
-              <set>Qt::AlignCenter</set>
-             </property>
-            </widget>
-           </item>
-           <item row="3" column="0">
-            <widget class="QLabel" name="errorComment">
-             <property name="text">
-              <string>TextLabel</string>
-             </property>
-             <property name="alignment">
-              <set>Qt::AlignCenter</set>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <widget class="QLabel" name="errorText">
-             <property name="text">
-              <string>Error Title</string>
-             </property>
-             <property name="alignment">
-              <set>Qt::AlignCenter</set>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="0">
-            <spacer name="verticalSpacer_2">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-         <item row="1" column="1">
-          <widget class="QPushButton" name="addPrinterBtn">
-           <property name="text">
-            <string>Click here to add a new printer</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </widget>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>PrinterDescription</class>
-   <extends>QWidget</extends>
-   <header location="global">PrinterDescription.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/printer-manager-kcm/PrinterDelegate.cpp b/print-manager/printer-manager-kcm/PrinterDelegate.cpp
deleted file mode 100644 (file)
index b985bd1..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- *   Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
- *   Copyright (C) 2008-2010 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library/Lesser General Public License
- *   version 2, or (at your option) any later version, as published by the
- *   Free Software Foundation
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library/Lesser General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#include "PrinterDelegate.h"
-#include <PrinterModel.h>
-
-#include <cmath>
-
-#include <QtGui/QPainter>
-
-#include <KDebug>
-#include <KIconLoader>
-
-PrinterDelegate::PrinterDelegate(QObject *parent)
-: QStyledItemDelegate(parent)
-{
-    m_mainIconSize = IconSize(KIconLoader::Dialog); // 32
-    m_favIconSize = m_mainIconSize * 0.75; // 24
-    m_emblemIconSize = m_mainIconSize / 4; // 8
-    m_universalPadding = m_mainIconSize / 8; // 4
-    m_fadeLength = m_mainIconSize / 2; // 16
-}
-
-int PrinterDelegate::calcItemHeight(const QStyleOptionViewItem &option) const
-{
-    // Painting main column
-    QStyleOptionViewItem local_option_title(option);
-    QStyleOptionViewItem local_option_normal(option);
-
-    local_option_normal.font.setPointSize(local_option_normal.font.pointSize() - 1);
-
-    int textHeight = QFontInfo(local_option_title.font).pixelSize() + QFontInfo(local_option_normal.font).pixelSize();
-    return qMax(textHeight, m_mainIconSize) + 2 * m_universalPadding;
-}
-
-
-void PrinterDelegate::paint(QPainter *painter,
-        const QStyleOptionViewItem &option, const QModelIndex &index) const
-{
-    if (!index.isValid() && index.column() == 0){
-      return;
-    }
-
-    QStyleOptionViewItemV4 opt(option);
-    QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
-    style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
-
-    int left = option.rect.left();
-    int top = option.rect.top();
-    int width = option.rect.width();
-
-    bool leftToRight = (painter->layoutDirection() == Qt::LeftToRight);
-    bool isPaused = index.data(PrinterModel::DestIsPaused).toBool();
-
-    // selects the mode to paint the icon based on the info field
-    QIcon::Mode iconMode;
-    if (isPaused) {
-        iconMode = QIcon::Disabled;
-    } else if (option.state & QStyle::State_MouseOver) {
-        iconMode = QIcon::Active;
-    } else if (option.state.testFlag(QStyle::State_Selected)) {
-        iconMode = QIcon::Selected;
-    } else {
-        iconMode = QIcon::Normal;
-    }
-
-    QColor foregroundColor = (option.state.testFlag(QStyle::State_Selected))?
-        option.palette.color(QPalette::HighlightedText):option.palette.color(QPalette::Text);
-
-    // Painting main column
-    QStyleOptionViewItem local_option_title(option);
-    QStyleOptionViewItem local_option_normal(option);
-
-    local_option_normal.font.setPointSize(local_option_normal.font.pointSize() - 1);
-    local_option_title.font.setBold(index.data(PrinterModel::DestIsDefault).toBool());
-
-    QPixmap pixmap(option.rect.size());
-    pixmap.fill(Qt::transparent);
-    QPainter p(&pixmap);
-    p.translate(-option.rect.topLeft());
-
-    QLinearGradient gradient;
-
-    // Painting
-
-    // Text
-    int textInner = 2 * m_universalPadding + m_mainIconSize;
-    const int itemHeight = calcItemHeight(option);
-
-    QString status = index.data(PrinterModel::DestStatus).toString();
-    QString description = index.data(Qt::DisplayRole).toString();
-
-    p.setPen(foregroundColor);
-    p.setFont(local_option_title.font);
-    p.drawText(left + (leftToRight ? textInner : 0),
-                top,
-                width - textInner,
-                itemHeight / 2,
-                Qt::AlignBottom | Qt::AlignLeft,
-                description);
-
-    p.setFont(local_option_normal.font);
-    p.drawText(left + (leftToRight ? textInner : 0) + 10,
-                (top + itemHeight / 2) + 1,
-                width - textInner,
-                itemHeight / 2,
-                Qt::AlignTop | Qt::AlignLeft,
-                status);
-
-    // Main icon
-    QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
-    // if we have a package that mean we
-    // can try to get a better icon
-    icon.paint(&p,
-               leftToRight ? left + m_universalPadding : left + width - m_universalPadding - m_mainIconSize,
-               top + m_universalPadding,
-               m_mainIconSize,
-               m_mainIconSize,
-               Qt::AlignCenter,
-               iconMode);
-
-    // Counting the number of emblems for this item
-    int emblemCount = 1;
-
-    // Gradient part of the background - fading of the text at the end
-    if (leftToRight) {
-        gradient = QLinearGradient(left + width - m_universalPadding - m_fadeLength, 0,
-                left + width - m_universalPadding, 0);
-        gradient.setColorAt(0, Qt::white);
-        gradient.setColorAt(1, Qt::transparent);
-    } else {
-        gradient = QLinearGradient(left + m_universalPadding, 0,
-                left + m_universalPadding + m_fadeLength, 0);
-        gradient.setColorAt(0, Qt::transparent);
-        gradient.setColorAt(1, Qt::white);
-    }
-
-    QRect paintRect = option.rect;
-    p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
-    p.fillRect(paintRect, gradient);
-
-    if (leftToRight) {
-        gradient.setStart(left + width
-                - emblemCount * (m_universalPadding + m_emblemIconSize) - m_fadeLength, 0);
-        gradient.setFinalStop(left + width
-                - emblemCount * (m_universalPadding + m_emblemIconSize), 0);
-    } else {
-        gradient.setStart(left + m_universalPadding
-                + emblemCount * (m_universalPadding + m_emblemIconSize), 0);
-        gradient.setFinalStop(left + m_universalPadding
-                + emblemCount * (m_universalPadding + m_emblemIconSize) + m_fadeLength, 0);
-    }
-    paintRect.setHeight(m_universalPadding + m_mainIconSize / 2);
-    p.fillRect(paintRect, gradient);
-
-    painter->drawPixmap(option.rect.topLeft(), pixmap);
-}
-
-QSize PrinterDelegate::sizeHint(const QStyleOptionViewItem &option,
-        const QModelIndex &index ) const
-{
-    int width = (index.column() == 0) ? index.data(Qt::SizeHintRole).toSize().width() : m_favIconSize + 2 * m_universalPadding;
-    QSize ret;
-
-    return QSize(width, calcItemHeight(option));
-}
-
-#include "moc_PrinterDelegate.cpp"
diff --git a/print-manager/printer-manager-kcm/PrinterDelegate.h b/print-manager/printer-manager-kcm/PrinterDelegate.h
deleted file mode 100644 (file)
index 4c5354a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *   Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
- *   Copyright (C) 2008-2010 Daniel Nicoletti <dantti12@gmail.com>
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU Library/Lesser General Public License
- *   version 2, or (at your option) any later version, as published by the
- *   Free Software Foundation
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details
- *
- *   You should have received a copy of the GNU Library/Lesser General Public
- *   License along with this program; if not, write to the
- *   Free Software Foundation, Inc.,
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#ifndef PRINTER_DELEGATE_H
-#define PRINTER_DELEGATE_H
-
-#include <QApplication>
-#include <QtGui/QStyledItemDelegate>
-
-#include <QPainter>
-
-/**
- * Delegate for displaying the printers
- */
-class PrinterDelegate: public QStyledItemDelegate
-{
-    Q_OBJECT
-
-public:
-    explicit PrinterDelegate(QObject *parent = 0);
-
-    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
-
-private:
-    int m_favIconSize;
-    int m_emblemIconSize;
-    int m_universalPadding;
-    int m_fadeLength;
-    int m_mainIconSize;
-    int calcItemHeight(const QStyleOptionViewItem &option) const;
-};
-
-#endif
diff --git a/print-manager/printer-manager-kcm/PrinterDescription.cpp b/print-manager/printer-manager-kcm/PrinterDescription.cpp
deleted file mode 100644 (file)
index 2003d42..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrinterDescription.h"
-#include "ui_PrinterDescription.h"
-
-#include <KCupsPrinter.h>
-
-#include <QPainter>
-#include <QPointer>
-#include <QDBusMessage>
-#include <QProgressBar>
-#include <QLabel>
-#include <QDBusConnection>
-
-#include <KToolInvocation>
-#include <KMenu>
-#include <KDebug>
-#include <KLocale>
-
-#define PRINTER_ICON_SIZE 128
-
-Q_DECLARE_METATYPE(QList<int>)
-
-PrinterDescription::PrinterDescription(QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui_PrinterDescription),
-    m_isClass(false),
-    m_markerChangeTime(0)
-{
-    ui->setupUi(this);
-    m_layoutEnd = ui->formLayout->count();
-
-    // loads the standard key icon
-    m_printerIcon = KIconLoader::global()->loadIcon("printer",
-                                                    KIconLoader::NoGroup,
-                                                    PRINTER_ICON_SIZE, // a not so huge icon
-                                                    KIconLoader::DefaultState);
-    ui->iconL->setPixmap(m_printerIcon);
-
-    m_pauseIcon = KIconLoader::global()->loadIcon("media-playback-pause",
-                                                  KIconLoader::NoGroup,
-                                                  KIconLoader::SizeMedium,
-                                                  KIconLoader::DefaultState,
-                                                  QStringList(),
-                                                  0,
-                                                  true);
-
-    KMenu *menu = new KMenu(ui->maintenancePB);
-    menu->addAction(ui->actionPrintTestPage);
-    menu->addAction(ui->actionPrintSelfTestPage);
-    menu->addAction(ui->actionCleanPrintHeads);
-    ui->actionCleanPrintHeads->setVisible(false);
-    ui->actionPrintSelfTestPage->setVisible(false);
-    ui->maintenancePB->setMenu(menu);
-
-    ui->errorMessage->setMessageType(KMessageWidget::Error);
-    ui->errorMessage->hide();
-}
-
-PrinterDescription::~PrinterDescription()
-{
-    delete ui;
-}
-
-void PrinterDescription::on_openQueuePB_clicked()
-{
-    QStringList args;
-    args << m_destName;
-    KToolInvocation::kdeinitExec(QLatin1String("kde-print-queue"), args);
-}
-
-void PrinterDescription::on_defaultCB_clicked()
-{
-    ui->defaultCB->setDisabled(true);
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    request->setDefaultPrinter(m_destName);
-}
-
-void PrinterDescription::on_sharedCB_clicked()
-{
-    ui->sharedCB->setDisabled(true);
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    request->setShared(m_destName, m_isClass, ui->sharedCB->isChecked());
-}
-
-void PrinterDescription::on_rejectPrintJobsCB_clicked()
-{
-    ui->rejectPrintJobsCB->setDisabled(true);
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    if (ui->rejectPrintJobsCB->isChecked()) {
-        request->rejectJobs(m_destName);
-    } else {
-        request->acceptJobs(m_destName);
-    }
-}
-
-void PrinterDescription::setPrinterIcon(const QIcon &icon)
-{
-    ui->iconL->setPixmap(icon.pixmap(PRINTER_ICON_SIZE, PRINTER_ICON_SIZE));
-}
-
-void PrinterDescription::setDestName(const QString &name, const QString &description, bool isClass, bool singlePrinter)
-{
-    m_destName = name;
-
-    m_markerData.clear();
-    if (m_isClass != isClass) {
-        m_isClass = isClass;
-        ui->sharedCB->setText(m_isClass ? i18n("Share this class") : i18n("Share this printer"));
-    }
-
-    ui->nameMsgL->setText(name);
-    if (!description.isEmpty() && description != ui->printerNameL->text()) {
-        ui->printerNameL->setText(description);
-    } else if (description.isEmpty() && name != ui->printerNameL->text()) {
-        ui->printerNameL->setText(name);
-    }
-
-    ui->statusL->setVisible(singlePrinter);
-    ui->nameL->setVisible(singlePrinter);
-    ui->nameMsgL->setVisible(singlePrinter);
-}
-
-void PrinterDescription::setDestStatus(const QString &status)
-{
-    ui->statusL->setText(status);
-}
-
-void PrinterDescription::setLocation(const QString &location)
-{
-    ui->locationMsgL->setText(location);
-}
-
-void PrinterDescription::setKind(const QString &kind)
-{
-    ui->kindMsgL->setText(kind);
-}
-
-void PrinterDescription::setIsDefault(bool isDefault)
-{
-    ui->defaultCB->setEnabled(!isDefault);
-    ui->defaultCB->setChecked(isDefault);
-}
-
-void PrinterDescription::setIsShared(bool isShared)
-{
-    m_isShared = isShared;
-    if (m_globalShared) {
-        ui->sharedCB->setChecked(isShared);
-    } else {
-        ui->sharedCB->setChecked(false);
-    }
-    ui->sharedCB->setEnabled(m_globalShared);
-}
-
-void PrinterDescription::setAcceptingJobs(bool accepting)
-{
-    ui->rejectPrintJobsCB->setEnabled(true);
-    ui->rejectPrintJobsCB->setChecked(!accepting);
-}
-
-void PrinterDescription::setCommands(const QStringList &commands)
-{
-    // On the first time this method runs the list
-    // can be empty, so keep all objects initialized on the
-    // constructor
-    if (m_commands != commands) {
-        m_commands = commands;
-
-        ui->actionCleanPrintHeads->setVisible(commands.contains("Clean"));
-        ui->actionPrintSelfTestPage->setVisible(commands.contains("PrintSelfTestPage"));
-
-        // TODO if the printer supports ReportLevels
-        // we should probably probe for them
-        // commands.contains("ReportLevels")
-    }
-}
-
-void PrinterDescription::setMarkers(const QVariantHash &data)
-{
-    // Remove old progress bars
-    while (ui->formLayout->count() > m_layoutEnd) {
-        ui->formLayout->takeAt(ui->formLayout->count() - 1)->widget()->deleteLater();
-    }
-
-    int size = data["marker-names"].toStringList().size();
-    if (size != data["marker-levels"].value<QList<int> >().size() ||
-        size != data["marker-colors"].toStringList().size() ||
-        size != data["marker-types"].toStringList().size()) {
-        return;
-    }
-
-    // Create a colored progress bar for each marker
-    for (int i = 0; i < size; i++) {
-        if (data["marker-types"].toStringList().at(i) == QLatin1String("unknown")) {
-            continue;
-        }
-        QProgressBar *pogressBar = new QProgressBar;
-        pogressBar->setValue(data["marker-levels"].value<QList<int> >().at(i));
-        pogressBar->setTextVisible(false);
-        pogressBar->setMaximumHeight(15);
-        QPalette palette = pogressBar->palette();
-        palette.setColor(QPalette::Active,
-                         QPalette::Highlight,
-                         QColor(data["marker-colors"].toStringList().at(i)));
-        palette.setColor(QPalette::Inactive,
-                         QPalette::Highlight,
-                         QColor(data["marker-colors"].toStringList().at(i)).lighter());
-        pogressBar->setPalette(palette);
-        QLabel *label = new QLabel(data["marker-names"].toStringList().at(i), this);
-        ui->formLayout->addRow(label, pogressBar);
-    }
-}
-
-void PrinterDescription::on_actionPrintTestPage_triggered(bool checked)
-{
-    Q_UNUSED(checked)
-
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    request->printTestPage(m_destName, m_isClass);
-}
-
-void PrinterDescription::on_actionCleanPrintHeads_triggered(bool checked)
-{
-    Q_UNUSED(checked)
-
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    request->printCommand(m_destName, "Clean all", i18n("Clean Print Heads"));
-}
-
-void PrinterDescription::on_actionPrintSelfTestPage_triggered(bool checked)
-{
-    Q_UNUSED(checked)
-
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(requestFinished()));
-    request->printCommand(m_destName, "PrintSelfTestPage", i18n("Print Self-Test Page"));
-}
-
-void PrinterDescription::requestFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest*>(sender());
-    if (request && request->hasError()) {
-        ui->errorMessage->setText(i18n("Failed to perform request: %1", request->errorMsg()));
-        ui->errorMessage->animatedShow();
-        emit updateNeeded();
-    }
-}
-
-QString PrinterDescription::destName() const
-{
-    return m_destName;
-}
-
-void PrinterDescription::enableShareCheckBox(bool enable)
-{
-    m_globalShared = enable;
-    setIsShared(m_isShared);
-}
-
-void PrinterDescription::on_configurePB_clicked()
-{
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("/"),
-                                             QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("ConfigurePrinter"));
-    message << m_destName;
-    QDBusConnection::sessionBus().call(message);
-}
diff --git a/print-manager/printer-manager-kcm/PrinterDescription.h b/print-manager/printer-manager-kcm/PrinterDescription.h
deleted file mode 100644 (file)
index 797d016..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINTER_DESCRIPTION_H
-#define PRINTER_DESCRIPTION_H
-
-#include <QWidget>
-
-#include <KCupsRequest.h>
-
-#include <QToolButton>
-#include <QSortFilterProxyModel>
-
-class PrintQueueModel;
-
-QT_BEGIN_NAMESPACE
-class Ui_PrinterDescription;
-QT_END_NAMESPACE
-
-class PrinterDescription : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit PrinterDescription(QWidget *parent = 0);
-    ~PrinterDescription();
-
-    void setPrinterIcon(const QIcon &icon);
-    void setDestName(const QString &name, const QString &description, bool isClass, bool singlePrinter);
-    void setDestStatus(const QString &status);
-    void setLocation(const QString &location);
-    void setKind(const QString &kind);
-    void setIsDefault(bool isDefault);
-    void setIsShared(bool isShared);
-    void setAcceptingJobs(bool accepting);
-    void setCommands(const QStringList &commands);
-
-    void setMarkers(const QVariantHash &data);
-
-    QString destName() const;
-
-public slots:
-    void enableShareCheckBox(bool enable);
-
-signals:
-    void updateNeeded();
-
-private slots:
-    void on_configurePB_clicked();
-    void on_openQueuePB_clicked();
-    void on_defaultCB_clicked();
-    void on_sharedCB_clicked();
-    void on_rejectPrintJobsCB_clicked();
-
-    void on_actionPrintTestPage_triggered(bool checked);
-    void on_actionCleanPrintHeads_triggered(bool checked);
-    void on_actionPrintSelfTestPage_triggered(bool checked);
-
-    void requestFinished();
-
-private:
-    Ui_PrinterDescription *ui;
-    QString m_destName;
-    bool m_isClass;
-    bool m_isShared;
-    bool m_globalShared;
-    QStringList m_commands;
-    QPixmap m_printerIcon;
-    QPixmap m_pauseIcon;
-    QPixmap m_startIcon;
-    QPixmap m_warningIcon;
-    int m_markerChangeTime;
-    QVariantHash m_markerData;
-    int m_layoutEnd;
-};
-
-#endif
diff --git a/print-manager/printer-manager-kcm/PrinterDescription.ui b/print-manager/printer-manager-kcm/PrinterDescription.ui
deleted file mode 100644 (file)
index 9bc42db..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrinterDescription</class>
- <widget class="QWidget" name="PrinterDescription">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>532</width>
-    <height>428</height>
-   </rect>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="1" column="2">
-    <spacer name="rightSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="1">
-    <layout class="QFormLayout" name="formLayout">
-     <property name="fieldGrowthPolicy">
-      <enum>QFormLayout::ExpandingFieldsGrow</enum>
-     </property>
-     <property name="rowWrapPolicy">
-      <enum>QFormLayout::DontWrapRows</enum>
-     </property>
-     <item row="0" column="0">
-      <widget class="QLabel" name="iconL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string notr="true">Icon</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="printerNameL">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>300</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="font">
-          <font>
-           <pointsize>14</pointsize>
-          </font>
-         </property>
-         <property name="text">
-          <string comment="@title">Printer name or description</string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="statusL">
-         <property name="minimumSize">
-          <size>
-           <width>25</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>Current status</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="defaultCB">
-         <property name="text">
-          <string comment="@option:check">Default printer</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="sharedCB">
-         <property name="enabled">
-          <bool>false</bool>
-         </property>
-         <property name="text">
-          <string comment="@option:check">Share this printer</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="rejectPrintJobsCB">
-         <property name="text">
-          <string>Reject print jobs</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="locationL">
-       <property name="text">
-        <string comment="@label location of printer">Location:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="QLabel" name="locationMsgL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="text">
-        <string notr="true">textLocation</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="0">
-      <widget class="QLabel" name="kindL">
-       <property name="text">
-        <string comment="@label kind of printer, could be driver name or &quot;local raw socket&quot;">Kind:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <widget class="QLabel" name="kindMsgL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-       <property name="text">
-        <string notr="true">kind text</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <layout class="QGridLayout" name="gridLayout_3">
-       <property name="verticalSpacing">
-        <number>0</number>
-       </property>
-       <item row="1" column="0">
-        <widget class="KPushButton" name="configurePB">
-         <property name="text">
-          <string>Configure</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="0">
-        <widget class="KPushButton" name="maintenancePB">
-         <property name="text">
-          <string comment="@action:button">Maintenance</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0">
-        <widget class="Line" name="line">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="3" column="0">
-        <widget class="KPushButton" name="openQueuePB">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="text">
-          <string comment="@action:button">Open Print Queue</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="nameL">
-       <property name="text">
-        <string>Name:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="1">
-      <widget class="QLabel" name="nameMsgL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string notr="true">printer name</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="2" column="1">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="0">
-    <spacer name="leftSpacer">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="0" colspan="3">
-    <widget class="KMessageWidget" name="errorMessage" native="true"/>
-   </item>
-  </layout>
-  <action name="actionPrintTestPage">
-   <property name="text">
-    <string>Print Test Page</string>
-   </property>
-  </action>
-  <action name="actionCleanPrintHeads">
-   <property name="text">
-    <string>Clean Print Heads</string>
-   </property>
-  </action>
-  <action name="actionPrintSelfTestPage">
-   <property name="text">
-    <string>Print Self Test Page</string>
-   </property>
-   <property name="toolTip">
-    <string>Print Self-Test Page</string>
-   </property>
-  </action>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KPushButton</class>
-   <extends>QPushButton</extends>
-   <header>kpushbutton.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KMessageWidget</class>
-   <extends>QWidget</extends>
-   <header location="global">kmessagewidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/printer-manager-kcm/kcm_printer_manager.desktop b/print-manager/printer-manager-kcm/kcm_printer_manager.desktop
deleted file mode 100644 (file)
index 9d548ba..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-[Desktop Entry]
-Type=Service
-Icon=printer
-Exec=kcmshell4 kcm_printer_manager
-
-X-KDE-Library=kcm_printer_manager
-X-KDE-ServiceTypes=KCModule
-X-KDE-System-Settings-Parent-Category=hardware
-X-KDE-System-Settings-Parent-Category-V2=hardware
-X-KDE-ParentApp=kcontrol
-Categories=Qt;KDE;X-KDE-settings-hardware;
-
-Name=Printers
-Name[bg]=Принтери
-Name[bs]=Štampači
-Name[ca]=Impressores
-Name[ca@valencia]=Impressores
-Name[cs]=Tiskárny
-Name[da]=Printere
-Name[de]=Drucker
-Name[el]=Εκτυπωτές
-Name[en_GB]=Printers
-Name[es]=Impresoras
-Name[et]=Printerid
-Name[eu]=Inprimagailuak
-Name[fi]=Tulostimet
-Name[fr]=Imprimantes
-Name[ga]=Printéirí
-Name[gl]=Impresoras
-Name[hu]=Nyomtatók
-Name[ia]=Imprimitores
-Name[it]=Stampanti
-Name[kk]=Принтерлер
-Name[km]=ម៉ាស៊ីន​បោះពុម្ព
-Name[ko]=프린터
-Name[lt]=Spausdintuvai
-Name[mai]=मुद्रक
-Name[mr]=छपाईयंत्रे
-Name[nb]=Skrivere
-Name[nds]=Druckers
-Name[nl]=Printers
-Name[oc]=Estampairas
-Name[pa]=ਪਰਿੰਟਰ
-Name[pl]=Drukarki
-Name[pt]=Impressoras
-Name[pt_BR]=Impressoras
-Name[ro]=Imprimante
-Name[ru]=Принтеры
-Name[sk]=Tlačiarne
-Name[sl]=Tiskalniki
-Name[sr]=Штампачи
-Name[sr@ijekavian]=Штампачи
-Name[sr@ijekavianlatin]=Štampači
-Name[sr@latin]=Štampači
-Name[sv]=Skrivare
-Name[tr]=Yazıcılar
-Name[ug]=پرىنتېرلار
-Name[uk]=Принтери
-Name[x-test]=xxPrintersxx
-Name[zh_CN]=打印机
-Name[zh_TW]=印表機
-
-Comment=Configure your printers
-Comment[bg]=Настройване на вашите принтери
-Comment[bs]=Konfigurišite štampače
-Comment[ca]=Configura les impressores
-Comment[ca@valencia]=Configura les impressores
-Comment[cs]=Nastavte vaše tiskárny
-Comment[da]=Indstil dine printere
-Comment[de]=Drucker einrichten
-Comment[el]=Διαμόρφωση των εκτυπωτών σας
-Comment[en_GB]=Configure your printers
-Comment[es]=Configure sus impresoras
-Comment[et]=Printerite seadistamine
-Comment[eu]=Konfiguratu zure inprimagailuak
-Comment[fi]=Tulostinasetukset
-Comment[fr]=Configure vos imprimantes
-Comment[ga]=Cumraigh printéirí
-Comment[gl]=Configure as súas impresoras.
-Comment[hu]=Nyomtatóbeállítás
-Comment[ia]=Configura tu imprimitores
-Comment[it]=Configura le stampanti
-Comment[kk]=Принтерлерін баптау
-Comment[km]=កំណត់​រចនា​សម្ព័ន្ធ​ម៉ាស៊ីន​បោះ​ពុម្ព​របស់​អ្នក
-Comment[ko]=프린터 설정
-Comment[lt]=Konfigūruoti Jūsų spausdintuvus
-Comment[mr]=तुमची छपाईयंत्रे संयोजीत करा
-Comment[nb]=Sett opp skrivere
-Comment[nds]=Dien Druckers inrichten
-Comment[nl]=Uw printers instellen
-Comment[pa]=ਆਪਣੇ ਪਰਿੰਟਰਾਂ ਦੀ ਸੰਰਚਨਾ ਕਰੋ
-Comment[pl]=Ustaw swoje drukarki
-Comment[pt]=Configurar as suas impressoras
-Comment[pt_BR]=Configure suas impressoras
-Comment[ro]=Configurați imprimantele
-Comment[ru]=Настройка принтеров
-Comment[sk]=Nastaviť vaše tlačiarne
-Comment[sl]=Nastavljanje tiskalnikov
-Comment[sr]=Подесите штампаче
-Comment[sr@ijekavian]=Подесите штампаче
-Comment[sr@ijekavianlatin]=Podesite štampače
-Comment[sr@latin]=Podesite štampače
-Comment[sv]=Anpassa skrivare
-Comment[tr]=Yazıcılarınızı yapılandırın
-Comment[uk]=Налаштування ваших принтерів
-Comment[x-test]=xxConfigure your printersxx
-Comment[zh_CN]=配置打印机
-Comment[zh_TW]=設定您的印表機
diff --git a/print-manager/printqueue/CMakeLists.txt b/print-manager/printqueue/CMakeLists.txt
deleted file mode 100644 (file)
index 359957a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-find_package(KDE4Internal REQUIRED)
-
-set(queuemanager_SRCS
-    main.cpp
-    PrintQueue.cpp
-    PrintQueueUi.cpp
-    PrintQueueUi.ui
-)
-
-add_executable(kde-print-queue
-    ${queuemanager_SRCS}
-)
-
-target_link_libraries(kde-print-queue
-    ${KDE4_KDEUI_LIBS}
-    kcupslib
-)
-
-install(TARGETS kde-print-queue DESTINATION ${KDE4_BIN_INSTALL_DIR})
diff --git a/print-manager/printqueue/PrintQueue.cpp b/print-manager/printqueue/PrintQueue.cpp
deleted file mode 100644 (file)
index 4899e0b..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrintQueue.h"
-
-#include "PrintQueueUi.h"
-
-#include <KCupsRequest.h>
-
-#include <QPointer>
-#include <QTimer>
-
-#include <KWindowSystem>
-#include <KCmdLineArgs>
-#include <KDebug>
-
-PrintQueue::PrintQueue() :
-    KUniqueApplication()
-{
-}
-
-int PrintQueue::newInstance()
-{
-    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-    if (args->count()) {
-        for (int i = 0; i < args->count(); ++i) {
-            showQueue(args->arg(i));
-        }
-    } else {
-        kDebug() << "called with no args";
-        // If DBus called the ui list won't be empty
-        QTimer::singleShot(500, this, SLOT(removeQueue()));
-    }
-
-    return 0;
-}
-
-PrintQueue::~PrintQueue()
-{
-}
-
-void PrintQueue::showQueue(const QString &destName)
-{
-    kDebug() << destName;
-    if (!m_uis.contains(destName)) {
-        // Reserve this since the CUPS call might take a long time
-        m_uis[destName] = 0;
-
-        QStringList attr;
-        attr << KCUPS_PRINTER_NAME;
-        attr << KCUPS_PRINTER_TYPE;
-        // Get destinations with these attributes
-        QPointer<KCupsRequest> request = new KCupsRequest;
-        request->getPrinters(attr);
-        request->waitTillFinished();
-        if (!request) {
-            return;
-        }
-
-        bool found = false;
-        KCupsPrinter printer;
-        KCupsPrinters printers = request->printers();
-        for (int i = 0; i < printers.size(); i++) {
-            if (printers.at(i).name() == destName) {
-                printer = printers.at(i);
-                found = true;
-                break;
-            }
-        }
-        request->deleteLater();
-
-        if (found) {
-            PrintQueueUi *ui = new PrintQueueUi(printer);
-            connect(ui, SIGNAL(finished()),
-                    this, SLOT(removeQueue()));
-            ui->show();
-            m_uis[printer.name()] = ui;
-        } else {
-            // Remove the reservation
-            m_uis.remove(destName);
-
-            // if no destination was found and we aren't showing
-            // a queue quit the app
-            if (m_uis.isEmpty()) {
-                 emit quit();
-            }
-            return;
-        }
-    }
-
-    // Check it it's not reserved
-    if (m_uis.value(destName)) {
-        KWindowSystem::forceActiveWindow(m_uis.value(destName)->winId());
-    }
-}
-
-void PrintQueue::removeQueue()
-{
-    QWidget *ui = qobject_cast<QWidget*>(sender());
-    if (ui) {
-        m_uis.remove(m_uis.key(ui));
-    }
-
-    // if no destination was found and we aren't showing
-    // a queue quit the app
-    if (m_uis.isEmpty()) {
-         quit();
-    }
-}
-
-
-#include "moc_PrintQueue.cpp"
diff --git a/print-manager/printqueue/PrintQueue.h b/print-manager/printqueue/PrintQueue.h
deleted file mode 100644 (file)
index 538446c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINT_QUEUE_H
-#define PRINT_QUEUE_H
-
-#include <KUniqueApplication>
-
-class PrintQueue : public KUniqueApplication
-{
-    Q_OBJECT
-public:
-    PrintQueue();
-    virtual ~PrintQueue();
-    int newInstance();
-
-    void showQueue(const QString &destName);
-
-public slots:
-    void removeQueue();
-
-private:
-    QHash<QString, QWidget *> m_uis;
-};
-
-#endif
diff --git a/print-manager/printqueue/PrintQueueUi.cpp b/print-manager/printqueue/PrintQueueUi.cpp
deleted file mode 100644 (file)
index 0214228..0000000
+++ /dev/null
@@ -1,643 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrintQueueUi.h"
-#include "ui_PrintQueueUi.h"
-
-#include <JobModel.h>
-#include <JobSortFilterModel.h>
-
-#include <KCupsRequest.h>
-#include <KCupsPrinter.h>
-#include <NoSelectionRectDelegate.h>
-
-#include <QPainter>
-#include <QToolBar>
-#include <QMenu>
-#include <QByteArray>
-#include <QtDBus/QDBusConnection>
-#include <QtDBus/QDBusMessage>
-
-#include <KMessageBox>
-#include <KDebug>
-#include <KLocale>
-
-#define PRINTER_ICON_SIZE 92
-
-PrintQueueUi::PrintQueueUi(const KCupsPrinter &printer, QWidget *parent) :
-    KDialog(parent),
-    ui(new Ui_PrintQueueUi),
-    m_destName(printer.name()),
-    m_preparingMenu(false),
-    m_printerPaused(false),
-    m_lastState(0)
-{
-    ui->setupUi(mainWidget());
-
-    // since setupUi needs to setup on the mainWidget()
-    // we need to manually connect the buttons
-    connect(ui->cancelJobPB, SIGNAL(clicked()), this, SLOT(cancelJob()));
-    connect(ui->holdJobPB, SIGNAL(clicked()), this, SLOT(holdJob()));
-    connect(ui->resumeJobPB, SIGNAL(clicked()), this, SLOT(resumeJob()));
-    connect(ui->reprintPB, SIGNAL(clicked()), this, SLOT(reprintJob()));
-
-    connect(ui->pausePrinterPB, SIGNAL(clicked()), this, SLOT(pausePrinter()));
-    connect(ui->configurePrinterPB, SIGNAL(clicked()), this, SLOT(configurePrinter()));
-
-    connect(ui->whichJobsCB, SIGNAL(currentIndexChanged(int)), this, SLOT(whichJobsIndexChanged(int)));
-
-    // Needed so we have our dialog size saved
-    setAttribute(Qt::WA_DeleteOnClose);
-
-    setWindowIcon(printer.icon());
-    if (printer.info().isEmpty()) {
-        m_title = printer.name();
-    } else {
-        m_title = printer.name() + QLatin1String(" - ") + printer.info();
-    }
-    setWindowTitle(m_title);
-    setButtons(0);
-    setSizeGripEnabled(true);
-    (void) minimumSizeHint(); //Force the dialog to be laid out now
-    layout()->setContentsMargins(0,0,0,0);
-
-    m_isClass = printer.isClass();
-
-    // setup default options
-    ui->jobsView->setCornerWidget(new QWidget);
-
-    setupButtons();
-
-    // loads the standard key icon
-    m_printerIcon = printer.icon().pixmap(PRINTER_ICON_SIZE, PRINTER_ICON_SIZE);
-    ui->iconL->setPixmap(m_printerIcon);
-
-    m_pauseIcon = KIconLoader::global()->loadIcon("media-playback-pause",
-                                                  KIconLoader::NoGroup,
-                                                  KIconLoader::SizeMedium,
-                                                  KIconLoader::DefaultState,
-                                                  QStringList(),
-                                                  0,
-                                                  true);
-
-    ui->printerStatusMsgL->setText(QString());
-
-    // setup the jobs model
-    m_model = new JobModel(this);
-    m_model->setParentWId(winId());
-    m_model->init(printer.name());
-    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(updateButtons()));
-    connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(update()));
-    m_proxyModel = new JobSortFilterModel(this);
-    m_proxyModel->setSourceModel(m_model);
-    m_proxyModel->setDynamicSortFilter(true);
-
-    ui->jobsView->setModel(m_proxyModel);
-    ui->jobsView->setItemDelegate(new NoSelectionRectDelegate(this));
-    // sort by status column means the jobs will be sorted by the queue order
-    ui->jobsView->sortByColumn(JobModel::ColStatus, Qt::AscendingOrder);
-    connect(ui->jobsView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
-            this, SLOT(updateButtons()));
-    connect(ui->jobsView, SIGNAL(customContextMenuRequested(QPoint)),
-            this, SLOT(showContextMenu(QPoint)));
-    ui->jobsView->header()->setContextMenuPolicy(Qt::CustomContextMenu);
-    connect(ui->jobsView->header(), SIGNAL(customContextMenuRequested(QPoint)),
-            this, SLOT(showHeaderContextMenu(QPoint)));
-
-    QHeaderView *header = ui->jobsView->header();
-    header->setResizeMode(QHeaderView::Interactive);
-    header->setStretchLastSection(false);
-    header->setResizeMode(JobModel::ColStatus,        QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColName,          QHeaderView::Stretch);
-    header->setResizeMode(JobModel::ColUser,          QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColCreated,       QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColCompleted,     QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColPages,         QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColProcessed,     QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColSize,          QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColStatusMessage, QHeaderView::ResizeToContents);
-    header->setResizeMode(JobModel::ColPrinter,       QHeaderView::ResizeToContents);
-
-    KConfig config("print-manager");
-    KConfigGroup printQueue(&config, "PrintQueue");
-    if (printQueue.hasKey("ColumnState")) {
-        // restore the header state order
-        header->restoreState(printQueue.readEntry("ColumnState", QByteArray()));
-    } else {
-        // Hide some columns ColPrinter
-        header->hideSection(JobModel::ColPrinter);
-        header->hideSection(JobModel::ColUser);
-        header->hideSection(JobModel::ColCompleted);
-        header->hideSection(JobModel::ColSize);
-        header->hideSection(JobModel::ColFromHost);
-    }
-
-    // This is emitted when a printer is modified
-    connect(KCupsConnection::global(),
-            SIGNAL(printerModified(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer has it's state changed
-    connect(KCupsConnection::global(),
-            SIGNAL(printerStateChanged(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is stopped
-    connect(KCupsConnection::global(),
-            SIGNAL(printerStopped(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is restarted
-    connect(KCupsConnection::global(),
-            SIGNAL(printerRestarted(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is shutdown
-    connect(KCupsConnection::global(),
-            SIGNAL(printerShutdown(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer is removed
-    connect(KCupsConnection::global(),
-            SIGNAL(printerDeleted(QString,QString,QString,uint,QString,bool)),
-            this,
-            SLOT(updatePrinter(QString,QString,QString,uint,QString,bool)));
-
-    // This is emitted when a printer/queue is changed
-    // Deprecated stuff that works better than the above
-    connect(KCupsConnection::global(), SIGNAL(rhPrinterAdded(QString)),
-            this, SLOT(updatePrinter(QString)));
-
-    connect(KCupsConnection::global(), SIGNAL(rhPrinterRemoved(QString)),
-            this, SLOT(updatePrinter(QString)));
-
-    connect(KCupsConnection::global(), SIGNAL(rhQueueChanged(QString)),
-            this, SLOT(updatePrinter(QString)));
-
-    updatePrinter(m_destName);
-
-    // Restore the dialog size
-    restoreDialogSize(printQueue);
-}
-
-PrintQueueUi::~PrintQueueUi()
-{
-    KConfig config("print-manager");
-    KConfigGroup configGroup(&config, "PrintQueue");
-    // save the header state order
-    configGroup.writeEntry("ColumnState", ui->jobsView->header()->saveState());
-
-    // Save the dialog size
-    saveDialogSize(configGroup);
-}
-
-int PrintQueueUi::columnCount(const QModelIndex &parent) const
-{
-    if (!parent.isValid()) {
-        return JobModel::LastColumn;
-    }
-    return 0;
-}
-
-void PrintQueueUi::setState(int state, const QString &message)
-{
-    kDebug() << state << message;
-    if (state != m_lastState ||
-        ui->printerStatusMsgL->text() != message) {
-        // save the last state so the ui doesn't need to keep updating
-        if (ui->printerStatusMsgL->text() != message) {
-            ui->printerStatusMsgL->setText(message);
-        }
-        m_lastState = state;
-
-        QPixmap icon(m_printerIcon);
-        m_printerPaused = false;
-        switch (state) {
-        case KCupsPrinter::Idle:
-            ui->statusL->setText(i18n("Printer ready"));
-            ui->pausePrinterPB->setText(i18n("Pause Printer"));
-            ui->pausePrinterPB->setIcon(KIcon("media-playback-pause"));
-            break;
-        case KCupsPrinter::Printing:
-            if (!m_title.isNull()) {
-                QString jobTitle = m_model->processingJob();
-                if (jobTitle.isEmpty()) {
-                    ui->statusL->setText(i18n("Printing..."));
-                } else {
-                    ui->statusL->setText(i18n("Printing '%1'", jobTitle));
-                }
-                ui->pausePrinterPB->setText(i18n("Pause Printer"));
-                ui->pausePrinterPB->setIcon(KIcon("media-playback-pause"));
-            }
-            break;
-        case KCupsPrinter::Stopped:
-            m_printerPaused = true;
-            ui->statusL->setText(i18n("Printer paused"));
-            ui->pausePrinterPB->setText(i18n("Resume Printer"));
-            ui->pausePrinterPB->setIcon(KIcon("media-playback-start"));
-            // create a paiter to paint the action icon over the key icon
-            {
-                QPainter painter(&icon);
-                // the emblem icon to size 32
-                int overlaySize = KIconLoader::SizeMedium;
-                QPoint startPoint;
-                // bottom right corner
-                startPoint = QPoint(PRINTER_ICON_SIZE - overlaySize - 2,
-                                    PRINTER_ICON_SIZE - overlaySize - 2);
-                painter.drawPixmap(startPoint, m_pauseIcon);
-            }
-            break;
-        default :
-            ui->statusL->setText(i18n("Printer state unknown"));
-            break;
-        }
-        // set the printer icon
-        setWindowIcon(icon);
-    }
-}
-
-void PrintQueueUi::showContextMenu(const QPoint &point)
-{
-    // check if the click was actually over a job
-    if (!ui->jobsView->indexAt(point).isValid() || m_preparingMenu) {
-        return;
-    }
-    m_preparingMenu = true;
-
-    bool moveTo = false;
-    QItemSelection selection;
-    // we need to map the selection to source to get the real indexes
-    selection = m_proxyModel->mapSelectionToSource(ui->jobsView->selectionModel()->selection());
-    // if the selection is empty the user clicked on an empty space
-    if (!selection.indexes().isEmpty()) {
-        foreach (const QModelIndex &index, selection.indexes()) {
-            if (index.column() == 0 && index.flags() & Qt::ItemIsDragEnabled) {
-                // Found a move to item
-                moveTo = true;
-                break;
-            }
-        }
-        // if we can move a job create the menu
-        if (moveTo) {
-            // context menu
-            QMenu *menu = new QMenu(this);
-            // move to menu
-            QMenu *moveToMenu = new QMenu(i18n("Move to"), this);
-
-            // get printers we can move to
-            QPointer<KCupsRequest> request = new KCupsRequest;
-            QStringList attr;
-            attr << KCUPS_PRINTER_NAME;
-            attr << KCUPS_PRINTER_INFO;
-            request->getPrinters(attr);
-            request->waitTillFinished();
-            if (!request) {
-                return;
-            }
-            KCupsPrinters printers = request->printers();
-            request->deleteLater();
-
-            foreach (const KCupsPrinter &printer, printers) {
-                // If there is a printer and it's not the current one add it
-                // as a new destination
-                if (printer.name() != m_destName) {
-                    QAction *action = moveToMenu->addAction(printer.info());
-                    action->setData(printer.name());
-                }
-            }
-
-            if (!moveToMenu->isEmpty()) {
-                menu->addMenu(moveToMenu);
-                // show the menu on the right point
-                QAction *action = menu->exec(ui->jobsView->mapToGlobal(point));
-                if (action) {
-                    // move the job
-                    modifyJob(JobModel::Move, action->data().toString());
-                }
-            }
-        }
-    }
-    m_preparingMenu = false;
-}
-
-void PrintQueueUi::showHeaderContextMenu(const QPoint &point)
-{
-    // Displays a menu containing the header name, and
-    // a check box to indicate if it's being shown
-    QMenu *menu = new QMenu(this);
-    for (int i = 0; i < m_proxyModel->columnCount(); i++) {
-        QAction *action;
-        QString name;
-        name = m_proxyModel->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString();
-        action = menu->addAction(name);
-        action->setCheckable(true);
-        action->setChecked(!ui->jobsView->header()->isSectionHidden(i));
-        action->setData(i);
-    }
-
-    QAction *action = menu->exec(ui->jobsView->header()->mapToGlobal(point));
-    if (action) {
-        int section = action->data().toInt();
-        if (action->isChecked()) {
-            ui->jobsView->header()->showSection(section);
-        } else {
-            ui->jobsView->header()->hideSection(section);
-        }
-    }
-}
-
-void PrintQueueUi::updatePrinter(const QString &printer)
-{
-    kDebug() << printer << m_destName;
-    if (printer != m_destName) {
-        // It was another printer that changed
-        return;
-    }
-
-    QStringList attr;
-    attr << KCUPS_PRINTER_INFO;
-    attr << KCUPS_PRINTER_TYPE;
-    attr << KCUPS_PRINTER_STATE;
-    attr << KCUPS_PRINTER_STATE_MESSAGE;
-
-    KCupsRequest *request = new KCupsRequest;
-    connect(request, SIGNAL(finished()), this, SLOT(getAttributesFinished()));
-    request->getPrinterAttributes(printer, m_isClass, attr);
-}
-
-void PrintQueueUi::updatePrinter(const QString &text, const QString &printerUri, const QString &printerName, uint printerState, const QString &printerStateReasons, bool printerIsAcceptingJobs)
-{
-    // REALLY? all these parameters just to say foo was added??
-    Q_UNUSED(text)
-    Q_UNUSED(printerUri)
-    Q_UNUSED(printerState)
-    Q_UNUSED(printerStateReasons)
-    Q_UNUSED(printerIsAcceptingJobs)
-    kDebug() << printerName << printerStateReasons;
-
-    updatePrinter(printerName);
-}
-
-void PrintQueueUi::getAttributesFinished()
-{
-    KCupsRequest *request = qobject_cast<KCupsRequest *>(sender());
-    kDebug() << request->hasError() << request->printers().isEmpty();
-
-    if (request->hasError() || request->printers().isEmpty()) {
-        // if cups stops we disable our queue
-        setEnabled(false);
-        request->deleteLater(); // DO not delete before using as the request is in another thread
-        return;
-    } else if (isEnabled() == false) {
-        // if cups starts again we enable our queue
-        setEnabled(true);
-    }
-
-    KCupsPrinter printer = request->printers().first();
-
-    // get printer-info
-    if (printer.info().isEmpty()) {
-        m_title = printer.name();
-    } else {
-        m_title = printer.name() + QLatin1String(" - ") + printer.info();
-    }
-
-    // get printer-state
-    setState(printer.state(), printer.stateMsg());
-
-    // store if the printer is a class
-    m_isClass = printer.isClass();
-
-    request->deleteLater();
-
-    update();
-}
-
-void PrintQueueUi::update()
-{
-    // Set window title
-    if (m_model->rowCount()) {
-        if (m_destName.isNull()) {
-            setWindowTitle(i18np("All Printers (%1 Job)", "All Printers (%1 Jobs)", m_model->rowCount()));
-        } else {
-            setWindowTitle(i18np("%2 (%1 Job)", "%2 (%1 Jobs)", m_model->rowCount(), m_title));
-        }
-    } else {
-        setWindowTitle(m_destName.isNull() ? i18n("All Printers") : m_title);
-    }
-}
-
-void PrintQueueUi::updateButtons()
-{
-    bool cancel, hold, release, reprint;
-    // Set all options to false
-    cancel = hold = release = reprint = false;
-
-    QItemSelection selection;
-    // we need to map the selection to source to get the real indexes
-    selection = m_proxyModel->mapSelectionToSource(ui->jobsView->selectionModel()->selection());
-    // enable or disable the job action buttons if something is selected
-    if (!selection.indexes().isEmpty()) {
-        foreach (const QModelIndex &index, selection.indexes()) {
-            if (index.column() == 0) {
-                switch (static_cast<ipp_jstate_t>(index.data(JobModel::RoleJobState).toInt())) {
-                    case IPP_JOB_CANCELED :
-                    case IPP_JOB_COMPLETED :
-                    case IPP_JOB_ABORTED :
-                        break;
-                    case IPP_JOB_HELD :
-                    case IPP_JOB_STOPPED :
-                        release = true;
-                        cancel = true;
-                        break;
-                    default:
-                        cancel = hold = true;
-                        break;
-                }
-                if (index.data(JobModel::RoleJobRestartEnabled).toBool()) {
-                    reprint = true;
-                }
-            }
-        }
-    }
-
-    ui->cancelJobPB->setEnabled(cancel);
-    ui->holdJobPB->setEnabled(hold);
-    ui->resumeJobPB->setEnabled(release);
-    ui->reprintPB->setEnabled(reprint);
-}
-
-void PrintQueueUi::modifyJob(int action, const QString &destName)
-{
-    // get all selected indexes
-    QItemSelection selection;
-    // we need to map the selection to source to get the real indexes
-    selection = m_proxyModel->mapSelectionToSource(ui->jobsView->selectionModel()->selection());
-    foreach (const QModelIndex &index, selection.indexes()) {
-        if (index.column() == 0) {
-            KCupsRequest *request;
-            request = m_model->modifyJob(index.row(),
-                                         static_cast<JobModel::JobAction>(action),
-                                         destName);
-            if (!request) {
-                // probably the job already has this state
-                // or this is an unknown action
-                continue;
-            }
-            request->waitTillFinished();
-            if (request->hasError()) {
-                QString msg, jobName;
-                jobName = m_model->item(index.row(), static_cast<int>(JobModel::ColName))->text();
-                switch (action) {
-                case JobModel::Cancel:
-                    msg = i18n("Failed to cancel '%1'", jobName);
-                    break;
-                case JobModel::Hold:
-                    msg = i18n("Failed to hold '%1'", jobName);
-                    break;
-                case JobModel::Release:
-                    msg = i18n("Failed to release '%1'", jobName);
-                    break;
-                case JobModel::Reprint:
-                    msg = i18n("Failed to reprint '%1'", jobName);
-                    break;
-                case JobModel::Move:
-                    msg = i18n("Failed to move '%1' to '%2'", jobName, destName);
-                    break;
-                }
-                KMessageBox::detailedSorry(this,
-                                           msg,
-                                           request->errorMsg(),
-                                           i18n("Failed"));
-            }
-            request->deleteLater();
-        }
-    }
-}
-
-void PrintQueueUi::pausePrinter()
-{
-    // STOP and RESUME printer
-    QPointer<KCupsRequest> request = new KCupsRequest;
-    if (m_printerPaused) {
-        kDebug() << m_destName << "m_printerPaused";
-        request->resumePrinter(m_destName);
-    } else {
-        kDebug() << m_destName << "NOT m_printerPaused";
-        request->pausePrinter(m_destName);
-    }
-    request->waitTillFinished();
-    if (request) {
-        request->deleteLater();
-    }
-}
-
-void PrintQueueUi::configurePrinter()
-{
-    QDBusMessage message;
-    message = QDBusMessage::createMethodCall(QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("/"),
-                                             QLatin1String("org.kde.ConfigurePrinter"),
-                                             QLatin1String("ConfigurePrinter"));
-    message << qVariantFromValue(m_destName);
-    QDBusConnection::sessionBus().send(message);
-}
-
-void PrintQueueUi::cancelJob()
-{
-    // CANCEL a job
-    modifyJob(JobModel::Cancel);
-}
-
-void PrintQueueUi::holdJob()
-{
-    // HOLD a job
-    modifyJob(JobModel::Hold);
-}
-
-void PrintQueueUi::resumeJob()
-{
-    // RESUME a job
-    modifyJob(JobModel::Release);
-}
-
-void PrintQueueUi::reprintJob()
-{
-    modifyJob(JobModel::Reprint);
-}
-
-void PrintQueueUi::whichJobsIndexChanged(int index)
-{
-    switch (index) {
-    case 1:
-        m_model->setWhichJobs(JobModel::WhichCompleted);
-        break;
-    case 2:
-        m_model->setWhichJobs(JobModel::WhichAll);
-        break;
-    default:
-        m_model->setWhichJobs(JobModel::WhichActive);
-        break;
-    }
-
-}
-
-void PrintQueueUi::setupButtons()
-{
-    // setup jobs buttons
-
-    // cancel action
-    ui->cancelJobPB->setIcon(KIcon("dialog-cancel"));
-
-    // hold job action
-    ui->holdJobPB->setIcon(KIcon("document-open-recent"));
-
-    // resume job action
-    // TODO we need a new icon
-    ui->resumeJobPB->setIcon(KIcon("media-playback-start"));
-
-    ui->reprintPB->setIcon(KIcon("view-refresh"));
-
-    ui->whichJobsCB->setItemIcon(0, KIcon("view-filter"));
-    ui->whichJobsCB->setItemIcon(1, KIcon("view-filter"));
-    ui->whichJobsCB->setItemIcon(2, KIcon("view-filter"));
-
-    // stop start printer
-    ui->pausePrinterPB->setIcon(KIcon("media-playback-pause"));
-
-    // configure printer
-    ui->configurePrinterPB->setIcon(KIcon("configure"));
-}
-
-void PrintQueueUi::closeEvent(QCloseEvent *event)
-{
-    // emits finished signal to be removed the cache
-    emit finished();
-    QWidget::closeEvent(event);
-}
-
-#include "moc_PrintQueueUi.cpp"
diff --git a/print-manager/printqueue/PrintQueueUi.h b/print-manager/printqueue/PrintQueueUi.h
deleted file mode 100644 (file)
index 870d4e6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010 by Daniel Nicoletti                                *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#ifndef PRINT_QUEUE_UI_H
-#define PRINT_QUEUE_UI_H
-
-#include <KDialog>
-#include <QtCore/qabstractitemmodel.h>
-#include <QToolButton>
-
-class KCupsPrinter;
-class JobSortFilterModel;
-class JobModel;
-
-QT_BEGIN_NAMESPACE
-class Ui_PrintQueueUi;
-QT_END_NAMESPACE
-
-class PrintQueueUi : public KDialog
-{
-    Q_OBJECT
-public:
-    explicit PrintQueueUi(const KCupsPrinter &printer, QWidget *parent = 0);
-    ~PrintQueueUi();
-
-signals:
-    void finished();
-
-public slots:
-    void update();
-
-private slots:
-    void updatePrinter(const QString &printer);
-    void updatePrinter(const QString &text,
-                       const QString &printerUri,
-                       const QString &printerName,
-                       uint printerState,
-                       const QString &printerStateReasons,
-                       bool printerIsAcceptingJobs);
-    void whichJobsIndexChanged(int index);
-    void pausePrinter();
-    void configurePrinter();
-
-    void cancelJob();
-    void holdJob();
-    void resumeJob();
-    void reprintJob();
-
-    int columnCount(const QModelIndex &parent = QModelIndex()) const;
-    void updateButtons();
-    void showContextMenu(const QPoint &point);
-    void showHeaderContextMenu(const QPoint &point);
-    void getAttributesFinished();
-
-private:
-    void closeEvent(QCloseEvent *event);
-    void setupButtons();
-    void setState(int state, const QString &message);
-    void modifyJob(int action, const QString &destName = QString());
-
-    Ui_PrintQueueUi *ui;
-    QToolButton *m_filterJobs;
-    JobSortFilterModel *m_proxyModel;
-    JobModel *m_model;
-    QString m_destName;
-    QString m_title;
-    bool m_isClass;
-    bool m_preparingMenu;
-    QPixmap m_printerIcon;
-    QPixmap m_pauseIcon;
-    QPixmap m_startIcon;
-    QPixmap m_warningIcon;
-    bool m_printerPaused;
-    char m_lastState;
-};
-
-#endif
diff --git a/print-manager/printqueue/PrintQueueUi.ui b/print-manager/printqueue/PrintQueueUi.ui
deleted file mode 100644 (file)
index 6b053b2..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrintQueueUi</class>
- <widget class="QWidget" name="PrintQueueUi">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>550</width>
-    <height>402</height>
-   </rect>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>550</width>
-    <height>0</height>
-   </size>
-  </property>
-  <property name="windowTitle">
-   <string>my printer (x jobs)</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0" colspan="2">
-    <layout class="QGridLayout" name="gridLayout_2">
-     <property name="leftMargin">
-      <number>10</number>
-     </property>
-     <item row="0" column="0" rowspan="5">
-      <widget class="QLabel" name="iconL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>Printer Icon</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="1">
-      <spacer name="verticalSpacer_2">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Ignored</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>1</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item row="1" column="1" colspan="4">
-      <widget class="QLabel" name="statusL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>12</pointsize>
-        </font>
-       </property>
-       <property name="text">
-        <string notr="true">Printer Status</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1" colspan="4">
-      <widget class="QLabel" name="printerStatusMsgL">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string notr="true">printer status message</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-       <property name="indent">
-        <number>10</number>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="1">
-      <widget class="QPushButton" name="pausePrinterPB">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>Pause Printer</string>
-       </property>
-      </widget>
-     </item>
-     <item row="4" column="2">
-      <widget class="QPushButton" name="configurePrinterPB">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>Configure</string>
-       </property>
-      </widget>
-     </item>
-     <item row="3" column="1">
-      <spacer name="verticalSpacer">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Ignored</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>1</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="3" column="0" colspan="2">
-    <widget class="QTreeView" name="jobsView">
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>130</height>
-      </size>
-     </property>
-     <property name="baseSize">
-      <size>
-       <width>640</width>
-       <height>0</height>
-      </size>
-     </property>
-     <property name="contextMenuPolicy">
-      <enum>Qt::CustomContextMenu</enum>
-     </property>
-     <property name="acceptDrops">
-      <bool>true</bool>
-     </property>
-     <property name="showDropIndicator" stdset="0">
-      <bool>false</bool>
-     </property>
-     <property name="dragEnabled">
-      <bool>true</bool>
-     </property>
-     <property name="dragDropMode">
-      <enum>QAbstractItemView::DragDrop</enum>
-     </property>
-     <property name="defaultDropAction">
-      <enum>Qt::MoveAction</enum>
-     </property>
-     <property name="alternatingRowColors">
-      <bool>true</bool>
-     </property>
-     <property name="selectionMode">
-      <enum>QAbstractItemView::ExtendedSelection</enum>
-     </property>
-     <property name="textElideMode">
-      <enum>Qt::ElideMiddle</enum>
-     </property>
-     <property name="rootIsDecorated">
-      <bool>false</bool>
-     </property>
-     <property name="sortingEnabled">
-      <bool>true</bool>
-     </property>
-     <property name="animated">
-      <bool>true</bool>
-     </property>
-     <property name="expandsOnDoubleClick">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="2">
-    <layout class="QHBoxLayout" name="horizontalLayout_2">
-     <item>
-      <widget class="Line" name="line_3">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <property name="leftMargin">
-      <number>4</number>
-     </property>
-     <property name="rightMargin">
-      <number>4</number>
-     </property>
-     <item>
-      <widget class="QPushButton" name="cancelJobPB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Cancel</string>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="Line" name="line">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="holdJobPB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Hold</string>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="resumeJobPB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Resume</string>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="reprintPB">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>Reprint</string>
-       </property>
-       <property name="flat">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_2">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="KComboBox" name="whichJobsCB">
-       <property name="insertPolicy">
-        <enum>QComboBox::NoInsert</enum>
-       </property>
-       <property name="sizeAdjustPolicy">
-        <enum>QComboBox::AdjustToContents</enum>
-       </property>
-       <property name="frame">
-        <bool>false</bool>
-       </property>
-       <item>
-        <property name="text">
-         <string>Active Jobs</string>
-        </property>
-       </item>
-       <item>
-        <property name="text">
-         <string>Completed Jobs</string>
-        </property>
-       </item>
-       <item>
-        <property name="text">
-         <string>All Jobs</string>
-        </property>
-       </item>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/print-manager/printqueue/main.cpp b/print-manager/printqueue/main.cpp
deleted file mode 100644 (file)
index 3782d51..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2010-2012 by Daniel Nicoletti                           *
- *   dantti12@gmail.com                                                    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; see the file COPYING. If not, write to       *
- *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
- *   Boston, MA 02110-1301, USA.                                           *
- ***************************************************************************/
-
-#include "PrintQueue.h"
-
-#include <config.h>
-
-#include <KDebug>
-#include <KLocale>
-#include <KAboutData>
-#include <KCmdLineArgs>
-
-int main(int argc, char **argv)
-{
-    KAboutData about("PrintQueue",
-                     "print-manager",
-                     ki18n("PrintQueue"),
-                     PM_VERSION,
-                     ki18n("PrintQueue"),
-                     KAboutData::License_GPL,
-                     ki18n("(C) 2010-2013 Daniel Nicoletti"));
-
-    about.addAuthor(ki18n("Daniel Nicoletti"), KLocalizedString(), "dantti12@gmail.com");
-
-    KCmdLineArgs::init(argc, argv, &about);
-    KCmdLineOptions options;
-    options.add("+queuename", ki18n("Show printer queue"));
-    KCmdLineArgs::addCmdLineOptions(options);
-
-    PrintQueue::addCmdLineOptions();
-
-    if (!PrintQueue::start()) {
-        //kDebug() << "PrintQueue is already running!";
-        return 0;
-    }
-
-    PrintQueue app;
-    return app.exec();
-}