From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- tools/qtconfig/LICENSE.GPL | 280 ++++ tools/qtconfig/colorbutton.cpp | 177 +++ tools/qtconfig/colorbutton.h | 82 ++ tools/qtconfig/images/appicon.png | Bin 0 -> 714 bytes tools/qtconfig/main.cpp | 45 + tools/qtconfig/mainwindow.cpp | 1142 +++++++++++++++++ tools/qtconfig/mainwindow.h | 104 ++ tools/qtconfig/mainwindowbase.ui | 1846 +++++++++++++++++++++++++++ tools/qtconfig/paletteeditoradvanced.cpp | 615 +++++++++ tools/qtconfig/paletteeditoradvanced.h | 98 ++ tools/qtconfig/paletteeditoradvancedbase.ui | 682 ++++++++++ tools/qtconfig/previewframe.cpp | 63 + tools/qtconfig/previewframe.h | 67 + tools/qtconfig/previewwidget.cpp | 75 ++ tools/qtconfig/previewwidget.h | 50 + tools/qtconfig/previewwidgetbase.ui | 311 +++++ tools/qtconfig/qtconfig.pro | 18 + 17 files changed, 5655 insertions(+) create mode 100644 tools/qtconfig/LICENSE.GPL create mode 100644 tools/qtconfig/colorbutton.cpp create mode 100644 tools/qtconfig/colorbutton.h create mode 100644 tools/qtconfig/images/appicon.png create mode 100644 tools/qtconfig/main.cpp create mode 100644 tools/qtconfig/mainwindow.cpp create mode 100644 tools/qtconfig/mainwindow.h create mode 100644 tools/qtconfig/mainwindowbase.ui create mode 100644 tools/qtconfig/paletteeditoradvanced.cpp create mode 100644 tools/qtconfig/paletteeditoradvanced.h create mode 100644 tools/qtconfig/paletteeditoradvancedbase.ui create mode 100644 tools/qtconfig/previewframe.cpp create mode 100644 tools/qtconfig/previewframe.h create mode 100644 tools/qtconfig/previewwidget.cpp create mode 100644 tools/qtconfig/previewwidget.h create mode 100644 tools/qtconfig/previewwidgetbase.ui create mode 100644 tools/qtconfig/qtconfig.pro (limited to 'tools/qtconfig') diff --git a/tools/qtconfig/LICENSE.GPL b/tools/qtconfig/LICENSE.GPL new file mode 100644 index 0000000..3221c03 --- /dev/null +++ b/tools/qtconfig/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Steet, 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 Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/tools/qtconfig/colorbutton.cpp b/tools/qtconfig/colorbutton.cpp new file mode 100644 index 0000000..1e678f2 --- /dev/null +++ b/tools/qtconfig/colorbutton.cpp @@ -0,0 +1,177 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "colorbutton.h" + +#include +#include +#include +#include +#include + + +ColorButton::ColorButton(QWidget *parent, const char *name) + : QButton(parent, name), mousepressed(FALSE) +{ + setAcceptDrops(TRUE); + col = black; + connect(this, SIGNAL(clicked()), SLOT(changeColor())); +} + + +ColorButton::ColorButton(const QColor &c, QWidget *parent, const char *name) + : QButton(parent, name) +{ + setAcceptDrops(TRUE); + col = c; + connect(this, SIGNAL(clicked()), SLOT(changeColor())); +} + + +void ColorButton::setColor(const QColor &c) +{ + col = c; + update(); +} + + +void ColorButton::changeColor() +{ + QColor c = QColorDialog::getColor(col, qApp->activeWindow()); + + if (c.isValid()) { + setColor(c); + emit colorChanged(color()); + } +} + + +QSize ColorButton::sizeHint() const +{ + return QSize(40, 25); +} + + +QSize ColorButton::minimumSizeHint() const +{ + return QSize(40, 25); +} + + +void ColorButton::drawButton(QPainter *p) +{ + style().drawPrimitive(QStyle::PE_ButtonBevel, p, rect(), colorGroup(), + isDown() ? QStyle::Style_Down : QStyle::Style_Raised); + drawButtonLabel(p); + + if (hasFocus()) + style().drawPrimitive(QStyle::PE_FocusRect, p, + style().subRect(QStyle::SR_PushButtonFocusRect, this), + colorGroup(), QStyle::Style_Default); +} + + +void ColorButton::drawButtonLabel(QPainter *p) +{ + QColor pen = (isEnabled() ? + (hasFocus() ? palette().active().buttonText() : + palette().inactive().buttonText()) + : palette().disabled().buttonText()); + p->setPen( pen ); + p->setBrush(col); + p->drawRect(width() / 4, height() / 4, width() / 2, height() / 2); +} + + +void ColorButton::dragEnterEvent(QDragEnterEvent *e) +{ + if (! QColorDrag::canDecode(e)) { + e->ignore(); + return; + } +} + + +void ColorButton::dragMoveEvent(QDragMoveEvent *e) +{ + if (! QColorDrag::canDecode(e)) { + e->ignore(); + return; + } + + e->accept(); +} + + +void ColorButton::dropEvent(QDropEvent *e) +{ + if (! QColorDrag::canDecode(e)) { + e->ignore(); + return; + } + + QColor c; + QColorDrag::decode(e, c); + setColor(c); + emit colorChanged(color()); +} + + +void ColorButton::mousePressEvent(QMouseEvent *e) +{ + presspos = e->pos(); + mousepressed = TRUE; + QButton::mousePressEvent(e); +} + + +void ColorButton::mouseReleaseEvent(QMouseEvent *e) +{ + mousepressed = FALSE; + QButton::mouseReleaseEvent(e); +} + + +void ColorButton::mouseMoveEvent(QMouseEvent *e) +{ + if (! mousepressed) + return; + + if ((presspos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { + mousepressed = FALSE; + setDown(FALSE); + + QColorDrag *cd = new QColorDrag(color(), this); + cd->dragCopy(); + } +} diff --git a/tools/qtconfig/colorbutton.h b/tools/qtconfig/colorbutton.h new file mode 100644 index 0000000..4f370d0 --- /dev/null +++ b/tools/qtconfig/colorbutton.h @@ -0,0 +1,82 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef COLORBUTTON_H +#define COLORBUTTON_H + +#include + + +class ColorButton : public QButton +{ + Q_OBJECT + +public: + ColorButton(QWidget *, const char * = 0); + ColorButton(const QColor &, QWidget *, const char * = 0); + + const QColor &color() const { return col; } + + void setColor(const QColor &); + QSize sizeHint() const; + QSize minimumSizeHint() const; + + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void dragEnterEvent(QDragEnterEvent *); + void dragMoveEvent(QDragMoveEvent *); + void dropEvent(QDropEvent *); + + +signals: + void colorChanged(const QColor &); + + +protected: + void drawButton(QPainter *); + void drawButtonLabel(QPainter *); + + +private slots: + void changeColor(); + + +private: + QColor col; + QPoint presspos; + bool mousepressed; +}; + + +#endif // COLORBUTTON_H diff --git a/tools/qtconfig/images/appicon.png b/tools/qtconfig/images/appicon.png new file mode 100644 index 0000000..0cb2b68 Binary files /dev/null and b/tools/qtconfig/images/appicon.png differ diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp new file mode 100644 index 0000000..980e64c --- /dev/null +++ b/tools/qtconfig/main.cpp @@ -0,0 +1,45 @@ +/********************************************************************** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "mainwindow.h" +#include + + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + MainWindow mw; + app.setMainWidget(&mw); + mw.show(); + return app.exec(); +} diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp new file mode 100644 index 0000000..c9f81ff --- /dev/null +++ b/tools/qtconfig/mainwindow.cpp @@ -0,0 +1,1142 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "mainwindow.h" +#include "colorbutton.h" +#include "previewframe.h" +#include "paletteeditoradvanced.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +// from qapplication.cpp and qapplication_x11.cpp - These are NOT for +// external use ignore them +extern bool Q_EXPORT qt_resolve_symlinks; + + +static const char *appearance_text = +"

Appearance

" +"
" +"

Use this tab to customize the appearance of your Qt applications.

" +"

You can select the default GUI Style from the drop down list and " +"customize the colors.

" +"

Any GUI Style plugins in your plugin path will automatically be added " +"to the list of built-in Qt styles. (See the Library Paths tab for " +"information on adding new plugin paths.)

" +"

When you choose 3-D Effects and Background colors, the Qt Configuration " +"program will automatically generate a palette for you. To customize " +"colors further, press the Tune Palette button to open the advanced " +"palette editor." +"

The Preview Window shows what the selected Style and colors look " +"like."; + +static const char *font_text = +"

Fonts

" +"
" +"

Use this tab to select the default font for your Qt applications. " +"The selected font is shown (initially as 'Sample Text') in the line " +"edit below the Family, " +"Style and Point Size drop down lists.

" +"

Qt has a powerful font substitution feature that allows you to " +"specify a list of substitute fonts. Substitute fonts are used " +"when a font cannot be loaded, or if the specified font doesn't have " +"a particular character." +"

For example, if you select the font Lucida, which doesn't have Korean " +"characters, but need to show some Korean text using the Mincho font family " +"you can do so by adding Mincho to the list. Once Mincho is added, any " +"Korean characters that are not found in the Lucida font will be taken " +"from the Mincho font. Because the font substitutions are " +"lists, you can also select multiple families, such as Song Ti (for " +"use with Chinese text)."; + +static const char *interface_text = +"

Interface

" +"
" +"

Use this tab to customize the feel of your Qt applications.

" +"

If the Resolve Symlinks checkbox is checked Qt will follow symlinks " +"when handling URLs. For example, in the file dialog, if this setting is turned " +"on and /usr/tmp is a symlink to /var/tmp, entering the /usr/tmp directory " +"will cause the file dialog to change to /var/tmp. With this setting turned " +"off, symlinks are not resolved or followed.

" +"

The Global Strut setting is useful for people who require a " +"minimum size for all widgets (e.g. when using a touch panel or for users " +"who are visually impaired). Leaving the Global Strut width and height " +"at 0 will disable the Global Strut feature

" +"

XIM (Extended Input Methods) are used for entering characters in " +"languages that have large character sets, for example, Chinese and " +"Japanese."; +// ### What does the 'Enhanced support for languages written R2L do? + +static const char *libpath_text = +"

Library Paths

" +"
" +"

Use this tab to select additional directories where Qt should search " +"for component plugins." +"

These directories should be the base directory of where your plugins " +"are stored. For example, if you wish to store GUI Style plugins in " +"$HOME/plugins/styles and Qt Designer plugins in $HOME/plugins/designer, " +"you would add $HOME/plugins to your Library Path.

Notes:" +"

  • The Qt Configuration program does not support environment " +"variables, so you must give full path names, for example " +"/home/brad/myplugins not $HOME/myplugins" +"
  • Qt automatically " +"searches in the directory where you installed Qt for component plugins. " +"Removing that path is not possible.
"; + +static const char *printer_text = +"

Printer

" +"
" +"

Use this tab to configure the way Qt generates output for the printer." +"You can specify if Qt should try to embed fonts into its generated output." +"If you enable font embedding, the resulting postscript will be more " +"portable and will more accurately reflect the " +"visual output on the screen; however the resulting postscript file " +"size will be bigger." +"

When using font embedding you can select additional directories where " +"Qt should search for embeddable font files. By default, the X " +"server font path is used."; + +static const char *about_text = +"

Qt Configuration

" +"

A graphical configuration tool for programs using Qt

" +"

Version 1.0

" +"

Copyright (C) 2001-2008 Trolltech ASA. All rights reserved.

" +"

" +"

This program is licensed to you under the terms of the GNU General " +"Public License Version 2 as published by the Free Software Foundation. This " +"gives you legal permission to copy, distribute and/or modify this software " +"under certain conditions. For details, see the file 'LICENSE.GPL' that came with " +"this software distribution. If you did not get the file, send email to " +"info@trolltech.com.

\n\n

The program is provided AS IS with NO WARRANTY " +"OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " +"FOR A PARTICULAR PURPOSE.

"; + + +static QColorGroup::ColorRole centralFromItem( int item ) +{ + switch( item ) { + case 0: return QColorGroup::Background; + case 1: return QColorGroup::Foreground; + case 2: return QColorGroup::Button; + case 3: return QColorGroup::Base; + case 4: return QColorGroup::Text; + case 5: return QColorGroup::BrightText; + case 6: return QColorGroup::ButtonText; + case 7: return QColorGroup::Highlight; + case 8: return QColorGroup::HighlightedText; + default: return QColorGroup::NColorRoles; + } +} + + +static QColorGroup::ColorRole effectFromItem( int item ) +{ + switch( item ) { + case 0: return QColorGroup::Light; + case 1: return QColorGroup::Midlight; + case 2: return QColorGroup::Mid; + case 3: return QColorGroup::Dark; + case 4: return QColorGroup::Shadow; + default: return QColorGroup::NColorRoles; + } +} + + +static void setStyleHelper(QWidget *w, QStyle *s) +{ + w->unsetPalette(); + w->setStyle(s); + + const QObjectList *children = w->children(); + if (! children) + return; + + QPtrListIterator childit(*children); + QObject *child; + while ((child = childit.current()) != 0) { + ++childit; + + if (child->isWidgetType()) + setStyleHelper((QWidget *) child, s); + } +} + + +MainWindow::MainWindow() + : MainWindowBase(0, "main window"), + editPalette(palette()), previewPalette(palette()), previewstyle(0) +{ + modified = TRUE; + + QStringList gstyles = QStyleFactory::keys(); + gstyles.sort(); + gstylecombo->insertStringList(gstyles); + + QSettings settings; + QString currentstyle = settings.readEntry("/qt/style"); + if (currentstyle.isNull()) + currentstyle = QApplication::style().className(); + { + int s = 0; + QStringList::Iterator git = gstyles.begin(); + while (git != gstyles.end()) { + if (*git == currentstyle) + break; + s++; + git++; + } + + if (s < gstylecombo->count()) { + gstylecombo->setCurrentItem(s); + } else { + // no predefined style, try to find the closest match + // class names usually contain the name of the style, so we + // iterate over the items in the combobox, and use the one whose + // name is contained in the classname of the style + s = 0; + git = gstyles.begin(); + while (git != gstyles.end()) { + if (currentstyle.contains(*git)) + break; + s++; + git++; + } + + if (s < gstylecombo->count()) { + gstylecombo->setCurrentItem(s); + } else { + // we give up + gstylecombo->insertItem("Unknown"); + gstylecombo->setCurrentItem(gstylecombo->count() - 1); + } + } + } + + buttonMainColor->setColor(palette().color(QPalette::Active, + QColorGroup::Button)); + buttonMainColor2->setColor(palette().color(QPalette::Active, + QColorGroup::Background)); + + QFontDatabase db; + QStringList families = db.families(); + familycombo->insertStringList(families); + + QStringList fs = families; + QStringList fs2 = QFont::substitutions(); + QStringList::Iterator fsit = fs2.begin(); + while (fsit != fs2.end()) { + if (! fs.contains(*fsit)) + fs += *fsit; + fsit++; + } + fs.sort(); + familysubcombo->insertStringList(fs); + + choosesubcombo->insertStringList(families); + QValueList sizes = db.standardSizes(); + QValueList::Iterator it = sizes.begin(); + while (it != sizes.end()) + psizecombo->insertItem(QString::number(*it++)); + + dcispin->setValue(QApplication::doubleClickInterval()); + cfispin->setValue(QApplication::cursorFlashTime()); + wslspin->setValue(QApplication::wheelScrollLines()); + resolvelinks->setChecked(qt_resolve_symlinks); + + effectcheckbox->setChecked(QApplication::isEffectEnabled(UI_General)); + effectbase->setEnabled(effectcheckbox->isChecked()); + + if (QApplication::isEffectEnabled(UI_FadeMenu)) + menueffect->setCurrentItem(2); + else if (QApplication::isEffectEnabled(UI_AnimateMenu)) + menueffect->setCurrentItem(1); + + if (QApplication::isEffectEnabled(UI_AnimateCombo)) + comboeffect->setCurrentItem(1); + + if (QApplication::isEffectEnabled(UI_FadeTooltip)) + tooltipeffect->setCurrentItem(2); + else if (QApplication::isEffectEnabled(UI_AnimateTooltip)) + tooltipeffect->setCurrentItem(1); + + if ( QApplication::isEffectEnabled( UI_AnimateToolBox ) ) + toolboxeffect->setCurrentItem( 1 ); + + QSize globalStrut = QApplication::globalStrut(); + strutwidth->setValue(globalStrut.width()); + strutheight->setValue(globalStrut.height()); + + libpathlistbox->clear(); + libpathlistbox->insertStringList(QApplication::libraryPaths()); + + // find the default family + QStringList::Iterator sit = families.begin(); + int i = 0, possible = -1; + while (sit != families.end()) { + if (*sit == QApplication::font().family()) + break; + if ((*sit).contains(QApplication::font().family())) + possible = i; + + i++; + sit++; + } + if (sit == families.end()) + i = possible; + if (i == -1) // no clue about the current font + i = 0; + + familycombo->setCurrentItem(i); + + QStringList styles = db.styles(familycombo->currentText()); + stylecombo->insertStringList(styles); + + QString stylestring = db.styleString(QApplication::font()); + sit = styles.begin(); + i = 0; + possible = -1; + while (sit != styles.end()) { + if (*sit == stylestring) + break; + if ((*sit).contains(stylestring)) + possible = i; + + i++; + sit++; + } + if (sit == styles.end()) + i = possible; + if (i == -1) // no clue about the current font + i = 0; + stylecombo->setCurrentItem(i); + + i = 0; + while (i < psizecombo->count()) { + if (psizecombo->text(i) == QString::number(QApplication::font().pointSize())) { + psizecombo->setCurrentItem(i); + break; + } + + i++; + } + + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); + + rtlExtensions->setChecked( settings.readBoolEntry( "/qt/useRtlExtensions", FALSE ) ); + +#if defined(Q_WS_X11) + inputStyle->setCurrentText( settings.readEntry( "/qt/XIMInputStyle", trUtf8( "On The Spot" ) ) ); +#else + inputStyle->hide(); + inputStyleLabel->hide(); +#endif + +#if defined(Q_WS_X11) && !defined(QT_NO_IM_EXTENSIONS) + /* + This code makes it possible to set up default input method. + + The list of identifier names of input method which can be used + is acquired using QInputContextFactory::keys(). And it is + translated to display name and set to inputMethodCombo which + displays the list of input method. + */ + inputMethodIdentifiers = QInputContextFactory::keys(); + QStringList imDispNames; + { + // input method switcher should named with "imsw-" prefix to + // prevent to be listed in ordinary input method list. + QStringList::Iterator imIt = inputMethodIdentifiers.begin(); + while (imIt != inputMethodIdentifiers.end()) { + if ((*imIt).find("imsw-") == 0) + imIt = inputMethodIdentifiers.remove(imIt); + else + imIt++; + } + // we should not sort the list + //inputMethodIdentifiers.sort(); + for (imIt = inputMethodIdentifiers.begin(); + imIt != inputMethodIdentifiers.end(); + imIt++) { + QString dispName = QInputContextFactory::displayName(*imIt); + if (dispName.isNull() || dispName.isEmpty()) + dispName = *imIt; + imDispNames << dispName; + } + } + //inputMethodCombo->insertStringList(inputMethodIdentifiers); + inputMethodCombo->insertStringList(imDispNames); + + /* + input method set up as a default in the past is chosen. + If nothing is set up, default input method in the platform is chosen. + */ + // default input method is XIM in X11. + QString currentIM = settings.readEntry("/qt/DefaultInputMethod", "xim"); + { + int index = inputMethodIdentifiers.findIndex(currentIM); + // set up Selected input method. + if (0 <= index && index < inputMethodIdentifiers.count()) { + inputMethodCombo->setCurrentItem(index); + } else { + // Give up. this part is executed when specified IM is not + // installed. + QString dispName = tr("Unknown Input Method") + " (" + currentIM + ")"; + inputMethodCombo->insertItem(dispName); + inputMethodCombo->setCurrentItem(inputMethodCombo->count() - 1); + inputMethodIdentifiers << currentIM; + } + } +#else + inputMethodCombo->hide(); + inputMethodLabel->hide(); +#endif + + fontembeddingcheckbox->setChecked( settings.readBoolEntry("/qt/embedFonts", TRUE) ); + fontpaths = settings.readListEntry("/qt/fontPath", ':'); + fontpathlistbox->insertStringList(fontpaths); + + setModified(FALSE); +} + + +MainWindow::~MainWindow() +{ +} + + +void MainWindow::fileSave() +{ + if (! modified) { + statusBar()->message("No changes to be saved.", 2000); + return; + } + + statusBar()->message("Saving changes..."); + + { + QSettings settings; + QFontDatabase db; + QFont font = db.font(familycombo->currentText(), + stylecombo->currentText(), + psizecombo->currentText().toInt()); + QStringList actcg, inactcg, discg; + + int i; + for (i = 0; i < QColorGroup::NColorRoles; i++) + actcg << editPalette.color(QPalette::Active, + (QColorGroup::ColorRole) i).name(); + for (i = 0; i < QColorGroup::NColorRoles; i++) + inactcg << editPalette.color(QPalette::Inactive, + (QColorGroup::ColorRole) i).name(); + for (i = 0; i < QColorGroup::NColorRoles; i++) + discg << editPalette.color(QPalette::Disabled, + (QColorGroup::ColorRole) i).name(); + + settings.writeEntry("/qt/font", font.toString()); + settings.writeEntry("/qt/Palette/active", actcg); + settings.writeEntry("/qt/Palette/inactive", inactcg); + settings.writeEntry("/qt/Palette/disabled", discg); + + QStringList libpath = QApplication::libraryPaths(); + QString libpathkey = + QString("/qt/%1.%2/libraryPath").arg( QT_VERSION >> 16 ).arg( (QT_VERSION & 0xff00 ) >> 8 ); + settings.writeEntry(libpathkey, libpath, ':'); + settings.writeEntry("/qt/fontPath", fontpaths, ':'); + settings.writeEntry("/qt/embedFonts", fontembeddingcheckbox->isChecked() ); + settings.writeEntry("/qt/style", gstylecombo->currentText()); + settings.writeEntry("/qt/doubleClickInterval", + dcispin->value()); + settings.writeEntry("/qt/cursorFlashTime", cfispin->value() == 9 ? 0 : cfispin->value() ); + settings.writeEntry("/qt/wheelScrollLines", wslspin->value()); + settings.writeEntry("/qt/resolveSymlinks", resolvelinks->isChecked()); + + QStringList strut; + strut << QString::number(strutwidth->value()); + strut << QString::number(strutheight->value()); + settings.writeEntry("/qt/globalStrut", strut); + + settings.writeEntry("/qt/useRtlExtensions", rtlExtensions->isChecked() ); + +#ifdef Q_WS_X11 + QString style = inputStyle->currentText(); + QString str = "On The Spot"; + if ( style == trUtf8( "Over The Spot" ) ) + str = "Over The Spot"; + else if ( style == trUtf8( "Off The Spot" ) ) + str = "Off The Spot"; + else if ( style == trUtf8( "Root" ) ) + str = "Root"; + settings.writeEntry( "/qt/XIMInputStyle", inputStyle->currentText() ); + +#if !defined(QT_NO_IM_EXTENSIONS) + QString imSwitcher = settings.readEntry("/qt/DefaultInputMethodSwitcher", "imsw-multi"); + settings.writeEntry("/qt/DefaultInputMethodSwitcher", imSwitcher); + int imIndex = inputMethodCombo->currentItem(); + settings.writeEntry("/qt/DefaultInputMethod", inputMethodIdentifiers[imIndex]); +#endif +#endif + + QStringList effects; + if (effectcheckbox->isChecked()) { + effects << "general"; + + switch (menueffect->currentItem()) { + case 1: effects << "animatemenu"; break; + case 2: effects << "fademenu"; break; + } + + switch (comboeffect->currentItem()) { + case 1: effects << "animatecombo"; break; + } + + switch (tooltipeffect->currentItem()) { + case 1: effects << "animatetooltip"; break; + case 2: effects << "fadetooltip"; break; + } + + switch ( toolboxeffect->currentItem() ) { + case 1: effects << "animatetoolbox"; break; + } + } else + effects << "none"; + settings.writeEntry("/qt/GUIEffects", effects); + + QStringList familysubs = QFont::substitutions(); + QStringList::Iterator fit = familysubs.begin(); + while (fit != familysubs.end()) { + QStringList subs = QFont::substitutes(*fit); + settings.writeEntry("/qt/Font Substitutions/" + *fit, subs); + fit++; + } + } + +#if defined(Q_WS_X11) + QApplication::x11_apply_settings(); +#endif // Q_WS_X11 + + setModified(FALSE); + statusBar()->message("Saved changes."); +} + + +void MainWindow::fileExit() +{ + qApp->closeAllWindows(); +} + + +void MainWindow::setModified(bool m) +{ + if (modified == m) + return; + + modified = m; + fileSaveAction->setEnabled(m); +} + + +void MainWindow::buildPalette() +{ + int i; + QColorGroup cg; + QColor btn = buttonMainColor->color(); + QColor back = buttonMainColor2->color(); + QPalette automake( btn, back ); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) ); + + editPalette.setActive( cg ); + buildActiveEffect(); + + cg = editPalette.inactive(); + + QPalette temp( editPalette.active().color( QColorGroup::Button ), + editPalette.active().color( QColorGroup::Background ) ); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) ); + + editPalette.setInactive( cg ); + buildInactiveEffect(); + + cg = editPalette.disabled(); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) ); + + editPalette.setDisabled( cg ); + buildDisabledEffect(); + + updateColorButtons(); + + setModified(TRUE); +} + + +void MainWindow::buildActiveEffect() +{ + QColorGroup cg = editPalette.active(); + QColor btn = cg.color( QColorGroup::Button ); + + QPalette temp( btn, btn ); + + for (int i = 0; i<5; i++) + cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); + + editPalette.setActive( cg ); + setPreviewPalette( editPalette ); + + updateColorButtons(); +} + + +void MainWindow::buildInactive() +{ + editPalette.setInactive( editPalette.active() ); + buildInactiveEffect(); +} + + +void MainWindow::buildInactiveEffect() +{ + QColorGroup cg = editPalette.inactive(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setInactive( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + + +void MainWindow::buildDisabled() +{ + QColorGroup cg = editPalette.active(); + cg.setColor( QColorGroup::ButtonText, darkGray ); + cg.setColor( QColorGroup::Foreground, darkGray ); + cg.setColor( QColorGroup::Text, darkGray ); + cg.setColor( QColorGroup::HighlightedText, darkGray ); + editPalette.setDisabled( cg ); + + buildDisabledEffect(); +} + + +void MainWindow::buildDisabledEffect() +{ + QColorGroup cg = editPalette.disabled(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setDisabled( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + + +void MainWindow::setPreviewPalette( const QPalette& pal ) +{ + QColorGroup cg; + + switch (paletteCombo->currentItem()) { + case 0: + default: + cg = pal.active(); + break; + case 1: + cg = pal.inactive(); + break; + case 2: + cg = pal.disabled(); + break; + } + previewPalette.setActive( cg ); + previewPalette.setInactive( cg ); + previewPalette.setDisabled( cg ); + + previewFrame->setPreviewPalette(previewPalette); +} + + +void MainWindow::updateColorButtons() +{ + buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button )); + buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Background )); +} + + +void MainWindow::tunePalette() +{ + bool ok; + QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, + backgroundMode(), this); + if (! ok) + return; + + editPalette = pal; + setPreviewPalette(editPalette); + setModified(TRUE); +} + + +void MainWindow::paletteSelected(int) +{ + setPreviewPalette(editPalette); +} + + +void MainWindow::styleSelected(const QString &stylename) +{ + QStyle *style = QStyleFactory::create(stylename); + if (! style) + return; + + setStyleHelper(previewFrame, style); + delete previewstyle; + previewstyle = style; + + setModified(TRUE); +} + + +void MainWindow::familySelected(const QString &family) +{ + QFontDatabase db; + QStringList styles = db.styles(family); + stylecombo->clear(); + stylecombo->insertStringList(styles); + familysubcombo->insertItem(family); + buildFont(); +} + + +void MainWindow::buildFont() +{ + QFontDatabase db; + QFont font = db.font(familycombo->currentText(), + stylecombo->currentText(), + psizecombo->currentText().toInt()); + samplelineedit->setFont(font); + setModified(TRUE); +} + + +void MainWindow::substituteSelected(const QString &family) +{ + QStringList subs = QFont::substitutes(family); + sublistbox->clear(); + sublistbox->insertStringList(subs); +} + + +void MainWindow::removeSubstitute() +{ + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) > sublistbox->count()) + return; + + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + subs.remove(subs.at(sublistbox->currentItem())); + sublistbox->clear(); + sublistbox->insertStringList(subs); + if (uint(item) > sublistbox->count()) + item = int(sublistbox->count()) - 1; + sublistbox->setCurrentItem(item); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); + setModified(TRUE); +} + + +void MainWindow::addSubstitute() +{ + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) > sublistbox->count()) { + QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); + setModified(TRUE); + return; + } + + int item = sublistbox->currentItem(); + QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item); + setModified(TRUE); +} + + +void MainWindow::downSubstitute() +{ + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) >= sublistbox->count()) + return; + + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + QStringList::Iterator it = subs.at(item); + QString fam = *it; + subs.remove(it); + it = subs.at(item); + subs.insert(++it, fam); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item + 1); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); + setModified(TRUE); +} + + +void MainWindow::upSubstitute() +{ + if (sublistbox->currentItem() < 1) + return; + + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + QStringList::Iterator it = subs.at(item); + QString fam = *it; + subs.remove(it); + it = subs.at(item - 1); + subs.insert(it, fam); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item - 1); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); + setModified(TRUE); +} + + +void MainWindow::removeLibpath() +{ + if (libpathlistbox->currentItem() < 0 || + uint(libpathlistbox->currentItem()) > libpathlistbox->count()) + return; + + int item = libpathlistbox->currentItem(); + QStringList paths = QApplication::libraryPaths(); + paths.remove(paths.at(libpathlistbox->currentItem())); + libpathlistbox->clear(); + libpathlistbox->insertStringList(paths); + if (uint(item) > libpathlistbox->count()) + item = int(libpathlistbox->count()) - 1; + libpathlistbox->setCurrentItem(item); + QApplication::setLibraryPaths(paths); + setModified(TRUE); +} + + +void MainWindow::addLibpath() +{ + if (libpathlineedit->text().isEmpty()) + return; + + if (libpathlistbox->currentItem() < 0 || + uint(libpathlistbox->currentItem()) > libpathlistbox->count()) { + QStringList paths = QApplication::libraryPaths(); + paths.append(libpathlineedit->text()); + libpathlistbox->clear(); + libpathlistbox->insertStringList(paths); + QApplication::setLibraryPaths(paths); + setModified(TRUE); + + return; + } + + int item = libpathlistbox->currentItem(); + QStringList paths =QApplication::libraryPaths(); + paths.insert(++paths.at(libpathlistbox->currentItem()), + libpathlineedit->text()); + libpathlistbox->clear(); + libpathlistbox->insertStringList(paths); + libpathlistbox->setCurrentItem(item); + QApplication::setLibraryPaths(paths); + setModified(TRUE); +} + + +void MainWindow::downLibpath() +{ + if (libpathlistbox->currentItem() < 0 || + uint(libpathlistbox->currentItem()) >= libpathlistbox->count() - 1) + return; + + int item = libpathlistbox->currentItem(); + QStringList paths = QApplication::libraryPaths(); + QStringList::Iterator it = paths.at(item); + QString fam = *it; + paths.remove(it); + it = paths.at(item); + paths.insert(++it, fam); + libpathlistbox->clear(); + libpathlistbox->insertStringList(paths); + libpathlistbox->setCurrentItem(item + 1); + QApplication::setLibraryPaths(paths); + setModified(TRUE); +} + + +void MainWindow::upLibpath() +{ + if (libpathlistbox->currentItem() < 1) + return; + + int item = libpathlistbox->currentItem(); + QStringList paths = QApplication::libraryPaths(); + QStringList::Iterator it = paths.at(item); + QString fam = *it; + paths.remove(it); + it = paths.at(item - 1); + paths.insert(it, fam); + libpathlistbox->clear(); + libpathlistbox->insertStringList(paths); + libpathlistbox->setCurrentItem(item - 1); + QApplication::setLibraryPaths(paths); + setModified(TRUE); +} + + +void MainWindow::browseLibpath() +{ + QString dirname = QFileDialog::getExistingDirectory(QString::null, this, 0, + tr("Select a Directory")); + if (dirname.isNull()) + return; + + libpathlineedit->setText(dirname); +} + + +void MainWindow::removeFontpath() +{ + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) + return; + + int item = fontpathlistbox->currentItem(); + fontpaths.remove(fontpaths.at(fontpathlistbox->currentItem())); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + if (uint(item) > fontpathlistbox->count()) + item = int(fontpathlistbox->count()) - 1; + fontpathlistbox->setCurrentItem(item); + setModified(TRUE); +} + + +void MainWindow::addFontpath() +{ + if (fontpathlineedit->text().isEmpty()) + return; + + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) { + fontpaths.append(fontpathlineedit->text()); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + setModified(TRUE); + + return; + } + + int item = fontpathlistbox->currentItem(); + fontpaths.insert(++fontpaths.at(fontpathlistbox->currentItem()), + fontpathlineedit->text()); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item); + setModified(TRUE); +} + + +void MainWindow::downFontpath() +{ + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) >= fontpathlistbox->count() - 1) + return; + + int item = fontpathlistbox->currentItem(); + QStringList::Iterator it = fontpaths.at(item); + QString fam = *it; + fontpaths.remove(it); + it = fontpaths.at(item); + fontpaths.insert(++it, fam); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item + 1); + setModified(TRUE); +} + + +void MainWindow::upFontpath() +{ + if (fontpathlistbox->currentItem() < 1) + return; + + int item = fontpathlistbox->currentItem(); + QStringList::Iterator it = fontpaths.at(item); + QString fam = *it; + fontpaths.remove(it); + it = fontpaths.at(item - 1); + fontpaths.insert(it, fam); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item - 1); + setModified(TRUE); +} + + +void MainWindow::browseFontpath() +{ + QString dirname = QFileDialog::getExistingDirectory(QString::null, this, 0, + tr("Select a Directory")); + if (dirname.isNull()) + return; + + fontpathlineedit->setText(dirname); +} + + +void MainWindow::somethingModified() +{ + setModified(TRUE); +} + + +void MainWindow::helpAbout() +{ + QMessageBox::about(this, tr("Qt Configuration"), + tr(about_text)); +} + + +void MainWindow::helpAboutQt() +{ + QMessageBox::aboutQt(this, tr("Qt Configuration")); +} + + +void MainWindow::pageChanged(QWidget *page) +{ + if (page == tab) + helpview->setText(tr(appearance_text)); + else if (page == tab_2) + helpview->setText(tr(font_text)); + else if (page == tab_3) + helpview->setText(tr(interface_text)); + else if (page == tab_4) + helpview->setText(tr(libpath_text)); + else if (page == tab_5) + helpview->setText(tr(printer_text)); +} + + +void MainWindow::closeEvent(QCloseEvent *e) +{ + if (modified) { + switch(QMessageBox::warning(this, tr("Save Changes"), + tr("Save changes to settings?"), + tr("&Yes"), tr("&No"), tr("&Cancel"), 0, 2)) { + case 0: // save + qApp->processEvents(); + fileSave(); + + // fall through intended + case 1: // don't save + e->accept(); + break; + + case 2: // cancel + e->ignore(); + break; + + default: break; + } + } else + e->accept(); +} diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h new file mode 100644 index 0000000..056edbb --- /dev/null +++ b/tools/qtconfig/mainwindow.h @@ -0,0 +1,104 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include "mainwindowbase.h" + + +class MainWindow : public MainWindowBase +{ + Q_OBJECT + +public: + MainWindow(); + ~MainWindow(); + + void closeEvent(QCloseEvent *); + + +public slots: + virtual void buildPalette(); + virtual void buildFont(); + virtual void tunePalette(); + virtual void paletteSelected(int); + virtual void styleSelected(const QString &); + virtual void familySelected(const QString &); + virtual void substituteSelected(const QString &); + virtual void removeSubstitute(); + virtual void addSubstitute(); + virtual void downSubstitute(); + virtual void upSubstitute(); + virtual void removeLibpath(); + virtual void addLibpath(); + virtual void downLibpath(); + virtual void upLibpath(); + virtual void browseLibpath(); + virtual void removeFontpath(); + virtual void addFontpath(); + virtual void downFontpath(); + virtual void upFontpath(); + virtual void browseFontpath(); + virtual void fileSave(); + virtual void fileExit(); + virtual void somethingModified(); + virtual void helpAbout(); + virtual void helpAboutQt(); + virtual void pageChanged(QWidget *); + + +private: + void buildActive(); + void buildActiveEffect(); + void buildInactive(); + void buildInactiveEffect(); + void buildDisabled(); + void buildDisabledEffect(); + + void updateColorButtons(); + void updateFontSample(); + + void setPreviewPalette(const QPalette &); + + void setModified(bool); + + QPalette editPalette, previewPalette; + QStyle *previewstyle; + QStringList fontpaths; + QStringList inputMethodIdentifiers; + bool modified; +}; + + +#endif // MAINWINDOW_H diff --git a/tools/qtconfig/mainwindowbase.ui b/tools/qtconfig/mainwindowbase.ui new file mode 100644 index 0000000..0cf65df --- /dev/null +++ b/tools/qtconfig/mainwindowbase.ui @@ -0,0 +1,1846 @@ + +MainWindowBase +********************************************************************* +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +********************************************************************* + + + MainWindowBase + + + + 0 + 0 + 700 + 600 + + + + Qt Configuration + + + appicon.png + + + + unnamed + + + 8 + + + 4 + + + + helpview + + + + 200 + 0 + + + + <p align=center><b>Documentation</b></p> +<p>This QTextView will display a brief explanation about the current page, so that the user isn't confused about the settings he/she is twiddling.</p> + + + + + TabWidget3 + + + + tab + + + Appearance + + + + unnamed + + + 4 + + + 4 + + + + GroupBox40 + + + GUI Style + + + + unnamed + + + 8 + + + 4 + + + + gstylebuddy + + + Select GUI &Style: + + + gstylecombo + + + + + gstylecombo + + + + + + + groupAutoPalette + + + + 5 + 4 + 0 + 0 + + + + Build Palette + + + AlignAuto + + + + unnamed + + + 8 + + + 4 + + + + labelMainColor + + + &3-D Effects: + + + buttonMainColor + + + + + buttonMainColor + + + + + labelMainColor2 + + + + 1 + 1 + 0 + 0 + + + + + 50 + 0 + + + + 1 + + + 0 + + + 0 + + + Back&ground: + + + AlignVCenter + + + buttonMainColor2 + + + + + buttonMainColor2 + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + 70 + 20 + + + + + + btnAdvanced + + + &Tune Palette... + + + + + + + GroupBox126 + + + + 5 + 7 + 0 + 0 + + + + Preview + + + + unnamed + + + 8 + + + 4 + + + + TextLabel1 + + + Select &Palette: + + + paletteCombo + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + paletteCombo + + + + + previewFrame + + + + 7 + 7 + 0 + 0 + + + + + 410 + 260 + + + + + + + + + + tab + + + Fonts + + + + unnamed + + + 8 + + + 4 + + + + GroupBox1 + + + Default Font + + + + unnamed + + + 8 + + + 4 + + + + stylecombo + + + true + + + false + + + + + familycombo + + + true + + + false + + + + + psizecombo + + + true + + + true + + + false + + + + + stylebuddy + + + &Style: + + + stylecombo + + + + + psizebuddy + + + &Point Size: + + + psizecombo + + + + + familybuddy + + + F&amily: + + + familycombo + + + + + samplelineedit + + + Sample Text + + + AlignHCenter + + + + + + + GroupBox2 + + + Box + + + Sunken + + + Font Substitution + + + + unnamed + + + 8 + + + 4 + + + + Layout2 + + + + unnamed + + + 0 + + + 4 + + + + famsubbuddy + + + S&elect or Enter a Family: + + + familysubcombo + + + + + familysubcombo + + + true + + + true + + + false + + + + + + + Line1 + + + HLine + + + Sunken + + + Horizontal + + + + + TextLabel5 + + + Current Substitutions: + + + + + sublistbox + + + + + Layout3 + + + + unnamed + + + 0 + + + 4 + + + + PushButton2 + + + Up + + + + + PushButton3 + + + Down + + + + + PushButton4 + + + Remove + + + + + + + Line2 + + + HLine + + + Sunken + + + Horizontal + + + + + Layout11 + + + + unnamed + + + 0 + + + 4 + + + + choosebuddy + + + Select s&ubstitute Family: + + + choosesubcombo + + + + + choosesubcombo + + + true + + + false + + + + + PushButton1 + + + Add + + + + + + + + + + + tab + + + Interface + + + + unnamed + + + + GroupBox4 + + + Feel Settings + + + + unnamed + + + 8 + + + 4 + + + + dcispin + + + ms + + + 10000 + + + 10 + + + + + dcibuddy + + + &Double Click Interval: + + + dcispin + + + + + cfispin + + + ms + + + 10000 + + + 9 + + + No blinking + + + + + cfibuddy + + + &Cursor Flash Time: + + + cfispin + + + + + wslspin + + + lines + + + 20 + + + 1 + + + + + wslbuddy + + + Wheel &Scroll Lines: + + + wslspin + + + + + resolvelinks + + + Resolve symlinks in URLs + + + + + + + GroupBox3 + + + GUI Effects + + + + unnamed + + + 8 + + + 4 + + + + effectcheckbox + + + &Enable + + + Alt+E + + + + + effectbase + + + NoFrame + + + Plain + + + + unnamed + + + 0 + + + 4 + + + + meffectbuddy + + + &Menu Effect: + + + menueffect + + + + + ceffectbuddy + + + C&omboBox Effect: + + + comboeffect + + + + + teffectbuddy + + + &ToolTip Effect: + + + tooltipeffect + + + + + beffectbuddy + + + Tool&Box Effect: + + + toolboxeffect + + + + + + Disable + + + + + Animate + + + + + Fade + + + + menueffect + + + 0 + + + true + + + + + + Disable + + + + + Animate + + + + comboeffect + + + + + + Disable + + + + + Animate + + + + + Fade + + + + tooltipeffect + + + + + + Disable + + + + + Animate + + + + toolboxeffect + + + + + + + + + GroupBox5 + + + Global Strut + + + + unnamed + + + 8 + + + 4 + + + + swbuddy + + + Minimum &Width: + + + strutwidth + + + + + shbuddy + + + Minimum Hei&ght: + + + strutheight + + + + + strutwidth + + + pixels + + + 1000 + + + + + strutheight + + + pixels + + + 1000 + + + + + + + rtlExtensions + + + Enhanced support for languages written right-to-left + + + + + inputStyleLabel + + + XIM Input Style: + + + + + + On The Spot + + + + + Over The Spot + + + + + Off The Spot + + + + + Root + + + + inputStyle + + + 0 + + + + + inputMethodLabel + + + Default Input Method: + + + + + inputMethodCombo + + + + + spacer5 + + + Vertical + + + Expanding + + + + 20 + 30 + + + + + + + + tab + + + Library Paths + + + + unnamed + + + 4 + + + 4 + + + + GroupBox39 + + + Library Paths + + + + unnamed + + + 8 + + + 4 + + + + Layout68 + + + + unnamed + + + 0 + + + 4 + + + + libpathlistbox + + + StyledPanel + + + Sunken + + + + + PushButton8 + + + Down + + + + + PushButton9 + + + Remove + + + + + PushButton7 + + + Up + + + + + + + Layout71 + + + + unnamed + + + 0 + + + 4 + + + + Spacer1_2 + + + Horizontal + + + Minimum + + + + 20 + 20 + + + + + + TextLabel15 + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + + + + + libpathlineedit + + + + + PushButton5 + + + Browse... + + + + + PushButton6 + + + Add + + + + + + + + + + + tab + + + Printer + + + + unnamed + + + 8 + + + 4 + + + + fontembeddingcheckbox + + + Enable Font embedding + + + true + + + + + GroupBox10 + + + + 5 + 7 + 0 + 0 + + + + Font Paths + + + + unnamed + + + 8 + + + 4 + + + + Layout9 + + + + unnamed + + + 0 + + + 4 + + + + PushButton11 + + + Up + + + + + PushButton13 + + + Remove + + + + + fontpathlistbox + + + + + PushButton12 + + + Down + + + + + + + Layout10 + + + + unnamed + + + 0 + + + 4 + + + + Spacer4 + + + Horizontal + + + Minimum + + + + 20 + 20 + + + + + + TextLabel15_2 + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + + + + + PushButton15 + + + Add + + + + + fontpathlineedit + + + + + PushButton14 + + + Browse... + + + + + + + + + + + + + + menubar + + + + + + + + + + + + + + + + ColorButton +
colorbutton.h
+ + 40 + 25 + + 0 + + 5 + 5 + 0 + 0 + + image0 + clicked() + colorChanged(const QColor &) + changed() + color + pixmap + scale +
+ + PreviewFrame +
previewframe.h
+ + 200 + 200 + + 0 + + 5 + 5 + 0 + 0 + + image1 +
+
+ + + + fileSaveAction + + + + + + Save + + + &Save + + + Ctrl+S + + + + + fileExitAction + + + Exit + + + E&xit + + + + + + + + helpAboutAction + + + About + + + &About + + + + + + + + helpAboutQtAction + + + About Qt + + + About &Qt + + + + + + 789c6dd7594f23471007f0f7fd14d6d6db2aaaf58c3db647511eb831b7317794879ac30760cc61c010e5bba7dcf5af5688167664fdb66bbaababbb67cccf1f8dab93c3c68f9fdf5e16b298968d7222cf8d1fd5eb6cf6f1e75f7ffcfded7b9a3656ff9aad46fafdb76fdf078b46d9389a3fd42bf04841699e964933b830b79a7019dd0b96955b895b5a703bcd572e08eea576ff6570ae0eedd477b792103f854b8b2fc6d1163f77237e646e37113f89b6f8307e3bf1785a8b0eedbc696eb7ad9db7e01ee6476ee4ffe0c6fd158c7c69182cde4eec6e87fea50dfbf8176e6ba7d07f96669999cfa325ccaf862bcc97a36dbccf60f178cee11cde706761f16917ae30fe6b7488a7851bf14d7327417f676eb4f756eea41e2f57e6d83e83919f6cba117f04235fd9765b3b0fa36dfc398cf973edc67a6fb951ffe768ab6765ee26b8dff213ef5f4630e2b9e7463ea7ee8ee5ff60ee2618af8eb6fe3238437eb91bf1299cdbfacad3cadd5617f5a11738c7fe4adcb8ffd68d7aeec15e8fc3683b9f62ee2518ef33dafa3f75e3bc957086f86eb4d56f3db8e8e6dd56f01a5cc1bbe65e629673d8ebd18d0efdc9058cf9f2c08df9e630ce037db8719ec37c7a9a7fb708f10267b65e7cef46fb3e9ca3fd23dad6ef0cf67abe99f304f95ec3a8871cbb71be52d8d777e8b6fee412f6f958be3adf5ea817b561afe7d86ded7c67ce13c46fc37ede2766c17a17059cd9f38e466e8c3f8eb6fd700f0b9ef7095c37cd3d37de178f2be76dcf876fa343bd790267f012f67a77cc319f69b4ed872e2ca8e732daeabfe3c6fa9cc235f21f9b8bd4f2a5cd687bfedbfd659ee7ede017b842becf6eb44fa3cbd0df8559b0ffe808ceb0ff37e01afba3652e52cc87a26dbe276ecca7097790ff73b4cdef0616ac4fdf6df1c2d1d67ee8c6f80318eb4bd1180ff529513f0ecf7b694b62f5a002ceccb2662e523c2fb7605f9f0fd8fbbf75e3bc2dcd3e9ebcb9f17ce8c05e8f83685bcf701e44eb2db65e4fd1b65eebe62245be53b8c6f3ffdd8dfd3933fbf884761f5f0edcd88f951bf118bf44bde926dae24fe01ae7af76e3f9169e2f45bb143c0f5fdcf6fea23b18f773eac6f3e63ddac6db75e37df5e8c6fbae65aebcde6d37beaf84f528aa52f03c9dc3359ea79939c627d136deab1befaf75b883ef23e76e3ccfaea36d7dc2f795322b05ebfb0ad738af7db7ad371f99fd7e59b8b13f276e9cdf1318f5e54337e6d78cb67cf761ec170efba1acaa1afd9db92d3f3a36d729ea77efc6f33cbccf2beddfe6478fe6d85e45dbfd851bf1577007f5d877e3bc86f5a9ea3a2d6cffdfc1debe116df5db73a39e37b0e777191dda257c7fa83b6e8a2eaae00eeceb13d6b7d69f325b79b058fd32b170c1a55ebffaac2ccae2b9e6118f79c253bd6ef9ee3fd7587fef79c60f7acf3cc617fcc84ffcac6d8ffcc20b7ee5377ee7257ff027aff1bac66ff0269716cf5b1ab7cd3bbcabb17ddee37d3ee0433ee2633ee1019ff290cff89c2ff89229c48b66f1ac3d5df135df7093134eb9c56dcef4b3c35dee71ce393111dbfa8c784a4205955451cd1d1ad1982634a55bbad3f80eddd38c1ef882e66cf52ab5ff2b8d7ea4277aa6175ad06bb866f446efb4d4df0ffad4fed762ffb7b44e1b9cd2266dd142c75e5ddb3cd0bb3e347a477bd9d5f83ee245e3f7689f0ee830f67d44c77412ee186946033aa5e197fecfe85c7bf7be2fe892aee89a6ea84989f6bfa434f4eff9df52c509b5d0779b32ea684d13ea528f728d1e882ebfce37f6cf077422b4ea5b440ad14af1a15452ab473aee52c65ff39789b64fe955f44eb9937b5d858c5b32d377c0c32a7fee7ecd5fe61aff284ff22c2fb290577993775db1443fb53ef2219f5ff2bf93356d5b970dd9d41eb77820dbb223bbab155ed55ffab2f725ffb1eccb81aed6931cca116ab490633909d10339fd5ffdef795d869ae7923bc27226e772415d5986b51d683663b9d4fcfbb1ff190fe54aaec35aeaa577ee20f24673e94b531249a585fc2b69ebfe3ed7dae91f75ba964b5c03e9d344ba1add93bce0826c3f87f3b2a9fb6f18aeba10ba2f563f25eb1b563771a5d17531e2513c5fba538b3111cd690dd73c7ef6a95f4c8aa99de12fe77da4951de9ffffea730be7fd9fdfbffd0b690edc6c + + + 789c6d92cd4ec3300c80ef7d8a68b94da8dbba51a9423c02882312e210c7f95d3a241807847877eca4e93a84d54af9fcd5899374b316cf4f0f62bd693eceea1cb4d05ebd8b357e8ee3d7cbebfd77b3ea3a41cfae17bbd54db36a85168f6f27c3634563b9dfedb7db2da3acd8778cb1607f5bd0331ed4411f142330f65db5a1e0301444c64157d41507cd980a6a53d67515cbc723a3c66a6dc5624dc532d5a9a0b5058f8cd6566cdb56aaeba05436a0f43210a4826294369c31c63a4404002f55362c02e50d2f8001207a2f6531d4d131e729128227a32643152ed14ce86c4a09168605440ac031a57031b404091f3d861872d16c6ca9a01d87885cb430b9c29cac8b90122e0c7205094b4dd374b3a16d70056f15fc1f6323d8bc550757b3510680d3fc5e75e0f2b72e00f2212cbb464701d45d449796060199318490079775e8dc4b660e980c9dad9f1dd2f10428b7d02a991d9f58001ec0747374dbf24fa8c9fcff87fcdc35bf3990fd9c + + + + + fontpathlineedit + returnPressed() + MainWindowBase + addFontpath() + + + PushButton15 + clicked() + MainWindowBase + addFontpath() + + + PushButton6 + clicked() + MainWindowBase + addLibpath() + + + libpathlineedit + returnPressed() + MainWindowBase + addLibpath() + + + PushButton1 + clicked() + MainWindowBase + addSubstitute() + + + PushButton14 + clicked() + MainWindowBase + browseFontpath() + + + PushButton5 + clicked() + MainWindowBase + browseLibpath() + + + stylecombo + activated(int) + MainWindowBase + buildFont() + + + psizecombo + activated(int) + MainWindowBase + buildFont() + + + PushButton12 + clicked() + MainWindowBase + downFontpath() + + + PushButton8 + clicked() + MainWindowBase + downLibpath() + + + PushButton3 + clicked() + MainWindowBase + downSubstitute() + + + familycombo + activated(const QString&) + MainWindowBase + familySelected(const QString&) + + + fileExitAction + activated() + MainWindowBase + fileExit() + + + fileSaveAction + activated() + MainWindowBase + fileSave() + + + helpAboutAction + activated() + MainWindowBase + helpAbout() + + + helpAboutQtAction + activated() + MainWindowBase + helpAboutQt() + + + TabWidget3 + currentChanged(QWidget*) + MainWindowBase + pageChanged(QWidget*) + + + paletteCombo + activated(int) + MainWindowBase + paletteSelected(int) + + + PushButton13 + clicked() + MainWindowBase + removeFontpath() + + + PushButton9 + clicked() + MainWindowBase + removeLibpath() + + + PushButton4 + clicked() + MainWindowBase + removeSubstitute() + + + effectcheckbox + toggled(bool) + effectbase + setEnabled(bool) + + + fontembeddingcheckbox + toggled(bool) + GroupBox10 + setEnabled(bool) + + + toolboxeffect + activated(int) + MainWindowBase + somethingModified() + + + dcispin + valueChanged(int) + MainWindowBase + somethingModified() + + + cfispin + valueChanged(int) + MainWindowBase + somethingModified() + + + wslspin + valueChanged(int) + MainWindowBase + somethingModified() + + + menueffect + activated(int) + MainWindowBase + somethingModified() + + + comboeffect + activated(int) + MainWindowBase + somethingModified() + + + tooltipeffect + activated(int) + MainWindowBase + somethingModified() + + + strutwidth + valueChanged(int) + MainWindowBase + somethingModified() + + + strutheight + valueChanged(int) + MainWindowBase + somethingModified() + + + effectcheckbox + toggled(bool) + MainWindowBase + somethingModified() + + + resolvelinks + toggled(bool) + MainWindowBase + somethingModified() + + + fontembeddingcheckbox + clicked() + MainWindowBase + somethingModified() + + + rtlExtensions + toggled(bool) + MainWindowBase + somethingModified() + + + inputStyle + activated(int) + MainWindowBase + somethingModified() + + + inputMethodCombo + activated(int) + MainWindowBase + somethingModified() + + + gstylecombo + activated(const QString&) + MainWindowBase + styleSelected(const QString&) + + + familysubcombo + activated(const QString&) + MainWindowBase + substituteSelected(const QString&) + + + btnAdvanced + clicked() + MainWindowBase + tunePalette() + + + PushButton11 + clicked() + MainWindowBase + upFontpath() + + + PushButton7 + clicked() + MainWindowBase + upLibpath() + + + PushButton2 + clicked() + MainWindowBase + upSubstitute() + + + + helpview + TabWidget3 + familycombo + stylecombo + psizecombo + samplelineedit + familysubcombo + PushButton2 + PushButton3 + PushButton4 + choosesubcombo + PushButton1 + dcispin + cfispin + wslspin + effectcheckbox + menueffect + comboeffect + tooltipeffect + strutwidth + strutheight + libpathlineedit + PushButton5 + PushButton6 + PushButton7 + PushButton8 + PushButton9 + sublistbox + libpathlistbox + + + init() + destroy() + addFontpath() + addLibpath() + addSubstitute() + browseFontpath() + browseLibpath() + buildFont() + buildPalette() + downFontpath() + downLibpath() + downSubstitute() + familySelected( const QString & ) + fileExit() + fileSave() + helpAbout() + helpAboutQt() + new_slot() + pageChanged( QWidget * ) + paletteSelected( int ) + removeFontpath() + removeLibpath() + removeSubstitute() + somethingModified() + styleSelected( const QString & ) + substituteSelected( const QString & ) + tunePalette() + upFontpath() + upLibpath() + upSubstitute() + + + + + colorbutton.h + colorbutton.h + previewframe.h + +
diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp new file mode 100644 index 0000000..3944970 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -0,0 +1,615 @@ +/********************************************************************** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "paletteeditoradvanced.h" +#include "colorbutton.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! + Class used by PaletteEditor for bold combobox items +*/ + +class BoldListBoxText : public QListBoxText +{ +public: + BoldListBoxText( QString text, QListBox* lb = 0 ); + +protected: + virtual void paint( QPainter* ); +}; + +BoldListBoxText::BoldListBoxText( QString text, QListBox* lb ) + : QListBoxText( lb ) +{ + setText( text ); +} + +void BoldListBoxText::paint( QPainter* painter ) +{ + QFont f = painter->font(); + f.setBold( TRUE ); + painter->setFont( f ); + + QListBoxText::paint( painter ); +} + +PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent, + const char * name, bool modal, WFlags f ) + : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0) +{ + editPalette = QApplication::palette(); + setPreviewPalette( editPalette ); +} + +PaletteEditorAdvanced::~PaletteEditorAdvanced() +{ +} + +void PaletteEditorAdvanced::onToggleBuildInactive( bool v ) +{ + if (selectedPalette == 1) { + groupCentral->setDisabled(v); + groupEffect->setDisabled(v); + } + + if (v) { + buildInactive(); + updateColorButtons(); + } +} + +void PaletteEditorAdvanced::onToggleBuildDisabled( bool v ) +{ + if (selectedPalette == 2) { + groupCentral->setDisabled(v); + groupEffect->setDisabled(v); + } + + if (v) { + buildDisabled(); + updateColorButtons(); + } +} + +void PaletteEditorAdvanced::paletteSelected(int p) +{ + selectedPalette = p; + + if(p == 1) { // inactive + groupCentral->setDisabled(checkBuildInactive->isChecked()); + groupEffect->setDisabled(checkBuildInactive->isChecked()); + } + else if (p == 2) { // disabled + groupCentral->setDisabled(checkBuildDisabled->isChecked()); + groupEffect->setDisabled(checkBuildDisabled->isChecked()); + } + else { + groupCentral->setEnabled(TRUE); + groupEffect->setEnabled(TRUE); + } + updateColorButtons(); +} + +void PaletteEditorAdvanced::onChooseCentralColor() +{ + switch(selectedPalette) { + case 0: + default: + mapToActiveCentralRole( buttonCentral->color() ); + break; + case 1: + mapToInactiveCentralRole( buttonCentral->color() ); + break; + case 2: + mapToDisabledCentralRole( buttonCentral->color() ); + break; + } + updateColorButtons(); +} + +void PaletteEditorAdvanced::onChooseEffectColor() +{ + switch(selectedPalette) { + case 0: + default: + mapToActiveEffectRole( buttonEffect->color() ); + break; + case 1: + mapToInactiveEffectRole( buttonEffect->color() ); + break; + case 2: + mapToDisabledEffectRole( buttonEffect->color() ); + break; + } + updateColorButtons(); +} + +void PaletteEditorAdvanced::onToggleBuildEffects( bool on ) +{ + if (!on) return; + buildActiveEffect(); + buildInactiveEffect(); + buildDisabledEffect(); +} + +QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item ) +{ + switch( item ) { + case 0: + return QColorGroup::Background; + case 1: + return QColorGroup::Foreground; + case 2: + return QColorGroup::Button; + case 3: + return QColorGroup::Base; + case 4: + return QColorGroup::Text; + case 5: + return QColorGroup::BrightText; + case 6: + return QColorGroup::ButtonText; + case 7: + return QColorGroup::Highlight; + case 8: + return QColorGroup::HighlightedText; + case 9: + return QColorGroup::Link; + case 10: + return QColorGroup::LinkVisited; + default: + return QColorGroup::NColorRoles; + } +} + +QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item ) +{ + switch( item ) { + case 0: + return QColorGroup::Light; + case 1: + return QColorGroup::Midlight; + case 2: + return QColorGroup::Mid; + case 3: + return QColorGroup::Dark; + case 4: + return QColorGroup::Shadow; + default: + return QColorGroup::NColorRoles; + } +} + +void PaletteEditorAdvanced::onCentral( int item ) +{ + QColor c; + + switch(selectedPalette) { + case 0: + default: + c = editPalette.active().color( centralFromItem(item) ); + break; + case 1: + c = editPalette.inactive().color( centralFromItem(item) ); + break; + case 2: + c = editPalette.disabled().color( centralFromItem(item) ); + break; + } + + buttonCentral->setColor(c); +} + +void PaletteEditorAdvanced::onEffect( int item ) +{ + QColor c; + switch(selectedPalette) { + case 0: + default: + c = editPalette.active().color( effectFromItem(item) ); + break; + case 1: + editPalette.inactive().color( effectFromItem(item) ); + break; + case 2: + editPalette.disabled().color( effectFromItem(item) ); + break; + } + buttonEffect->setColor(c); +} + +void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c ) +{ + QColorGroup cg = editPalette.active(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setActive( cg ); + + buildActiveEffect(); + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c ) +{ + QColorGroup cg = editPalette.active(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setActive( cg ); + + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.active(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + editPalette.setActive( cg ); + + + buildActiveEffect(); + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c ) +{ + QColorGroup cg = editPalette.inactive(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setInactive( cg ); + + buildInactiveEffect(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c ) +{ + QColorGroup cg = editPalette.inactive(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setInactive( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.inactive(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + editPalette.setInactive( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c ) +{ + QColorGroup cg = editPalette.disabled(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setDisabled( cg ); + + buildDisabledEffect(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c ) +{ + QColorGroup cg = editPalette.disabled(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setDisabled( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.disabled(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + + editPalette.setDisabled( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::buildActiveEffect() +{ + QColorGroup cg = editPalette.active(); + QColor btn = cg.color( QColorGroup::Button ); + + QPalette temp( btn, btn ); + + for (int i = 0; i<5; i++) + cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); + + editPalette.setActive( cg ); + setPreviewPalette( editPalette ); + + updateColorButtons(); +} + +void PaletteEditorAdvanced::buildInactive() +{ + editPalette.setInactive( editPalette.active() ); + if ( checkBuildEffect->isChecked() ) + buildInactiveEffect(); + else { + setPreviewPalette( editPalette ); + updateColorButtons(); + } + +} + +void PaletteEditorAdvanced::buildInactiveEffect() +{ + QColorGroup cg = editPalette.inactive(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setInactive( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + +void PaletteEditorAdvanced::buildDisabled() +{ + QColorGroup cg = editPalette.active(); + cg.setColor( QColorGroup::ButtonText, darkGray ); + cg.setColor( QColorGroup::Foreground, darkGray ); + cg.setColor( QColorGroup::Text, darkGray ); + cg.setColor( QColorGroup::HighlightedText, darkGray ); + editPalette.setDisabled( cg ); + + if ( checkBuildEffect->isChecked() ) + buildDisabledEffect(); + else { + setPreviewPalette( editPalette ); + updateColorButtons(); + } +} + +void PaletteEditorAdvanced::buildDisabledEffect() +{ + QColorGroup cg = editPalette.disabled(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setDisabled( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + +void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal ) +{ + QColorGroup cg; + + switch (selectedPalette) { + case 0: + default: + cg = pal.active(); + break; + case 1: + cg = pal.inactive(); + break; + case 2: + cg = pal.disabled(); + break; + } + previewPalette.setActive( cg ); + previewPalette.setInactive( cg ); + previewPalette.setDisabled( cg ); +} + +void PaletteEditorAdvanced::updateColorButtons() +{ + QColor central, effect; + switch (selectedPalette) { + case 0: + default: + central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); + break; + case 1: + central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); + break; + case 2: + central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); + break; + } + + buttonCentral->setColor(central); + buttonEffect->setColor(effect); +} + +void PaletteEditorAdvanced::setPal( const QPalette& pal ) +{ + editPalette = pal; + setPreviewPalette( pal ); + updateColorButtons(); +} + +QPalette PaletteEditorAdvanced::pal() const +{ + return editPalette; +} + +void PaletteEditorAdvanced::setupBackgroundMode( BackgroundMode mode ) +{ + int initRole = 0; + + switch( mode ) { + case PaletteBackground: + initRole = 0; + break; + case PaletteForeground: + initRole = 1; + break; + case PaletteButton: + initRole = 2; + break; + case PaletteBase: + initRole = 3; + break; + case PaletteText: + initRole = 4; + break; + case PaletteBrightText: + initRole = 5; + break; + case PaletteButtonText: + initRole = 6; + break; + case PaletteHighlight: + initRole = 7; + break; + case PaletteHighlightedText: + initRole = 8; + break; + case PaletteLight: + initRole = 9; + break; + case PaletteMidlight: + initRole = 10; + break; + case PaletteDark: + initRole = 11; + break; + case PaletteMid: + initRole = 12; + break; + case PaletteShadow: + initRole = 13; + break; + default: + initRole = -1; + break; + } + + if ( initRole <= -1 ) return; + + if (initRole > 8 ) { + comboEffect->setCurrentItem( initRole - 9 ); + if ( comboEffect->listBox() ) { + QString text = comboEffect->currentText(); + comboEffect->listBox()->changeItem( new BoldListBoxText( text ), initRole - 9 ); + } + } + else { + comboCentral->setCurrentItem( initRole ); + if ( comboCentral->listBox() ) { + QString text = comboCentral->currentText(); + comboCentral->listBox()->changeItem( new BoldListBoxText( text ), initRole ); + } + } +} + +QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init, + BackgroundMode mode, QWidget* parent, + const char* name ) +{ + PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( parent, name, TRUE ); + dlg->setupBackgroundMode( mode ); + + if ( init != QPalette() ) + dlg->setPal( init ); + int resultCode = dlg->exec(); + + QPalette result = init; + if ( resultCode == QDialog::Accepted ) { + if ( ok ) + *ok = TRUE; + result = dlg->pal(); + } else { + if ( ok ) + *ok = FALSE; + } + delete dlg; + return result; +} diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h new file mode 100644 index 0000000..aca4632 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -0,0 +1,98 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef PALETTEEDITORADVANCED_H +#define PALETTEEDITORADVANCED_H + +#include "paletteeditoradvancedbase.h" + +class PaletteEditorAdvanced : public PaletteEditorAdvancedBase +{ + Q_OBJECT +public: + PaletteEditorAdvanced( QWidget * parent=0, const char * name=0, + bool modal=FALSE, WFlags f=0 ); + ~PaletteEditorAdvanced(); + + static QPalette getPalette( bool *ok, const QPalette &pal, BackgroundMode mode = PaletteBackground, + QWidget* parent = 0, const char* name = 0 ); + +protected slots: + void paletteSelected(int); + + void onCentral( int ); + void onEffect( int ); + + void onChooseCentralColor(); + void onChooseEffectColor(); + + void onToggleBuildEffects( bool ); + void onToggleBuildInactive( bool ); + void onToggleBuildDisabled( bool ); + +protected: + void mapToActiveCentralRole( const QColor& ); + void mapToActiveEffectRole( const QColor& ); + void mapToActivePixmapRole( const QPixmap& ); + void mapToInactiveCentralRole( const QColor& ); + void mapToInactiveEffectRole( const QColor& ); + void mapToInactivePixmapRole( const QPixmap& ); + void mapToDisabledCentralRole( const QColor& ); + void mapToDisabledEffectRole( const QColor& ); + void mapToDisabledPixmapRole( const QPixmap& ); + + + void buildPalette(); + void buildActiveEffect(); + void buildInactive(); + void buildInactiveEffect(); + void buildDisabled(); + void buildDisabledEffect(); + +private: + void setPreviewPalette( const QPalette& ); + void updateColorButtons(); + void setupBackgroundMode( BackgroundMode ); + + QPalette pal() const; + void setPal( const QPalette& ); + + QColorGroup::ColorRole centralFromItem( int ); + QColorGroup::ColorRole effectFromItem( int ); + QPalette editPalette; + QPalette previewPalette; + + int selectedPalette; +}; + +#endif diff --git a/tools/qtconfig/paletteeditoradvancedbase.ui b/tools/qtconfig/paletteeditoradvancedbase.ui new file mode 100644 index 0000000..61f97b5 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvancedbase.ui @@ -0,0 +1,682 @@ + +PaletteEditorAdvancedBase +********************************************************************* +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +********************************************************************* + + + PaletteEditorAdvancedBase + + + true + + + + 0 + 0 + 295 + 346 + + + + Tune Palette + + + true + + + <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> + + + + unnamed + + + 11 + + + 6 + + + + Layout14 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel1 + + + MShape + + + MShadow + + + Select &Palette: + + + paletteCombo + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + paletteCombo + + + + + + + ButtonGroup1 + + + + 5 + 4 + + + + Auto + + + + unnamed + + + 11 + + + 6 + + + + checkBuildInactive + + + Build inactive palette from active. + + + true + + + + + checkBuildDisabled + + + Build disabled palette from active. + + + true + + + + + + + groupCentral + + + Central color &roles + + + + unnamed + + + 11 + + + 6 + + + + + Background + + + + + Foreground + + + + + Button + + + + + Base + + + + + Text + + + + + BrightText + + + + + ButtonText + + + + + Highlight + + + + + HighlightText + + + + + Link + + + + + LinkVisited + + + + comboCentral + + + Choose central color role + + + <b>Select a color role.</b><p>Available central roles are: <ul> <li>Background - general background color.</li> <li>Foreground - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the forground color used with Base. Usually this is the same as the Foreground, in what case it must provide good contrast both with Background and Base. </li> <li>Button - general button background color, where buttons need a background different from Background, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from Foreground and contrasts well with e.g. black. </li> </ul> </p> + + + + + Layout32_2 + + + + unnamed + + + 0 + + + 6 + + + + Horizontal_Spacing1 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + labelCentral + + + + 1 + 1 + + + + + 0 + 0 + + + + &Select Color: + + + buttonCentral + + + + + buttonCentral + + + + 0 + 0 + + + + TabFocus + + + Choose a color + + + Choose a color for the selected central color role. + + + + + + + + + groupEffect + + + 3-D shadow &effects + + + + unnamed + + + 11 + + + 6 + + + + Layout32_3 + + + + unnamed + + + 0 + + + 6 + + + + checkBuildEffect + + + Build &from button color + + + true + + + Generate shadings + + + Check to let 3D-effect colors be calculated from button-color. + + + + + + Light + + + + + Midlight + + + + + Mid + + + + + Dark + + + + + Shadow + + + + comboEffect + + + Choose 3D-effect color role + + + <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> + + + + + + + Layout31_2 + + + + unnamed + + + 0 + + + 6 + + + + Horizontal_Spacing3 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + labelEffect + + + + 1 + 1 + + + + + 0 + 0 + + + + Select Co&lor: + + + buttonEffect + + + + + buttonEffect + + + + 0 + 0 + + + + TabFocus + + + Choose a color + + + Choose a color for the selected effect color role. + + + + + + + + + Layout3 + + + + unnamed + + + 0 + + + 6 + + + + Horizontal_Spacing2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + buttonOk + + + OK + + + true + + + true + + + Close dialog and apply all changes. + + + + + buttonCancel + + + Cancel + + + true + + + Close dialog and discard all changes. + + + + + + + + + ColorButton +
colorbutton.h
+ + 40 + 25 + + 0 + + 5 + 5 + + image0 + clicked() + colorChanged(const QColor &) + changed() + color + pixmap +
+
+ + + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + + + + buttonOk + clicked() + PaletteEditorAdvancedBase + accept() + + + buttonCancel + clicked() + PaletteEditorAdvancedBase + reject() + + + paletteCombo + activated(int) + PaletteEditorAdvancedBase + paletteSelected(int) + + + comboCentral + activated(int) + PaletteEditorAdvancedBase + onCentral(int) + + + buttonCentral + clicked() + PaletteEditorAdvancedBase + onChooseCentralColor() + + + buttonEffect + clicked() + PaletteEditorAdvancedBase + onChooseEffectColor() + + + comboEffect + activated(int) + PaletteEditorAdvancedBase + onEffect(int) + + + checkBuildEffect + toggled(bool) + PaletteEditorAdvancedBase + onToggleBuildEffects(bool) + + + checkBuildEffect + toggled(bool) + comboEffect + setDisabled(bool) + + + checkBuildEffect + toggled(bool) + buttonEffect + setDisabled(bool) + + + checkBuildInactive + toggled(bool) + PaletteEditorAdvancedBase + onToggleBuildInactive(bool) + + + checkBuildDisabled + toggled(bool) + PaletteEditorAdvancedBase + onToggleBuildDisabled(bool) + + init() + destroy() + onCentral(int) + onChooseCentralColor() + onChooseEffectColor() + onEffect(int) + onToggleBuildDisabled(bool) + onToggleBuildEffects(bool) + onToggleBuildInactive(bool) + paletteSelected(int) + + + buttonOk + buttonCancel + paletteCombo + checkBuildInactive + checkBuildDisabled + comboCentral + buttonCentral + checkBuildEffect + comboEffect + buttonEffect + +
diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp new file mode 100644 index 0000000..a16b566 --- /dev/null +++ b/tools/qtconfig/previewframe.cpp @@ -0,0 +1,63 @@ +/********************************************************************** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "previewframe.h" + +#include +#include + +PreviewFrame::PreviewFrame( QWidget *parent, const char *name ) + : QVBox( parent, name ) +{ + setMinimumSize(200, 200); + setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + setLineWidth(1); + + Workspace * w = new Workspace( this ); + w->setEraseColor(colorGroup().dark()); + previewWidget = new PreviewWidget( w ); + previewWidget->move( 10, 10 ); +} + +void PreviewFrame::setPreviewPalette(QPalette pal) +{ + previewWidget->setPalette(pal); +} + +void Workspace::paintEvent( QPaintEvent* ) +{ + QPainter p ( this ); + p.setPen( QPen( white ) ); + p.drawText ( 0, height() / 2, width(), height(), AlignHCenter, + "The moose in the noose\nate the goose who was loose." ); +} diff --git a/tools/qtconfig/previewframe.h b/tools/qtconfig/previewframe.h new file mode 100644 index 0000000..f2281a7 --- /dev/null +++ b/tools/qtconfig/previewframe.h @@ -0,0 +1,67 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef PREVIEWFRAME_H +#define PREVIEWFRAME_H + +#include "previewwidget.h" + +#include +#include + +class Workspace : public QWorkspace +{ + Q_OBJECT + +public: + Workspace( QWidget* parent = 0, const char* name = 0 ) + : QWorkspace( parent, name ) {} + ~Workspace() {} + +protected: + void paintEvent( QPaintEvent* ); +}; + +class PreviewFrame : public QVBox +{ + Q_OBJECT + +public: + PreviewFrame( QWidget *parent = 0, const char *name = 0 ); + void setPreviewPalette(QPalette); + +private: + PreviewWidget *previewWidget; +}; + +#endif diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp new file mode 100644 index 0000000..cd88a29 --- /dev/null +++ b/tools/qtconfig/previewwidget.cpp @@ -0,0 +1,75 @@ +/********************************************************************** +** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "previewwidget.h" + +#include + +PreviewWidget::PreviewWidget( QWidget *parent, const char *name ) + : PreviewWidgetBase( parent, name ) +{ + // install event filter on child widgets + QObjectList *l = queryList("QWidget"); + QObjectListIt it(*l); + QObject * obj; + while ((obj = it.current()) != 0) { + ++it; + obj->installEventFilter(this); + ((QWidget*)obj)->setFocusPolicy(NoFocus); + } +} + + +void PreviewWidget::closeEvent(QCloseEvent *e) +{ + e->ignore(); +} + + +bool PreviewWidget::eventFilter(QObject *, QEvent *e) +{ + switch ( e->type() ) { + case QEvent::MouseButtonPress: + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonDblClick: + case QEvent::MouseMove: + case QEvent::KeyPress: + case QEvent::KeyRelease: + case QEvent::Enter: + case QEvent::Leave: + return TRUE; // ignore; + default: + break; + } + return FALSE; +} diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h new file mode 100644 index 0000000..ca7e5bd --- /dev/null +++ b/tools/qtconfig/previewwidget.h @@ -0,0 +1,50 @@ +/********************************************************************** +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef PREVIEWWIDGET_H +#define PREVIEWWIDGET_H + +#include "previewwidgetbase.h" + +class PreviewWidget : public PreviewWidgetBase +{ + Q_OBJECT + +public: + PreviewWidget( QWidget *parent = 0, const char *name = 0 ); + + void closeEvent(QCloseEvent *); + bool eventFilter(QObject *, QEvent *); +}; + +#endif diff --git a/tools/qtconfig/previewwidgetbase.ui b/tools/qtconfig/previewwidgetbase.ui new file mode 100644 index 0000000..a03df6b --- /dev/null +++ b/tools/qtconfig/previewwidgetbase.ui @@ -0,0 +1,311 @@ + +PreviewWidgetBase +********************************************************************* +** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. +** +** This file is part of Qt Configuration. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free Qt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with +** the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +********************************************************************* + + + PreviewWidgetBase + + + + 0 + 0 + 378 + 236 + + + + + 1 + 1 + + + + Preview Window + + + + unnamed + + + 11 + + + 6 + + + + Layout6 + + + + unnamed + + + 0 + + + 6 + + + + Layout17 + + + + unnamed + + + 0 + + + 6 + + + + ButtonGroup1 + + + ButtonGroup + + + + unnamed + + + 11 + + + 6 + + + + RadioButton1 + + + RadioButton1 + + + true + + + + + RadioButton2 + + + RadioButton2 + + + + + RadioButton3 + + + RadioButton3 + + + + + + + ButtonGroup2 + + + ButtonGroup2 + + + + unnamed + + + 11 + + + 6 + + + + CheckBox1 + + + CheckBox1 + + + true + + + + + CheckBox2 + + + CheckBox2 + + + + + + + ProgressBar1 + + + 50 + + + + + + + Layout5 + + + + unnamed + + + 0 + + + 6 + + + + LineEdit1 + + + LineEdit + + + + + + ComboBox + + + + ComboBox1 + + + + + Layout13 + + + + unnamed + + + 0 + + + 6 + + + + SpinBox1 + + + + + PushButton1 + + + PushButton + + + + + + + ScrollBar1 + + + Horizontal + + + + + Slider1 + + + Horizontal + + + + + textView + + + + 32767 + 50 + + + + <p> +<a href="http://www.trolltech.com">http://www.trolltech.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + + + + + + + + + Spacer2 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + init() + destroy() + + diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro new file mode 100644 index 0000000..aaef136 --- /dev/null +++ b/tools/qtconfig/qtconfig.pro @@ -0,0 +1,18 @@ +TEMPLATE = app +CONFIG += qt warn_on +LANGUAGE = C++ + +SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp +HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h +FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidgetbase.ui +IMAGES = images/appicon.png + +PROJECTNAME = Qt Configuration +TARGET = qtconfig +DESTDIR = ../../bin + +target.path=$$bins.path +INSTALLS += target +INCLUDEPATH += . +DBFILE = qtconfig.db +REQUIRES=full-config nocrosscompiler !win32* -- cgit v1.2.1