From 9eb989dee3b7add23d83f2d0c40b2843f6a832a7 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Wed, 24 Dec 2014 15:40:39 +0300 Subject: [PATCH] Remove qtconfig from the repository. We are not going to build/ship it, anyway. http://lists.qt-project.org/pipermail/development/2014-December/019545.html Change-Id: Iad58f384550b2379faebc9542baf94459204c175 Reviewed-by: Olivier Goffart --- .gitignore | 1 - src/qtconfig/colorbutton.cpp | 200 ------ src/qtconfig/colorbutton.h | 82 --- src/qtconfig/images/appicon.png | Bin 1222 -> 0 bytes src/qtconfig/main.cpp | 61 -- src/qtconfig/mainwindow.cpp | 858 ---------------------- src/qtconfig/mainwindow.h | 101 --- src/qtconfig/mainwindow.ui | 1213 -------------------------------- src/qtconfig/paletteeditoradvanced.cpp | 393 ----------- src/qtconfig/paletteeditoradvanced.h | 98 --- src/qtconfig/paletteeditoradvanced.ui | 408 ----------- src/qtconfig/previewframe.cpp | 96 --- src/qtconfig/previewframe.h | 75 -- src/qtconfig/previewwidget.cpp | 81 --- src/qtconfig/previewwidget.h | 62 -- src/qtconfig/previewwidget.ui | 244 ------- src/qtconfig/qtconfig.pro | 14 - src/qtconfig/qtconfig.qrc | 5 - src/src.pro | 2 - 19 files changed, 3994 deletions(-) delete mode 100644 src/qtconfig/colorbutton.cpp delete mode 100644 src/qtconfig/colorbutton.h delete mode 100644 src/qtconfig/images/appicon.png delete mode 100644 src/qtconfig/main.cpp delete mode 100644 src/qtconfig/mainwindow.cpp delete mode 100644 src/qtconfig/mainwindow.h delete mode 100644 src/qtconfig/mainwindow.ui delete mode 100644 src/qtconfig/paletteeditoradvanced.cpp delete mode 100644 src/qtconfig/paletteeditoradvanced.h delete mode 100644 src/qtconfig/paletteeditoradvanced.ui delete mode 100644 src/qtconfig/previewframe.cpp delete mode 100644 src/qtconfig/previewframe.h delete mode 100644 src/qtconfig/previewwidget.cpp delete mode 100644 src/qtconfig/previewwidget.h delete mode 100644 src/qtconfig/previewwidget.ui delete mode 100644 src/qtconfig/qtconfig.pro delete mode 100644 src/qtconfig/qtconfig.qrc diff --git a/.gitignore b/.gitignore index a792167..541c4bd 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,6 @@ bin/qcollectiongenerator* bin/qdbus* bin/qhelpconverter* bin/qhelpgenerator* -bin/qtconfig* bin/xmlpatterns* bin/cetest* bin/collectiongenerator diff --git a/src/qtconfig/colorbutton.cpp b/src/qtconfig/colorbutton.cpp deleted file mode 100644 index 1acf697..0000000 --- a/src/qtconfig/colorbutton.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "colorbutton.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -ColorButton::ColorButton(QWidget *parent) - : QAbstractButton(parent) - , col(Qt::black) - , mousepressed(false) -{ - setAcceptDrops(true); - connect(this, SIGNAL(clicked()), SLOT(changeColor())); -} - - -ColorButton::ColorButton(const QColor &c, QWidget *parent) - : QAbstractButton(parent) - , col(c) -{ - setAcceptDrops(true); - 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) -{ - QStyleOptionButton buttonOptions; - buttonOptions.init(this); - buttonOptions.features = QStyleOptionButton::None; - buttonOptions.rect = rect(); - buttonOptions.palette = palette(); - buttonOptions.state = (isDown() ? QStyle::State_Sunken : QStyle::State_Raised); - style()->drawPrimitive(QStyle::PE_PanelButtonBevel, &buttonOptions, p, this); - - p->save(); - drawButtonLabel(p); - p->restore(); - - QStyleOptionFocusRect frectOptions; - frectOptions.init(this); - frectOptions.rect = style()->subElementRect(QStyle::SE_PushButtonFocusRect, &buttonOptions, this); - if (hasFocus()) - style()->drawPrimitive(QStyle::PE_FrameFocusRect, &frectOptions, p, this); -} - - -void ColorButton::drawButtonLabel(QPainter *p) -{ - QPalette::ColorGroup cg = - (isEnabled() ? (hasFocus() ? QPalette::Active : QPalette::Inactive) : QPalette::Disabled); - - p->setPen(palette().color(cg, QPalette::ButtonText)); - p->setBrush(col); - p->drawRect(width() / 4, height() / 4, width() / 2 - 1, height() / 2 - 1); -} - - -void ColorButton::dragEnterEvent(QDragEnterEvent *e) -{ - if (!e->mimeData()->hasColor()) { - e->ignore(); - return; - } -} - - -void ColorButton::dragMoveEvent(QDragMoveEvent *e) -{ - if (!e->mimeData()->hasColor()) { - e->ignore(); - return; - } - - e->accept(); -} - - -void ColorButton::dropEvent(QDropEvent *e) -{ - if (!e->mimeData()->hasColor()) { - e->ignore(); - return; - } - - QColor c = qvariant_cast(e->mimeData()->colorData()); - setColor(c); - emit colorChanged(color()); -} - - -void ColorButton::mousePressEvent(QMouseEvent *e) -{ - presspos = e->pos(); - mousepressed = true; - QAbstractButton::mousePressEvent(e); -} - - -void ColorButton::mouseReleaseEvent(QMouseEvent *e) -{ - mousepressed = false; - QAbstractButton::mouseReleaseEvent(e); -} - - -void ColorButton::mouseMoveEvent(QMouseEvent *e) -{ - if (!mousepressed) - return; - - if ((presspos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { - mousepressed = false; - setDown(false); - - QDrag *drag = new QDrag(this); - QMimeData *data = new QMimeData; - data->setColorData(color()); - drag->setMimeData(data); - drag->start(Qt::CopyAction); - } -} - -void ColorButton::paintEvent(QPaintEvent *) -{ - QPainter p(this); - drawButton(&p); -} - -QT_END_NAMESPACE diff --git a/src/qtconfig/colorbutton.h b/src/qtconfig/colorbutton.h deleted file mode 100644 index f569c4f..0000000 --- a/src/qtconfig/colorbutton.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef COLORBUTTON_H -#define COLORBUTTON_H - -#include - -QT_BEGIN_NAMESPACE - -class ColorButton : public QAbstractButton -{ - Q_OBJECT - -public: - ColorButton(QWidget *); - ColorButton(const QColor &, QWidget *); - - 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 paintEvent(QPaintEvent *); - void drawButton(QPainter *); - void drawButtonLabel(QPainter *); - -private slots: - void changeColor(); - - -private: - QColor col; - QPoint presspos; - bool mousepressed; -}; - -QT_END_NAMESPACE - -#endif // COLORBUTTON_H diff --git a/src/qtconfig/images/appicon.png b/src/qtconfig/images/appicon.png deleted file mode 100644 index 02c803bffaf2599c65be73a22806e7d114f1ffa9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1222 zcmY+Cc~DbV6vhM5Sa2waN(Izf3c-z`+CfKZ3)z4N7*hgc0kK#tNCzwyJD@S)0m>=@ z53#aFF(`t78%zO1vyouf!V(sh2qXxRuqJ^JAn6M;t>et^e)rt(e&@{n*8zEWDhC6yu{0JA_CXE~WMgO?42_L5z{SE!+H zxosi2ZD*kN&^!ZYZ*_#_cZA*U2>+`SCgM)#`8%DFg8&3TBMbHS(RYCTKN8H+r;y($p(?UQ6z8bmcQ)z(A+o05>K%Q6uhBn!J8T3 z+nILBY}dOv(a2oS=zOnqp`lC{--V zW|k%vmKDn7X_at=GxX>$wV0?aVVf`Oj{j`GmmkyAuJNG9#VJ?X z-%fYdNLRPkMGZU#lujsT=yunu9g>H!u|9_}Zo!A*#?ojZJ-%hNP+Q^A$aDIdY8%JA z{KkCc!y7iD>Oc2CBVDKt%1LS!y+fCl2r`)`>>}*kH9_~jZ@|B-B|x&x8;sF@#&h%A zEruK-kA~U>xQnU|k33?8g+FsaJ#4x`vL zK9~NJDc#n@$k721&qem)z(SjBTN9+GJzx%sIU48Y9i)RmBT^Qa(}CCsF}&}Jk~Bv3 z091q6 zgo#1fjQgy>1CZ^;&%GK=6xn%dtBLVn>%9{NXXGw1&8;O04GLe1th)^Duh75XrxV5W zHA_Iqw7KruYev>t?U_7zJiJ!D!`WfEa-;@|b=aS5o@!dJM_V=JxtygYE~ApimqUxN)z`WL}NkKF(O diff --git a/src/qtconfig/main.cpp b/src/qtconfig/main.cpp deleted file mode 100644 index ec3db58..0000000 --- a/src/qtconfig/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include -#include -#include -#include - -QT_USE_NAMESPACE - -int main(int argc, char **argv) -{ - Q_INIT_RESOURCE(qtconfig); - - QApplication app(argc, argv); - - QTranslator translator; - QTranslator qtTranslator; - QString sysLocale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - if (translator.load(QLatin1String("qtconfig_") + sysLocale, resourceDir) - && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir)) { - app.installTranslator(&translator); - app.installTranslator(&qtTranslator); - } - - MainWindow mw; - mw.show(); - return app.exec(); -} diff --git a/src/qtconfig/mainwindow.cpp b/src/qtconfig/mainwindow.cpp deleted file mode 100644 index 8a8ceac..0000000 --- a/src/qtconfig/mainwindow.cpp +++ /dev/null @@ -1,858 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "ui_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 - -QT_BEGIN_NAMESPACE - -// from qapplication.cpp and qapplication_x11.cpp - These are NOT for -// external use ignore them -// extern bool Q_CORE_EXPORT qt_resolve_symlinks; - -static const char *appearance_text = QT_TRANSLATE_NOOP("MainWindow", -"

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 Window 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 = QT_TRANSLATE_NOOP("MainWindow", -"

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 = QT_TRANSLATE_NOOP("MainWindow", -"

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 *printer_text = QT_TRANSLATE_NOOP("MainWindow", -"

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."); - -QPalette::ColorGroup MainWindow::groupFromIndex(int item) -{ - switch (item) { - case 0: - default: - return QPalette::Active; - case 1: - return QPalette::Inactive; - case 2: - return QPalette::Disabled; - } -} - -static void setStyleHelper(QWidget *w, QStyle *s) -{ - const QObjectList children = w->children(); - for (int i = 0; i < children.size(); ++i) { - QObject *child = children.at(i); - if (child->isWidgetType()) - setStyleHelper((QWidget *) child, s); - } - w->setStyle(s); -} - -MainWindow::MainWindow() - : ui(new Ui::MainWindow), - editPalette(palette()), - previewPalette(palette()), - previewstyle(0) -{ - ui->setupUi(this); - statusBar(); - - // signals and slots connections - connect(ui->fontPathLineEdit, SIGNAL(returnPressed()), SLOT(addFontpath())); - connect(ui->addFontPathButton, SIGNAL(clicked()), SLOT(addFontpath())); - connect(ui->addSubstitutionButton, SIGNAL(clicked()), SLOT(addSubstitute())); - connect(ui->browseFontPathButton, SIGNAL(clicked()), SLOT(browseFontpath())); - connect(ui->fontStyleCombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->pointSizeCombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->downFontpathButton, SIGNAL(clicked()), SLOT(downFontpath())); - connect(ui->downSubstitutionButton, SIGNAL(clicked()), SLOT(downSubstitute())); - connect(ui->fontFamilyCombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); - connect(ui->fileExitAction, SIGNAL(triggered()), SLOT(fileExit())); - connect(ui->fileSaveAction, SIGNAL(triggered()), SLOT(fileSave())); - connect(ui->helpAboutAction, SIGNAL(triggered()), SLOT(helpAbout())); - connect(ui->helpAboutQtAction, SIGNAL(triggered()), SLOT(helpAboutQt())); - connect(ui->mainTabWidget, SIGNAL(currentChanged(int)), SLOT(pageChanged(int))); - connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(ui->removeFontpathButton, SIGNAL(clicked()), SLOT(removeFontpath())); - connect(ui->removeSubstitutionButton, SIGNAL(clicked()), SLOT(removeSubstitute())); - connect(ui->toolBoxEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->doubleClickIntervalSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->cursorFlashTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->wheelScrollLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->menuEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->comboEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->toolTipEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->strutWidthSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->strutHeightSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->effectsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->resolveLinksCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->fontEmbeddingCheckBox, SIGNAL(clicked()), SLOT(somethingModified())); - connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); - connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); - connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette())); - connect(ui->upFontpathButton, SIGNAL(clicked()), SLOT(upFontpath())); - connect(ui->upSubstitutionButton, SIGNAL(clicked()), SLOT(upSubstitute())); - - modified = true; - desktopThemeName = tr("Desktop Settings (Default)"); - setWindowIcon(QPixmap(":/qt-project.org/qtconfig/images/appicon.png")); - QStringList gstyles = QStyleFactory::keys(); - gstyles.sort(); - ui->guiStyleCombo->addItem(desktopThemeName); - ui->guiStyleCombo->setItemData(ui->guiStyleCombo->findText(desktopThemeName), - tr("Choose style and palette based on your desktop settings."), - Qt::ToolTipRole); - ui->guiStyleCombo->addItems(gstyles); - - QSettings settings(QLatin1String("QtProject")); - settings.beginGroup(QLatin1String("Qt")); - - QString currentstyle = settings.value(QLatin1String("style")).toString(); - if (currentstyle.isEmpty()) { - ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName)); - currentstyle = QApplication::style()->objectName(); - } else { - int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString); - if (index != -1) { - ui->guiStyleCombo->setCurrentIndex(index); - } else { // we give up - ui->guiStyleCombo->addItem(tr("Unknown")); - ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1); - } - } - ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button)); - ui->buttonWindowColor->setColor(palette().color(QPalette::Active, QPalette::Window)); - connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); - connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); - -#ifdef Q_WS_X11 - if (X11->desktopEnvironment == DE_KDE) - ui->colorConfig->hide(); - else - ui->kdeNoteLabel->hide(); -#else - ui->colorConfig->hide(); - ui->kdeNoteLabel->hide(); -#endif - - QFontDatabase db; - QStringList families = db.families(); - ui->fontFamilyCombo->addItems(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(); - ui->familySubstitutionCombo->addItems(fs); - - ui->chooseSubstitutionCombo->addItems(families); - QList sizes = db.standardSizes(); - foreach(int i, sizes) - ui->pointSizeCombo->addItem(QString::number(i)); - - ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval()); - ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime()); - ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines()); - // ############# - // resolveLinksCheckBox->setChecked(qt_resolve_symlinks); - - ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); - ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked()); - - if (QApplication::isEffectEnabled(Qt::UI_FadeMenu)) - ui->menuEffectCombo->setCurrentIndex(2); - else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu)) - ui->menuEffectCombo->setCurrentIndex(1); - - if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)) - ui->comboEffectCombo->setCurrentIndex(1); - - if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) - ui->toolTipEffectCombo->setCurrentIndex(2); - else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) - ui->toolTipEffectCombo->setCurrentIndex(1); - - if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox)) - ui->toolBoxEffectCombo->setCurrentIndex(1); - - QSize globalStrut = QApplication::globalStrut(); - ui->strutWidthSpinBox->setValue(globalStrut.width()); - ui->strutHeightSpinBox->setValue(globalStrut.height()); - - // 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; - - ui->fontFamilyCombo->setCurrentIndex(i); - - QStringList styles = db.styles(ui->fontFamilyCombo->currentText()); - ui->fontStyleCombo->addItems(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; - ui->fontStyleCombo->setCurrentIndex(i); - - i = 0; - for (int psize = QApplication::font().pointSize(); i < ui->pointSizeCombo->count(); ++i) { - const int sz = ui->pointSizeCombo->itemText(i).toInt(); - if (sz == psize) { - ui->pointSizeCombo->setCurrentIndex(i); - break; - } else if(sz > psize) { - ui->pointSizeCombo->insertItem(i, QString::number(psize)); - ui->pointSizeCombo->setCurrentIndex(i); - break; - } - } - - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - - ui->rtlExtensionsCheckBox->setChecked(settings.value(QLatin1String("useRtlExtensions"), false) - .toBool()); - -#ifdef Q_WS_X11 - QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString(); - if (!settingsInputStyle.isEmpty()) - ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle)); -#else - ui->inputStyleCombo->hide(); - ui->inputStyleLabel->hide(); -#endif - -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - QStringList inputMethodCombo = QInputContextFactory::keys(); - int inputMethodComboIndex = -1; - QString defaultInputMethod = settings.value(QLatin1String("DefaultInputMethod"), QLatin1String("xim")).toString(); - for (int i = inputMethodCombo.size()-1; i >= 0; --i) { - const QString &im = inputMethodCombo.at(i); - if (im.contains(QLatin1String("imsw"))) { - inputMethodCombo.removeAt(i); - if (inputMethodComboIndex > i) - --inputMethodComboIndex; - } else if (im == defaultInputMethod) { - inputMethodComboIndex = i; - } - } - if (inputMethodComboIndex == -1 && !inputMethodCombo.isEmpty()) - inputMethodComboIndex = 0; - ui->inputMethodCombo->addItems(inputMethodCombo); - ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex); -#else - ui->inputMethodCombo->hide(); - ui->inputMethodLabel->hide(); -#endif - - ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true) - .toBool()); - fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); - ui->fontpathListBox->insertItems(0, fontpaths); - - settings.endGroup(); // Qt - - ui->helpView->setText(tr(appearance_text)); - - setModified(false); - updateStyleLayout(); -} - -MainWindow::~MainWindow() -{ - delete ui; -} - -#ifdef Q_WS_X11 -extern void qt_x11_apply_settings_in_all_apps(); -#endif - -void MainWindow::fileSave() -{ - if (! modified) { - statusBar()->showMessage(tr("No changes to be saved."), 2000); - return; - } - - statusBar()->showMessage(tr("Saving changes...")); - - { - QSettings settings(QLatin1String("QtProject")); - settings.beginGroup(QLatin1String("Qt")); - QFontDatabase db; - QFont font = db.font(ui->fontFamilyCombo->currentText(), - ui->fontStyleCombo->currentText(), - ui->pointSizeCombo->currentText().toInt()); - - QStringList actcg, inactcg, discg; - bool overrideDesktopSettings = (ui->guiStyleCombo->currentText() != desktopThemeName); - if (overrideDesktopSettings) { - int i; - for (i = 0; i < QPalette::NColorRoles; i++) - actcg << editPalette.color(QPalette::Active, - QPalette::ColorRole(i)).name(); - for (i = 0; i < QPalette::NColorRoles; i++) - inactcg << editPalette.color(QPalette::Inactive, - QPalette::ColorRole(i)).name(); - for (i = 0; i < QPalette::NColorRoles; i++) - discg << editPalette.color(QPalette::Disabled, - QPalette::ColorRole(i)).name(); - } - - settings.setValue(QLatin1String("font"), font.toString()); - settings.setValue(QLatin1String("Palette/active"), actcg); - settings.setValue(QLatin1String("Palette/inactive"), inactcg); - settings.setValue(QLatin1String("Palette/disabled"), discg); - - settings.setValue(QLatin1String("fontPath"), fontpaths); - settings.setValue(QLatin1String("embedFonts"), ui->fontEmbeddingCheckBox->isChecked()); - settings.setValue(QLatin1String("style"), - overrideDesktopSettings ? ui->guiStyleCombo->currentText() : QString()); - - settings.setValue(QLatin1String("doubleClickInterval"), ui->doubleClickIntervalSpinBox->value()); - settings.setValue(QLatin1String("cursorFlashTime"), - ui->cursorFlashTimeSpinBox->value() == 9 ? 0 : ui->cursorFlashTimeSpinBox->value()); - settings.setValue(QLatin1String("wheelScrollLines"), ui->wheelScrollLinesSpinBox->value()); - settings.setValue(QLatin1String("resolveSymlinks"), ui->resolveLinksCheckBox->isChecked()); - - QSize strut(ui->strutWidthSpinBox->value(), ui->strutHeightSpinBox->value()); - settings.setValue(QLatin1String("globalStrut/width"), strut.width()); - settings.setValue(QLatin1String("globalStrut/height"), strut.height()); - - settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensionsCheckBox->isChecked()); - -#ifdef Q_WS_X11 - QString style = ui->inputStyleCombo->currentText(); - QString str = QLatin1String("On The Spot"); - if (style == tr("Over The Spot")) - str = QLatin1String("Over The Spot"); - else if (style == tr("Off The Spot")) - str = QLatin1String("Off The Spot"); - else if (style == tr("Root")) - str = QLatin1String("Root"); - settings.setValue(QLatin1String("XIMInputStyle"), str); -#endif -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText()); -#endif - - QStringList effects; - if (ui->effectsCheckBox->isChecked()) { - effects << QLatin1String("general"); - - switch (ui->menuEffectCombo->currentIndex()) { - case 1: effects << QLatin1String("animatemenu"); break; - case 2: effects << QLatin1String("fademenu"); break; - } - - switch (ui->comboEffectCombo->currentIndex()) { - case 1: effects << QLatin1String("animatecombo"); break; - } - - switch (ui->toolTipEffectCombo->currentIndex()) { - case 1: effects << QLatin1String("animatetooltip"); break; - case 2: effects << QLatin1String("fadetooltip"); break; - } - - switch (ui->toolBoxEffectCombo->currentIndex()) { - case 1: effects << QLatin1String("animatetoolbox"); break; - } - } else - effects << QLatin1String("none"); - settings.setValue(QLatin1String("GUIEffects"), effects); - - QStringList familysubs = QFont::substitutions(); - QStringList::Iterator fit = familysubs.begin(); - settings.beginGroup(QLatin1String("Font Substitutions")); - while (fit != familysubs.end()) { - QStringList subs = QFont::substitutes(*fit); - settings.setValue(*fit, subs); - fit++; - } - settings.endGroup(); // Font Substitutions - settings.endGroup(); // Qt - } - -#if defined(Q_WS_X11) - qt_x11_apply_settings_in_all_apps(); -#endif // Q_WS_X11 - - setModified(false); - statusBar()->showMessage(tr("Saved changes.")); -} - -void MainWindow::fileExit() -{ - qApp->closeAllWindows(); -} - -void MainWindow::setModified(bool m) -{ - if (modified == m) - return; - - modified = m; - ui->fileSaveAction->setEnabled(m); -} - -void MainWindow::buildPalette() -{ - QPalette temp(ui->buttonMainColor->color(), ui->buttonWindowColor->color()); - for (int i = 0; i < QPalette::NColorGroups; i++) - temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp); - - editPalette = temp; - setPreviewPalette(editPalette); - updateColorButtons(); - - setModified(true); -} - -void MainWindow::setPreviewPalette(const QPalette &pal) -{ - QPalette::ColorGroup colorGroup = groupFromIndex(ui->paletteCombo->currentIndex()); - - for (int i = 0; i < QPalette::NColorGroups; i++) { - for (int j = 0; j < QPalette::NColorRoles; j++) { - QPalette::ColorGroup targetGroup = QPalette::ColorGroup(i); - QPalette::ColorRole targetRole = QPalette::ColorRole(j); - previewPalette.setColor(targetGroup, targetRole, pal.color(colorGroup, targetRole)); - } - } - - ui->previewFrame->setPreviewPalette(previewPalette); -} - -void MainWindow::updateColorButtons() -{ - ui->buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button)); - ui->buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window)); -} - -void MainWindow::tunePalette() -{ - bool ok; - QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, - backgroundRole(), this); - if (!ok) - return; - - editPalette = pal; - setPreviewPalette(editPalette); - setModified(true); -} - -void MainWindow::paletteSelected(int) -{ - setPreviewPalette(editPalette); -} - -void MainWindow::updateStyleLayout() -{ - QString currentStyle = ui->guiStyleCombo->currentText(); - bool autoStyle = (currentStyle == desktopThemeName); - ui->previewFrame->setPreviewVisible(!autoStyle); - ui->buildPaletteGroup->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); -} - -void MainWindow::styleSelected(const QString &stylename) -{ - QStyle *style = 0; - if (stylename == desktopThemeName) { - setModified(true); - } else { - style = QStyleFactory::create(stylename); - if (!style) - return; - setStyleHelper(ui->previewFrame, style); - delete previewstyle; - previewstyle = style; - setModified(true); - } - updateStyleLayout(); -} - -void MainWindow::familySelected(const QString &family) -{ - QFontDatabase db; - QStringList styles = db.styles(family); - ui->fontStyleCombo->clear(); - ui->fontStyleCombo->addItems(styles); - ui->familySubstitutionCombo->addItem(family); - buildFont(); -} - -void MainWindow::buildFont() -{ - QFontDatabase db; - QFont font = db.font(ui->fontFamilyCombo->currentText(), - ui->fontStyleCombo->currentText(), - ui->pointSizeCombo->currentText().toInt()); - ui->sampleLineEdit->setFont(font); - setModified(true); -} - -void MainWindow::substituteSelected(const QString &family) -{ - QStringList subs = QFont::substitutes(family); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); -} - -void MainWindow::removeSubstitute() -{ - if (!ui->substitutionsListBox->currentItem()) - return; - - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - subs.removeAt(ui->substitutionsListBox->currentRow()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - if (row > ui->substitutionsListBox->count()) - row = ui->substitutionsListBox->count() - 1; - ui->substitutionsListBox->setCurrentRow(row); - QFont::removeSubstitutions(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); - setModified(true); -} - -void MainWindow::addSubstitute() -{ - if (!ui->substitutionsListBox->currentItem()) { - QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), - ui->chooseSubstitutionCombo->currentText()); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - setModified(true); - return; - } - - int row = ui->substitutionsListBox->currentRow(); - QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), ui->chooseSubstitutionCombo->currentText()); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row); - setModified(true); -} - -void MainWindow::downSubstitute() -{ - if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() >= ui->substitutionsListBox->count()) - return; - - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - QString fam = subs.at(row); - subs.removeAt(row); - subs.insert(row + 1, fam); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row + 1); - QFont::removeSubstitutions(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); - setModified(true); -} - -void MainWindow::upSubstitute() -{ - if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() < 1) - return; - - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - QString fam = subs.at(row); - subs.removeAt(row); - subs.insert(row-1, fam); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row - 1); - QFont::removeSubstitutions(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); - setModified(true); -} - -void MainWindow::removeFontpath() -{ - if (!ui->fontpathListBox->currentItem()) - return; - - int row = ui->fontpathListBox->currentRow(); - fontpaths.removeAt(row); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - if (row > ui->fontpathListBox->count()) - row = ui->fontpathListBox->count() - 1; - ui->fontpathListBox->setCurrentRow(row); - setModified(true); -} - -void MainWindow::addFontpath() -{ - if (ui->fontPathLineEdit->text().isEmpty()) - return; - - if (!ui->fontpathListBox->currentItem()) { - fontpaths.append(ui->fontPathLineEdit->text()); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - setModified(true); - - return; - } - - int row = ui->fontpathListBox->currentRow(); - fontpaths.insert(row + 1, ui->fontPathLineEdit->text()); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row); - setModified(true); -} - -void MainWindow::downFontpath() -{ - if (!ui->fontpathListBox->currentItem() - || ui->fontpathListBox->currentRow() >= (ui->fontpathListBox->count() - 1)) { - return; - } - - int row = ui->fontpathListBox->currentRow(); - QString fam = fontpaths.at(row); - fontpaths.removeAt(row); - fontpaths.insert(row + 1, fam); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row + 1); - setModified(true); -} - -void MainWindow::upFontpath() -{ - if (!ui->fontpathListBox->currentItem() || ui->fontpathListBox->currentRow() < 1) - return; - - int row = ui->fontpathListBox->currentRow(); - QString fam = fontpaths.at(row); - fontpaths.removeAt(row); - fontpaths.insert(row - 1, fam); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row - 1); - setModified(true); -} - -void MainWindow::browseFontpath() -{ - QString dirname = QFileDialog::getExistingDirectory(this, tr("Select a Directory")); - if (dirname.isNull()) - return; - - ui->fontPathLineEdit->setText(dirname); -} - -void MainWindow::somethingModified() -{ - setModified(true); -} - -void MainWindow::helpAbout() -{ - QMessageBox box(this); - box.setText(tr("

%1

" - "
Version %2" - "

Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).") - .arg(tr("Qt Configuration")).arg(QLatin1String(QT_VERSION_STR))); - box.setWindowTitle(tr("Qt Configuration")); - box.setIcon(QMessageBox::NoIcon); - box.exec(); -} - -void MainWindow::helpAboutQt() -{ - QMessageBox::aboutQt(this, tr("Qt Configuration")); -} - -void MainWindow::pageChanged(int pageNumber) -{ - QWidget *page = ui->mainTabWidget->widget(pageNumber); - if (page == ui->interfaceTab) - ui->helpView->setText(tr(interface_text)); - else if (page == ui->appearanceTab) - ui->helpView->setText(tr(appearance_text)); - else if (page == ui->fontsTab) - ui->helpView->setText(tr(font_text)); - else if (page == ui->printerTab) - ui->helpView->setText(tr(printer_text)); -} - -void MainWindow::closeEvent(QCloseEvent *e) -{ - if (modified) { - switch (QMessageBox::warning(this, tr("Save Changes"), - tr("Save changes to settings?"), - (QMessageBox::Yes | QMessageBox::No - | QMessageBox::Cancel))) { - case QMessageBox::Yes: // save - qApp->processEvents(); - fileSave(); - - // fall through intended - case QMessageBox::No: // don't save - e->accept(); - break; - - case QMessageBox::Cancel: // cancel - e->ignore(); - break; - - default: break; - } - } else - e->accept(); -} - -QT_END_NAMESPACE diff --git a/src/qtconfig/mainwindow.h b/src/qtconfig/mainwindow.h deleted file mode 100644 index e1b583c..0000000 --- a/src/qtconfig/mainwindow.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE - -namespace Ui { - class MainWindow; -} - -class MainWindow : public QMainWindow -{ - 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 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(int); - - -private: - void updateColorButtons(); - void updateFontSample(); - void updateStyleLayout(); - - static QPalette::ColorGroup groupFromIndex(int); - - void setPreviewPalette(const QPalette &); - - void setModified(bool); - - Ui::MainWindow *ui; - QString desktopThemeName; - QPalette editPalette, previewPalette; - QStyle *previewstyle; - QStringList fontpaths; - bool modified; -}; - -QT_END_NAMESPACE - -#endif // MAINWINDOW_H diff --git a/src/qtconfig/mainwindow.ui b/src/qtconfig/mainwindow.ui deleted file mode 100644 index 06a7aa7..0000000 --- a/src/qtconfig/mainwindow.ui +++ /dev/null @@ -1,1213 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -********************************************************************* - MainWindow - - - - 0 - 0 - 815 - 716 - - - - Qt Configuration - - - - - 8 - - - - - - 200 - 0 - - - - true - - - - - - - 0 - - - - Appearance - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - GUI Style - - - - 4 - - - 8 - - - - - - 0 - 0 - - - - Select GUI &Style: - - - guiStyleCombo - - - - - - - - - - - - - - 0 - 0 - - - - Preview - - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - 0 - 0 - - - - - 410 - 260 - - - - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Build Palette - - - - - - - 0 - - - - - &Button Background: - - - buttonMainColor - - - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 1 - - - 0 - - - Window Back&ground: - - - Qt::AlignVCenter - - - 0 - - - buttonWindowColor - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - &Tune Palette... - - - - - - - - - - Please use the KDE Control Center to set the palette. - - - - - - - - - - - Fonts - - - - - - Default Font - - - - 8 - - - 4 - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - true - - - false - - - - - - - &Style: - - - fontStyleCombo - - - - - - - &Point Size: - - - pointSizeCombo - - - - - - - F&amily: - - - fontFamilyCombo - - - - - - - Sample Text - - - Qt::AlignHCenter - - - - - - - - - - Font Substitution - - - - 4 - - - 8 - - - - - 4 - - - 0 - - - - - S&elect or Enter a Family: - - - familySubstitutionCombo - - - - - - - true - - - true - - - false - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - Current Substitutions: - - - - - - - - - - 4 - - - 0 - - - - - Up - - - - - - - Down - - - - - - - Remove - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - 4 - - - 0 - - - - - Select s&ubstitute Family: - - - chooseSubstitutionCombo - - - - - - - true - - - false - - - - - - - Add - - - - - - - - - - - - - Interface - - - - - - Feel Settings - - - - 8 - - - 4 - - - - - ms - - - 10 - - - 10000 - - - - - - - &Double Click Interval: - - - doubleClickIntervalSpinBox - - - - - - - No blinking - - - ms - - - 9 - - - 10000 - - - - - - - &Cursor Flash Time: - - - cursorFlashTimeSpinBox - - - - - - - lines - - - 1 - - - 20 - - - - - - - Wheel &Scroll Lines: - - - wheelScrollLinesSpinBox - - - - - - - Resolve symlinks in URLs - - - - - - - - - - GUI Effects - - - - 4 - - - 8 - - - - - &Enable - - - Alt+E - - - - - - - - 4 - - - - - &Menu Effect: - - - menuEffectCombo - - - - - - - C&omboBox Effect: - - - comboEffectCombo - - - - - - - &ToolTip Effect: - - - toolTipEffectCombo - - - - - - - Tool&Box Effect: - - - toolBoxEffectCombo - - - - - - - 0 - - - true - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - - - - - - Global Strut - - - - 8 - - - 4 - - - - - Minimum &Width: - - - strutWidthSpinBox - - - - - - - Minimum Hei&ght: - - - strutHeightSpinBox - - - - - - - pixels - - - 1000 - - - - - - - pixels - - - 1000 - - - - - - - - - - Enhanced support for languages written right-to-left - - - - - - - XIM Input Style: - - - - - - - 0 - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - - - - Default Input Method: - - - - - - - -1 - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - Printer - - - - - - Enable Font embedding - - - true - - - - - - - - 0 - 0 - - - - Font Paths - - - - 4 - - - 8 - - - - - 0 - - - 4 - - - - - Up - - - - - - - Remove - - - - - - - Down - - - - - - - - - - - - 0 - - - 4 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Add - - - - - - - Browse... - - - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 815 - 19 - - - - - - 203 - 114 - 161 - 110 - - - - &File - - - - - - - - - 543 - 98 - 161 - 106 - - - - &Help - - - - - - - - - - - &Save - - - Save - - - Ctrl+S - - - - - E&xit - - - Exit - - - Ctrl+Q - - - - - &About - - - About - - - - - - - - About &Qt - - - About Qt - - - - - - ColorButton - -
colorbutton.h
-
- - PreviewFrame - -
previewframe.h
-
-
- - helpView - mainTabWidget - guiStyleCombo - tunePaletteButton - paletteCombo - fontFamilyCombo - fontStyleCombo - pointSizeCombo - sampleLineEdit - familySubstitutionCombo - substitutionsListBox - upSubstitutionButton - downSubstitutionButton - removeSubstitutionButton - chooseSubstitutionCombo - addSubstitutionButton - doubleClickIntervalSpinBox - cursorFlashTimeSpinBox - wheelScrollLinesSpinBox - resolveLinksCheckBox - effectsCheckBox - menuEffectCombo - comboEffectCombo - toolTipEffectCombo - toolBoxEffectCombo - strutWidthSpinBox - strutHeightSpinBox - rtlExtensionsCheckBox - inputStyleCombo - inputMethodCombo - fontEmbeddingCheckBox - fontpathListBox - upFontpathButton - downFontpathButton - removeFontpathButton - fontPathLineEdit - browseFontPathButton - addFontPathButton - - - - - effectsCheckBox - toggled(bool) - effectsFrame - setEnabled(bool) - - - 417 - 257 - - - 578 - 379 - - - - - fontEmbeddingCheckBox - toggled(bool) - fontPathsGroup - setEnabled(bool) - - - 449 - 69 - - - 447 - 94 - - - - -
diff --git a/src/qtconfig/paletteeditoradvanced.cpp b/src/qtconfig/paletteeditoradvanced.cpp deleted file mode 100644 index 64ed182..0000000 --- a/src/qtconfig/paletteeditoradvanced.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "ui_paletteeditoradvanced.h" -#include "paletteeditoradvanced.h" -#include "colorbutton.h" - -QT_BEGIN_NAMESPACE - -PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent) - : QDialog(parent), ui(new Ui::PaletteEditorAdvanced), selectedPalette(0) -{ - ui->setupUi(this); - - // create a ColorButton's - buttonCentral = new ColorButton(ui->groupCentral); - buttonCentral->setToolTip(tr("Choose a color")); - buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role.")); - ui->layoutCentral->addWidget(buttonCentral); - ui->labelCentral->setBuddy(buttonCentral); - - buttonEffect = new ColorButton(ui->groupEffect); - buttonEffect->setToolTip(tr("Choose a color")); - buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role.")); - buttonEffect->setEnabled(false); - ui->layoutEffect->addWidget(buttonEffect); - ui->labelEffect->setBuddy(buttonEffect); - - // signals and slots connections - connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(ui->comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int))); - connect(buttonCentral, SIGNAL(clicked()), SLOT(onChooseCentralColor())); - connect(buttonEffect, SIGNAL(clicked()), SLOT(onChooseEffectColor())); - connect(ui->comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int))); - connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool))); - connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); - connect(ui->checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool))); - connect(ui->checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool))); - - onToggleBuildEffects(true); - - editPalette = QApplication::palette(); -} - -PaletteEditorAdvanced::~PaletteEditorAdvanced() -{ - delete ui; -} - -void PaletteEditorAdvanced::onToggleBuildInactive(bool v) -{ - if (selectedPalette == 1) { - ui->groupCentral->setDisabled(v); - ui->groupEffect->setDisabled(v); - } - - if (v) { - build(QPalette::Inactive); - updateColorButtons(); - } -} - -void PaletteEditorAdvanced::onToggleBuildDisabled(bool v) -{ - if (selectedPalette == 2) { - ui->groupCentral->setDisabled(v); - ui->groupEffect->setDisabled(v); - } - - if (v) { - build(QPalette::Disabled); - updateColorButtons(); - } -} - -void PaletteEditorAdvanced::paletteSelected(int p) -{ - selectedPalette = p; - - if(p == 1) { // inactive - ui->groupCentral->setDisabled(ui->checkBuildInactive->isChecked()); - ui->groupEffect->setDisabled(ui->checkBuildInactive->isChecked()); - } else if (p == 2) { // disabled - ui->groupCentral->setDisabled(ui->checkBuildDisabled->isChecked()); - ui->groupEffect->setDisabled(ui->checkBuildDisabled->isChecked()); - } else { - ui->groupCentral->setEnabled(true); - ui->groupEffect->setEnabled(true); - } - updateColorButtons(); -} - -void PaletteEditorAdvanced::onChooseCentralColor() -{ - QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, centralFromIndex(ui->comboCentral->currentIndex()), - buttonCentral->color()); - - buildEffect(group); - if (group == QPalette::Active) { - if(ui->checkBuildInactive->isChecked()) - build(QPalette::Inactive); - if(ui->checkBuildDisabled->isChecked()) - build(QPalette::Disabled); - } - - updateColorButtons(); -} - -void PaletteEditorAdvanced::onChooseEffectColor() -{ - QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, effectFromIndex(ui->comboEffect->currentIndex()), - buttonEffect->color()); - - if (group == QPalette::Active) { - if(ui->checkBuildInactive->isChecked()) - build(QPalette::Inactive); - if(ui->checkBuildDisabled->isChecked()) - build(QPalette::Disabled); - } - - updateColorButtons(); -} - -void PaletteEditorAdvanced::onToggleBuildEffects(bool on) -{ - if (on) { - for (int i = 0; i < QPalette::NColorGroups; i++) - buildEffect(QPalette::ColorGroup(i)); - } -} - -QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) -{ - switch (item) { - case 0: - default: - return QPalette::Active; - case 1: - return QPalette::Inactive; - case 2: - return QPalette::Disabled; - } -} - -QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) -{ - switch (item) { - case 0: - return QPalette::Window; - case 1: - return QPalette::WindowText; - case 2: - return QPalette::Base; - case 3: - return QPalette::AlternateBase; - case 4: - return QPalette::ToolTipBase; - case 5: - return QPalette::ToolTipText; - case 6: - return QPalette::Text; - case 7: - return QPalette::Button; - case 8: - return QPalette::ButtonText; - case 9: - return QPalette::BrightText; - case 10: - return QPalette::Highlight; - case 11: - return QPalette::HighlightedText; - case 12: - return QPalette::Link; - case 13: - return QPalette::LinkVisited; - default: - return QPalette::NoRole; - } -} - -QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item) -{ - switch (item) { - case 0: - return QPalette::Light; - case 1: - return QPalette::Midlight; - case 2: - return QPalette::Mid; - case 3: - return QPalette::Dark; - case 4: - return QPalette::Shadow; - default: - return QPalette::NoRole; - } -} - -void PaletteEditorAdvanced::onCentral(int item) -{ - QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item)); - buttonCentral->setColor(c); -} - -void PaletteEditorAdvanced::onEffect(int item) -{ - QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item)); - buttonEffect->setColor(c); -} - -QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup, - const QPalette &basePalette) -{ - QPalette result(basePalette); - - if (colorGroup == QPalette::Active) { - QPalette calculatedPalette(basePalette.color(colorGroup, QPalette::Button), - basePalette.color(colorGroup, QPalette::Window)); - - for (int i = 0; i < 5; i++) { - QPalette::ColorRole effectRole = effectFromIndex(i); - result.setColor(colorGroup, effectRole, - calculatedPalette.color(colorGroup, effectRole)); - } - } else { - QColor btn = basePalette.color(colorGroup, QPalette::Button); - - result.setColor(colorGroup, QPalette::Light, btn.lighter()); - result.setColor(colorGroup, QPalette::Midlight, btn.lighter(115)); - result.setColor(colorGroup, QPalette::Mid, btn.darker(150)); - result.setColor(colorGroup, QPalette::Dark, btn.darker()); - result.setColor(colorGroup, QPalette::Shadow, Qt::black); - } - - return result; -} - -void PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup) -{ - editPalette = buildEffect(colorGroup, editPalette); - updateColorButtons(); -} - -void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup) -{ - if (colorGroup != QPalette::Active) { - for (int i = 0; i < QPalette::NColorRoles; i++) - editPalette.setColor(colorGroup, QPalette::ColorRole(i), - editPalette.color(QPalette::Active, QPalette::ColorRole(i))); - - if (colorGroup == QPalette::Disabled) { - editPalette.setColor(colorGroup, QPalette::ButtonText, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::WindowText, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::Text, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::HighlightedText, Qt::darkGray); - } - - if (ui->checkBuildEffect->isChecked()) - buildEffect(colorGroup); - else - updateColorButtons(); - } -} - -void PaletteEditorAdvanced::updateColorButtons() -{ - QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette); - buttonCentral->setColor(editPalette.color(colorGroup, - centralFromIndex(ui->comboCentral->currentIndex()))); - buttonEffect->setColor(editPalette.color(colorGroup, - effectFromIndex(ui->comboEffect->currentIndex()))); -} - -void PaletteEditorAdvanced::setPal(const QPalette &pal) -{ - editPalette = pal; - updateColorButtons(); -} - -QPalette PaletteEditorAdvanced::pal() const -{ - return editPalette; -} - -void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) -{ - int initRole = 0; - - switch (role) { - case QPalette::Window: - initRole = 0; - break; - case QPalette::WindowText: - initRole = 1; - break; - case QPalette::Base: - initRole = 2; - break; - case QPalette::AlternateBase: - initRole = 3; - break; - case QPalette::ToolTipBase: - initRole = 4; - break; - case QPalette::ToolTipText: - initRole = 5; - break; - case QPalette::Text: - initRole = 6; - break; - case QPalette::Button: - initRole = 7; - break; - case QPalette::ButtonText: - initRole = 8; - break; - case QPalette::BrightText: - initRole = 9; - break; - case QPalette::Highlight: - initRole = 10; - break; - case QPalette::HighlightedText: - initRole = 11; - break; - case QPalette::Link: - initRole = 12; - break; - case QPalette::LinkVisited: - initRole = 13; - break; - default: - initRole = -1; - break; - } - - if (initRole != -1) - ui->comboCentral->setCurrentIndex(initRole); -} - -QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init, - QPalette::ColorRole backgroundRole, QWidget *parent) -{ - PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent); - dlg->setupBackgroundRole(backgroundRole); - - if (init != QPalette()) - dlg->setPal(init); - int resultCode = dlg->exec(); - - QPalette result = init; - if (resultCode == QDialog::Accepted) - result = dlg->pal(); - - if (ok) - *ok = resultCode; - - delete dlg; - return result; -} - -QT_END_NAMESPACE diff --git a/src/qtconfig/paletteeditoradvanced.h b/src/qtconfig/paletteeditoradvanced.h deleted file mode 100644 index c1ce280..0000000 --- a/src/qtconfig/paletteeditoradvanced.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PALETTEEDITORADVANCED_H -#define PALETTEEDITORADVANCED_H - -#include - -QT_BEGIN_NAMESPACE - -namespace Ui { - class PaletteEditorAdvanced; -} - -class ColorButton; - -class PaletteEditorAdvanced : public QDialog -{ - Q_OBJECT -public: - PaletteEditorAdvanced(QWidget *parent = 0); - ~PaletteEditorAdvanced(); - - static QPalette getPalette(bool *ok, const QPalette &pal, - QPalette::ColorRole backgroundRole = QPalette::Window, - QWidget *parent = 0); - - static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette); - -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 buildEffect(QPalette::ColorGroup); - void build(QPalette::ColorGroup); - -private: - void updateColorButtons(); - void setupBackgroundRole(QPalette::ColorRole); - - QPalette pal() const; - void setPal(const QPalette &); - - static QPalette::ColorGroup groupFromIndex(int); - static QPalette::ColorRole centralFromIndex(int); - static QPalette::ColorRole effectFromIndex(int); - QPalette editPalette; - - Ui::PaletteEditorAdvanced *ui; - - int selectedPalette; - ColorButton *buttonCentral; - ColorButton *buttonEffect; -}; - -QT_END_NAMESPACE - -#endif // PALETTEEDITORADVANCED_H diff --git a/src/qtconfig/paletteeditoradvanced.ui b/src/qtconfig/paletteeditoradvanced.ui deleted file mode 100644 index 04c0648..0000000 --- a/src/qtconfig/paletteeditoradvanced.ui +++ /dev/null @@ -1,408 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -********************************************************************* - PaletteEditorAdvanced - - - - 0 - 0 - 239 - 344 - - - - Tune Palette - - - - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - - - 0 - 0 - - - - Auto - - - - - - Build inactive palette from active - - - true - - - - - - - Build disabled palette from active - - - true - - - - - - - - - - Central color &roles - - - - - - Choose central color role - - - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - 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 foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, 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 WindowText and contrasts well with e.g. black. </li> </ul> </p> - - - - Window - - - - - WindowText - - - - - Base - - - - - AlternateBase - - - - - ToolTipBase - - - - - ToolTipText - - - - - Text - - - - - Button - - - - - ButtonText - - - - - BrightText - - - - - Highlight - - - - - HighlightedText - - - - - Link - - - - - LinkVisited - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - &Select Color: - - - - - - - - - - - - 3-D shadow &effects - - - - - - - - Generate shadings - - - Check to let 3D-effect colors be calculated from button-color. - - - Build &from button color - - - true - - - - - - - false - - - 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> - - - - Light - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Select Co&lor: - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - PaletteEditorAdvanced - accept() - - - 238 - 384 - - - 157 - 274 - - - - - buttonBox - rejected() - PaletteEditorAdvanced - reject() - - - 306 - 390 - - - 286 - 274 - - - - - checkBuildEffect - toggled(bool) - comboEffect - setDisabled(bool) - - - 82 - 262 - - - 190 - 262 - - - - - diff --git a/src/qtconfig/previewframe.cpp b/src/qtconfig/previewframe.cpp deleted file mode 100644 index 036973b..0000000 --- a/src/qtconfig/previewframe.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "previewframe.h" -#include "previewwidget.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -PreviewFrame::PreviewFrame(QWidget *parent) - : QFrame(parent) -{ - setMinimumSize(200, 200); - setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - setLineWidth(1); - - QVBoxLayout *vbox = new QVBoxLayout(this); - vbox->setMargin(0); - previewWidget = new PreviewWidget; - workspace = new Workspace(this); - vbox->addWidget(workspace); - previewWidget->setAutoFillBackground(true); -} - -void PreviewFrame::setPreviewPalette(QPalette pal) -{ - previewWidget->setPalette(pal); -} - -QString PreviewFrame::previewText() const -{ - return m_previewWindowText; -} - -void PreviewFrame::setPreviewVisible(bool visible) -{ - previewWidget->parentWidget()->setVisible(visible); - if (visible) - m_previewWindowText = QLatin1String("The moose in the noose\nate the goose who was loose."); - else - m_previewWindowText = tr("Desktop settings will only take effect after an application restart."); - workspace->viewport()->update(); -} - -Workspace::Workspace(PreviewFrame *parent) - : QMdiArea(parent) -{ - previewFrame = parent; - PreviewWidget *previewWidget = previewFrame->widget(); - QMdiSubWindow *frame = addSubWindow(previewWidget, Qt::Window); - frame->move(10, 10); - frame->show(); -} - -void Workspace::paintEvent(QPaintEvent *) -{ - QPainter p(viewport()); - p.fillRect(rect(), palette().color(backgroundRole()).dark()); - p.setPen(QPen(Qt::white)); - p.drawText(0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText()); -} - -QT_END_NAMESPACE diff --git a/src/qtconfig/previewframe.h b/src/qtconfig/previewframe.h deleted file mode 100644 index 9842755..0000000 --- a/src/qtconfig/previewframe.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PREVIEWFRAME_H -#define PREVIEWFRAME_H - -#include - -QT_BEGIN_NAMESPACE - -class PreviewFrame; -class Workspace : public QMdiArea -{ - Q_OBJECT - -public: - Workspace(PreviewFrame *parent = 0); - ~Workspace() {} - -protected: - void paintEvent(QPaintEvent *); -private: - PreviewFrame *previewFrame; -}; - -class PreviewWidget; -class PreviewFrame : public QFrame -{ - Q_OBJECT - -public: - PreviewFrame(QWidget *parent = 0); - void setPreviewPalette(QPalette); - void setPreviewVisible(bool val); - QString previewText() const; - PreviewWidget *widget() const { return previewWidget; } -private: - Workspace *workspace; - PreviewWidget *previewWidget; - QString m_previewWindowText; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/qtconfig/previewwidget.cpp b/src/qtconfig/previewwidget.cpp deleted file mode 100644 index 93310db..0000000 --- a/src/qtconfig/previewwidget.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "previewwidget.h" -#include "ui_previewwidget.h" -#include - -QT_BEGIN_NAMESPACE - -PreviewWidget::PreviewWidget(QWidget *parent) - : QWidget(parent), ui(new Ui::PreviewWidget) -{ - ui->setupUi(this); - - // install event filter on child widgets - QList l = findChildren(); - foreach(QWidget *w, l) { - w->installEventFilter(this); - w->setFocusPolicy(Qt::NoFocus); - } -} - -PreviewWidget::~PreviewWidget() -{ - delete ui; -} - -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; -} - -void PreviewWidget::closeEvent(QCloseEvent *e) -{ - e->ignore(); -} - -QT_END_NAMESPACE diff --git a/src/qtconfig/previewwidget.h b/src/qtconfig/previewwidget.h deleted file mode 100644 index e83a8fd..0000000 --- a/src/qtconfig/previewwidget.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PREVIEWWIDGET_H -#define PREVIEWWIDGET_H - -#include - -QT_BEGIN_NAMESPACE - -namespace Ui { - class PreviewWidget; -} - - -class PreviewWidget : public QWidget -{ - Q_OBJECT - -public: - PreviewWidget(QWidget *parent = 0); - ~PreviewWidget(); - - bool eventFilter(QObject *, QEvent *); -private: - void closeEvent(QCloseEvent *); - Ui::PreviewWidget *ui; -}; - -QT_END_NAMESPACE - -#endif // PREVIEWWIDGET_H diff --git a/src/qtconfig/previewwidget.ui b/src/qtconfig/previewwidget.ui deleted file mode 100644 index b15f7bd..0000000 --- a/src/qtconfig/previewwidget.ui +++ /dev/null @@ -1,244 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -********************************************************************* - PreviewWidget - - - - 0 - 0 - 398 - 282 - - - - - 0 - 0 - - - - Preview Window - - - - - - - - 6 - - - 0 - - - - - GroupBox - - - - 6 - - - 11 - - - - - RadioButton1 - - - true - - - - - - - RadioButton2 - - - - - - - RadioButton3 - - - - - - - - - - GroupBox2 - - - - 6 - - - 11 - - - - - CheckBox1 - - - true - - - - - - - CheckBox2 - - - - - - - - - - 50 - - - - - - - - - 6 - - - 0 - - - - - LineEdit - - - - - - - - ComboBox - - - - - - - - 6 - - - 0 - - - - - - - - PushButton - - - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - - - - - 32767 - 55 - - - - true - - - <p><a href="http://qt-project.org">http://qt-project.org</a></p> -<p><a href="http://www.kde.org">http://www.kde.org</a></p> - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 0 - - - - - - - - - diff --git a/src/qtconfig/qtconfig.pro b/src/qtconfig/qtconfig.pro deleted file mode 100644 index 057e21b..0000000 --- a/src/qtconfig/qtconfig.pro +++ /dev/null @@ -1,14 +0,0 @@ -CONFIG += x11 -QT += gui-private widgets - -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 = mainwindow.ui paletteeditoradvanced.ui previewwidget.ui -RESOURCES = qtconfig.qrc - -PROJECTNAME = Qt Configuration - -DBFILE = qtconfig.db - -load(qt_app) diff --git a/src/qtconfig/qtconfig.qrc b/src/qtconfig/qtconfig.qrc deleted file mode 100644 index 3fc8f9d..0000000 --- a/src/qtconfig/qtconfig.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - images/appicon.png - - diff --git a/src/src.pro b/src/src.pro index 722b32e..89bdd45 100644 --- a/src/src.pro +++ b/src/src.pro @@ -8,7 +8,6 @@ qtHaveModule(widgets) { pixeltool \ qtestlib \ designer -# unix:!mac:!embedded:!qpa:SUBDIRS += qtconfig linguist.depends = designer } @@ -33,6 +32,5 @@ qtHaveModule(gui):!android:!ios:!qnx:!wince*:!winrt*:SUBDIRS += qtdiag qtNomakeTools( \ pixeltool \ - qtconfig \ macdeployqt \ ) -- 2.7.4