summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/phonon/phonon.pro3
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp11
-rw-r--r--src/corelib/global/qglobal.h2
-rw-r--r--src/corelib/io/qtextstream.cpp1
-rw-r--r--src/corelib/tools/qbytearray.cpp35
-rw-r--r--src/corelib/tools/qstringbuilder.cpp4
-rw-r--r--src/corelib/tools/qstringbuilder.h5
-rw-r--r--src/gui/kernel/qwidget_mac.mm2
-rw-r--r--src/gui/kernel/qwidget_x11.cpp10
-rw-r--r--src/gui/styles/qmacstyle_mac.mm2
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp1
-rw-r--r--src/gui/widgets/qsplashscreen.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp39
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h2
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp53
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h3
-rw-r--r--src/network/ssl/qssl.cpp7
-rw-r--r--src/network/ssl/qssl.h4
-rw-r--r--src/network/ssl/qsslconfiguration.cpp4
-rw-r--r--src/network/ssl/qsslconfiguration_p.h2
-rw-r--r--src/network/ssl/qsslsocket.cpp32
-rw-r--r--src/network/ssl/qsslsocket.h3
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp32
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h4
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp14
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h4
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp1
-rw-r--r--tests/auto/qsslsocket/tst_qsslsocket.cpp166
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp2
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp2
-rw-r--r--tests/auto/qstringbuilder1/stringbuilder.cpp29
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp36
-rw-r--r--tools/qtconfig/colorbutton.cpp9
-rw-r--r--tools/qtconfig/main.cpp1
-rw-r--r--tools/qtconfig/mainwindow.cpp790
-rw-r--r--tools/qtconfig/mainwindow.h21
-rw-r--r--tools/qtconfig/mainwindow.ui (renamed from tools/qtconfig/mainwindowbase.ui)388
-rw-r--r--tools/qtconfig/mainwindowbase.cpp250
-rw-r--r--tools/qtconfig/mainwindowbase.h95
-rw-r--r--tools/qtconfig/paletteeditoradvanced.cpp579
-rw-r--r--tools/qtconfig/paletteeditoradvanced.h66
-rw-r--r--tools/qtconfig/paletteeditoradvanced.ui416
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.cpp144
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.h78
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.ui617
-rw-r--r--tools/qtconfig/previewframe.cpp18
-rw-r--r--tools/qtconfig/previewframe.h13
-rw-r--r--tools/qtconfig/previewwidget.cpp29
-rw-r--r--tools/qtconfig/previewwidget.h18
-rw-r--r--tools/qtconfig/previewwidget.ui252
-rw-r--r--tools/qtconfig/previewwidgetbase.cpp88
-rw-r--r--tools/qtconfig/previewwidgetbase.h68
-rw-r--r--tools/qtconfig/previewwidgetbase.ui340
-rw-r--r--tools/qtconfig/qtconfig.pro19
-rw-r--r--tools/tools.pro2
55 files changed, 1914 insertions, 2906 deletions
diff --git a/examples/phonon/phonon.pro b/examples/phonon/phonon.pro
index aa6ac13..c6a0bff 100644
--- a/examples/phonon/phonon.pro
+++ b/examples/phonon/phonon.pro
@@ -3,6 +3,9 @@ CONFIG += ordered
SUBDIRS = qmusicplayer \
capabilities
+# Disable capabilities example for symbian-gcce due to a bug in elf2e32.
+symbian-gcce:SUBDIRS -= capabilities
+
# install
target.path = $$[QT_INSTALL_EXAMPLES]/phonon
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS phonon.pro README
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 0df33d0..8455189 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1072,22 +1072,26 @@ void VcprojGenerator::initPreBuildEventTools()
void VcprojGenerator::initPostBuildEventTools()
{
VCConfiguration &conf = vcProject.Configuration;
- if(!project->values("QMAKE_POST_LINK").isEmpty()) {
+ if (!project->values("QMAKE_POST_LINK").isEmpty()) {
QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK"));
conf.postBuild.CommandLine = cmdline;
conf.postBuild.Description = cmdline.join(QLatin1String("\r\n"));
+ conf.postBuild.ExcludedFromBuild = _False;
}
QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE");
bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") &&
!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
- if(useSignature)
+ if (useSignature) {
conf.postBuild.CommandLine.prepend(
QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\""));
+ conf.postBuild.ExcludedFromBuild = _False;
+ }
- if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) {
+ if (!project->values("MSVCPROJ_COPY_DLL").isEmpty()) {
conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC");
conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL");
+ conf.postBuild.ExcludedFromBuild = _False;
}
}
@@ -1218,6 +1222,7 @@ void VcprojGenerator::initPreLinkEventTools()
QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK"));
conf.preLink.CommandLine = cmdline;
conf.preLink.Description = cmdline.join(QLatin1String("\r\n"));
+ conf.preLink.ExcludedFromBuild = _False;
}
}
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index cf44b49..78e49d5 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1685,7 +1685,7 @@ inline void qUnused(T &x) { (void)x; }
#endif
#ifndef qPrintable
-# define qPrintable(string) (string).toLocal8Bit().constData()
+# define qPrintable(string) QString(string).toLocal8Bit().constData()
#endif
Q_CORE_EXPORT void qDebug(const char *, ...) /* print debug message */
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index b630502..a5837cb 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -1264,6 +1264,7 @@ qint64 QTextStream::pos() const
return qint64(-1);
}
thatd->readBufferOffset = oldReadBufferOffset;
+ thatd->readConverterSavedStateOffset = 0;
// Return the device position.
return d->device->pos();
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index b281c1b..4799abd 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -687,12 +687,12 @@ QByteArray::Data QByteArray::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1),
values. To set all the bytes to a particular value, call fill().
To obtain a pointer to the actual character data, call data() or
- constData(). These functions return a pointer to the beginning of
- the data. The pointer is guaranteed to remain valid until a
- non-const function is called on the QByteArray. It is also
- guaranteed that the data ends with a '\\0' byte. This '\\0' byte
- is automatically provided by QByteArray and is not counted in
- size().
+ constData(). These functions return a pointer to the beginning of the data.
+ The pointer is guaranteed to remain valid until a non-const function is
+ called on the QByteArray. It is also guaranteed that the data ends with a
+ '\\0' byte unless the QByteArray was created from a \l{fromRawData()}{raw
+ data}. This '\\0' byte is automatically provided by QByteArray and is not
+ counted in size().
QByteArray provides the following basic functions for modifying
the byte data: append(), prepend(), insert(), replace(), and
@@ -925,11 +925,13 @@ QByteArray &QByteArray::operator=(const char *str)
Returns the number of bytes in this byte array.
- The last byte in the byte array is at position size() - 1. In
- addition, QByteArray ensures that the byte at position size() is
- always '\\0', so that you can use the return value of data() and
- constData() as arguments to functions that expect '\\0'-terminated
- strings.
+ The last byte in the byte array is at position size() - 1. In addition,
+ QByteArray ensures that the byte at position size() is always '\\0', so
+ that you can use the return value of data() and constData() as arguments to
+ functions that expect '\\0'-terminated strings. If the QByteArray object
+ was created from a \l{fromRawData()}{raw data} that didn't include the
+ trailing null-termination character then QByteArray doesn't add it
+ automaticall unless the \l{deep copy} is created.
Example:
\snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 6
@@ -1060,10 +1062,11 @@ QByteArray &QByteArray::operator=(const char *str)
/*! \fn const char *QByteArray::constData() const
- Returns a pointer to the data stored in the byte array. The
- pointer can be used to access the bytes that compose the array.
- The data is '\\0'-terminated. The pointer remains valid as long
- as the byte array isn't reallocated or destroyed.
+ Returns a pointer to the data stored in the byte array. The pointer can be
+ used to access the bytes that compose the array. The data is
+ '\\0'-terminated unless the QByteArray object was created from raw data.
+ The pointer remains valid as long as the byte array isn't reallocated or
+ destroyed.
This function is mostly useful to pass a byte array to a function
that accepts a \c{const char *}.
@@ -1072,7 +1075,7 @@ QByteArray &QByteArray::operator=(const char *str)
but most functions that take \c{char *} arguments assume that the
data ends at the first '\\0' they encounter.
- \sa data(), operator[]()
+ \sa data(), operator[](), fromRawData()
*/
/*! \fn void QByteArray::detach()
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 53368eb..7d75de7 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -150,8 +150,8 @@ QT_BEGIN_NAMESPACE
void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out)
{
#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings) {
- QString tmp = QString::fromAscii(a);
+ if (QString::codecForCStrings && len) {
+ QString tmp = QString::fromAscii(a, len > 0 ? len - 1 : -1);
memcpy(out, reinterpret_cast<const char *>(tmp.constData()), sizeof(QChar) * tmp.size());
out += tmp.length();
return;
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 8d9537c..d230d67 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -270,10 +270,11 @@ template <> struct QConcatenable<QByteArray> : private QAbstractConcatenable
{
typedef QByteArray type;
enum { ExactSize = false };
- static int size(const QByteArray &ba) { return qstrnlen(ba.constData(), ba.size()); }
+ static int size(const QByteArray &ba) { return ba.size(); }
static inline void appendTo(const QByteArray &ba, QChar *&out)
{
- QAbstractConcatenable::convertFromAscii(ba.constData(), -1, out);
+ // adding 1 because convertFromAscii expects the size including the null-termination
+ QAbstractConcatenable::convertFromAscii(ba.constData(), ba.size() + 1, out);
}
};
#endif
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 9a5a5f1..14a90ef 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3239,6 +3239,8 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
ReleaseIconRef(previousIcon);
#else
QMacCocoaAutoReleasePool pool;
+ if (icon.isNull())
+ return;
NSButton *iconButton = [qt_mac_window_for(q) standardWindowButton:NSWindowDocumentIconButton];
if (iconButton == nil) {
QCFString string(q->windowTitle());
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 4bff5ac..c6753fc 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -346,7 +346,7 @@ Q_GUI_EXPORT void qt_x11_enforce_cursor(QWidget * w)
qt_x11_enforce_cursor(w, false);
}
-Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
+void qt_x11_wait_for_window_manager(QWidget *w, bool sendPostedEvents)
{
if (!w || (!w->isWindow() && !w->internalWinId()))
return;
@@ -361,7 +361,8 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
WId winid = w->internalWinId();
// first deliver events that are already in the local queue
- QApplication::sendPostedEvents();
+ if (sendPostedEvents)
+ QApplication::sendPostedEvents();
// the normal sequence is:
// ... ConfigureNotify ... ReparentNotify ... MapNotify ... Expose
@@ -396,6 +397,11 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w)
} while(1);
}
+Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget *w)
+{
+ qt_x11_wait_for_window_manager(w, true);
+}
+
void qt_change_net_wm_state(const QWidget* w, bool set, Atom one, Atom two = 0)
{
if (!w->isVisible()) // not managed by the window manager
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 64722c7..2d21628 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3084,7 +3084,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
break;
case PE_PanelScrollAreaCorner: {
- const QBrush brush(qApp->palette().brush(QPalette::Base));
+ const QBrush brush(opt->palette.brush(QPalette::Base));
p->fillRect(opt->rect, brush);
p->setPen(QPen(QColor(217, 217, 217)));
p->drawLine(opt->rect.topLeft(), opt->rect.topRight());
diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp
index 2b7935b..5a0e179 100644
--- a/src/gui/util/qsystemtrayicon_win.cpp
+++ b/src/gui/util/qsystemtrayicon_win.cpp
@@ -305,6 +305,7 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result )
case WM_CONTEXTMENU:
if (q->contextMenu()) {
q->contextMenu()->popup(gpos);
+ q->contextMenu()->activateWindow();
}
emit q->activated(QSystemTrayIcon::Context);
break;
diff --git a/src/gui/widgets/qsplashscreen.cpp b/src/gui/widgets/qsplashscreen.cpp
index 75280cb..9c486bf 100644
--- a/src/gui/widgets/qsplashscreen.cpp
+++ b/src/gui/widgets/qsplashscreen.cpp
@@ -223,8 +223,8 @@ void QSplashScreen::finish(QWidget *mainWin)
{
if (mainWin) {
#if defined(Q_WS_X11)
- extern void qt_x11_wait_for_window_manager(QWidget *mainWin);
- qt_x11_wait_for_window_manager(mainWin);
+ extern void qt_x11_wait_for_window_manager(QWidget *mainWin, bool);
+ qt_x11_wait_for_window_manager(mainWin, false);
#endif
}
close();
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 3502113..29ae5b0 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -487,7 +487,7 @@ void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
}
-void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socket)
+bool QHttpNetworkConnectionPrivate::dequeueRequest(QAbstractSocket *socket)
{
Q_ASSERT(socket);
@@ -500,8 +500,7 @@ void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socke
prepareRequest(messagePair);
channels[i].request = messagePair.first;
channels[i].reply = messagePair.second;
- channels[i].sendRequest();
- return;
+ return true;
}
if (!lowPriorityQueue.isEmpty()) {
@@ -511,9 +510,9 @@ void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socke
prepareRequest(messagePair);
channels[i].request = messagePair.first;
channels[i].reply = messagePair.second;
- channels[i].sendRequest();
- return;
+ return true;
}
+ return false;
}
// this is called from _q_startNextRequest and when a request has been sent down a socket from the channel
@@ -765,7 +764,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
//resend the necessary ones.
for (int i = 0; i < channelCount; ++i) {
- if (channels[i].resendCurrent) {
+ if (channels[i].resendCurrent && (channels[i].state != QHttpNetworkConnectionChannel::ClosingState)) {
channels[i].resendCurrent = false;
channels[i].state = QHttpNetworkConnectionChannel::IdleState;
@@ -784,17 +783,8 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
// try to get a free AND connected socket
for (int i = 0; i < channelCount; ++i) {
if (!channels[i].reply && !channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) {
- dequeueAndSendRequest(channels[i].socket);
- }
- }
-
- // return fast if there is nothing to do
- if (highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty())
- return;
- // try to get a free unconnected socket
- for (int i = 0; i < channelCount; ++i) {
- if (!channels[i].reply && !channels[i].isSocketBusy()) {
- dequeueAndSendRequest(channels[i].socket);
+ if (dequeueRequest(channels[i].socket))
+ channels[i].sendRequest();
}
}
@@ -811,6 +801,21 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
for (int i = 0; i < channelCount; i++)
if (channels[i].socket->state() == QAbstractSocket::ConnectedState)
fillPipeline(channels[i].socket);
+
+ // If there is not already any connected channels we need to connect a new one.
+ // We do not pair the channel with the request until we know if it is
+ // connected or not. This is to reuse connected channels before we connect new once.
+ int queuedRequest = highPriorityQueue.count() + lowPriorityQueue.count();
+ for (int i = 0; i < channelCount; ++i) {
+ if (channels[i].socket->state() == QAbstractSocket::ConnectingState)
+ queuedRequest--;
+ if ( queuedRequest <=0 )
+ break;
+ if (!channels[i].reply && !channels[i].isSocketBusy() && (channels[i].socket->state() == QAbstractSocket::UnconnectedState)) {
+ channels[i].ensureConnection();
+ queuedRequest--;
+ }
+ }
}
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index d4748c1..874ea22 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -161,7 +161,7 @@ public:
QHttpNetworkReply *queueRequest(const QHttpNetworkRequest &request);
void requeueRequest(const HttpMessagePair &pair); // e.g. after pipeline broke
- void dequeueAndSendRequest(QAbstractSocket *socket);
+ bool dequeueRequest(QAbstractSocket *socket);
void prepareRequest(HttpMessagePair &request);
void fillPipeline(QAbstractSocket *socket);
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 41bc64a..23dd518 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -145,10 +145,12 @@ void QHttpNetworkConnectionChannel::init()
void QHttpNetworkConnectionChannel::close()
{
- socket->blockSignals(true);
+ if (socket->state() == QAbstractSocket::UnconnectedState)
+ state = QHttpNetworkConnectionChannel::IdleState;
+ else
+ state = QHttpNetworkConnectionChannel::ClosingState;
+
socket->close();
- socket->blockSignals(false);
- state = QHttpNetworkConnectionChannel::IdleState;
}
@@ -500,6 +502,7 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
// called when unexpectedly reading a -1 or when data is expected but socket is closed
void QHttpNetworkConnectionChannel::handleUnexpectedEOF()
{
+ Q_ASSERT(reply);
if (reconnectAttempts <= 0) {
// too many errors reading/receiving/parsing the status, close the socket and emit error
requeueCurrentlyPipelinedRequests();
@@ -522,7 +525,8 @@ bool QHttpNetworkConnectionChannel::ensureConnection()
// resend this request after we receive the disconnected signal
if (socketState == QAbstractSocket::ClosingState) {
- resendCurrent = true;
+ if (reply)
+ resendCurrent = true;
return false;
}
@@ -644,6 +648,7 @@ bool QHttpNetworkConnectionChannel::expand(bool dataComplete)
void QHttpNetworkConnectionChannel::allDone()
{
+ Q_ASSERT(reply);
#ifndef QT_NO_COMPRESS
// expand the whole data.
if (reply->d_func()->expectContent() && reply->d_func()->autoDecompress && !reply->d_func()->streamEnd) {
@@ -679,7 +684,8 @@ void QHttpNetworkConnectionChannel::allDone()
reconnectAttempts = 2;
// now the channel can be seen as free/idle again, all signal emissions for the reply have been done
- this->state = QHttpNetworkConnectionChannel::IdleState;
+ if (state != QHttpNetworkConnectionChannel::ClosingState)
+ state = QHttpNetworkConnectionChannel::IdleState;
// if it does not need to be sent again we can set it to 0
// the previous code did not do that and we had problems with accidental re-sending of a
@@ -729,7 +735,8 @@ void QHttpNetworkConnectionChannel::allDone()
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
} else if (alreadyPipelinedRequests.isEmpty()) {
if (connectionCloseEnabled)
- close();
+ if (socket->state() != QAbstractSocket::UnconnectedState)
+ close();
if (qobject_cast<QHttpNetworkConnection*>(connection))
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
@@ -737,6 +744,7 @@ void QHttpNetworkConnectionChannel::allDone()
void QHttpNetworkConnectionChannel::detectPipeliningSupport()
{
+ Q_ASSERT(reply);
// detect HTTP Pipelining support
QByteArray serverHeaderField;
if (
@@ -820,6 +828,7 @@ void QHttpNetworkConnectionChannel::handleStatus()
bool QHttpNetworkConnectionChannel::resetUploadData()
{
+ Q_ASSERT(reply);
QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();
if (!uploadByteDevice)
return true;
@@ -877,7 +886,8 @@ void QHttpNetworkConnectionChannel::closeAndResendCurrentRequest()
{
requeueCurrentlyPipelinedRequests();
close();
- resendCurrent = true;
+ if (reply)
+ resendCurrent = true;
if (qobject_cast<QHttpNetworkConnection*>(connection))
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
@@ -936,6 +946,12 @@ void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes)
void QHttpNetworkConnectionChannel::_q_disconnected()
{
+ if (state == QHttpNetworkConnectionChannel::ClosingState) {
+ state = QHttpNetworkConnectionChannel::IdleState;
+ QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ return;
+ }
+
// read the available data before closing
if (isSocketWaiting() || isSocketReading()) {
if (reply) {
@@ -973,10 +989,10 @@ void QHttpNetworkConnectionChannel::_q_connected()
//channels[i].reconnectAttempts = 2;
if (!pendingEncrypt) {
state = QHttpNetworkConnectionChannel::IdleState;
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
if (reply)
sendRequest();
- else
- close();
}
}
@@ -1030,6 +1046,9 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
QPointer<QHttpNetworkConnection> that = connection;
QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString());
+ // Need to dequeu the request so that we can emit the error.
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
if (reply) {
reply->d_func()->errorString = errorString;
emit reply->finishedWithError(errorCode, errorString);
@@ -1044,7 +1063,11 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
#ifndef QT_NO_NETWORKPROXY
void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth)
{
- connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
+ // Need to dequeue the request before we can emit the error.
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
+ if (reply)
+ connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
}
#endif
@@ -1060,7 +1083,10 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
return; // ### error
state = QHttpNetworkConnectionChannel::IdleState;
pendingEncrypt = false;
- sendRequest();
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
+ if (reply)
+ sendRequest();
}
void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors)
@@ -1071,7 +1097,10 @@ void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors)
// Also pause the connection because socket notifiers may fire while an user
// dialog is displaying
connection->d_func()->pauseConnection();
- emit reply->sslErrors(errors);
+ if (pendingEncrypt && !reply)
+ connection->d_func()->dequeueRequest(socket);
+ if (reply)
+ emit reply->sslErrors(errors);
connection->d_func()->resumeConnection();
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 8cbc689..893d75e 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -95,7 +95,8 @@ public:
WritingState = 2, // writing the data
WaitingState = 4, // waiting for reply
ReadingState = 8, // reading the reply
- BusyState = (ConnectingState|WritingState|WaitingState|ReadingState)
+ ClosingState = 16,
+ BusyState = (ConnectingState|WritingState|WaitingState|ReadingState|ClosingState)
};
QAbstractSocket *socket;
bool ssl;
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index e9e7d21..5594296 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -101,12 +101,17 @@ QT_BEGIN_NAMESPACE
Describes the protocol of the cipher.
- \value SslV3 SSLv3 - the default protocol.
+ \value SslV3 SSLv3
\value SslV2 SSLv2
\value TlsV1 TLSv1
\value UnknownProtocol The cipher's protocol cannot be determined.
\value AnyProtocol The socket understands SSLv2, SSLv3, and TLSv1. This
value is used by QSslSocket only.
+ \value TlsV1SslV3 On the client side, this will send
+ a TLS 1.0 Client Hello, enabling TLSv1 and SSLv3 connections.
+ On the server side, this will enable both SSLv3 and TLSv1 connections.
+ \value SecureProtocols The default option, using protocols known to be secure;
+ currently behaves like TlsV1SslV3.
Note: most servers using SSL understand both versions (2 and 3),
but it is recommended to use the latest version only for security
diff --git a/src/network/ssl/qssl.h b/src/network/ssl/qssl.h
index 4c035fd..24dbb09 100644
--- a/src/network/ssl/qssl.h
+++ b/src/network/ssl/qssl.h
@@ -75,8 +75,10 @@ namespace QSsl {
enum SslProtocol {
SslV3,
SslV2,
- TlsV1,
+ TlsV1, // ### Qt 5: rename to TlsV1_0 or so
AnyProtocol,
+ TlsV1SslV3,
+ SecureProtocols,
UnknownProtocol = -1
};
}
diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp
index 3592226..150f77e 100644
--- a/src/network/ssl/qsslconfiguration.cpp
+++ b/src/network/ssl/qsslconfiguration.cpp
@@ -213,7 +213,7 @@ bool QSslConfiguration::isNull() const
*/
QSsl::SslProtocol QSslConfiguration::protocol() const
{
- return d ? d->protocol : QSsl::SslV3;
+ return d ? d->protocol : QSsl::SecureProtocols;
}
/*!
@@ -518,7 +518,7 @@ void QSslConfiguration::setCaCertificates(const QList<QSslCertificate> &certific
\list
\o no local certificate and no private key
- \o protocol SSLv3
+ \o protocol SecureProtocols (meaning either TLS 1.0 or SSL 3 will be used)
\o the system's default CA certificate list
\o the cipher list equal to the list of the SSL libraries'
supported SSL ciphers
diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h
index b039e69..a5af51a 100644
--- a/src/network/ssl/qsslconfiguration_p.h
+++ b/src/network/ssl/qsslconfiguration_p.h
@@ -80,7 +80,7 @@ class QSslConfigurationPrivate: public QSharedData
{
public:
QSslConfigurationPrivate()
- : protocol(QSsl::SslV3),
+ : protocol(QSsl::SecureProtocols),
peerVerifyMode(QSslSocket::AutoVerifyPeer),
peerVerifyDepth(0)
{ }
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 61f27fe..98e2dc5 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -56,7 +56,7 @@
QSslSocket establishes a secure, encrypted TCP connection you can
use for transmitting encrypted data. It can operate in both client
and server mode, and it supports modern SSL protocols, including
- SSLv3 and TLSv1. By default, QSslSocket uses SSLv3, but you can
+ SSLv3 and TLSv1. By default, QSslSocket uses TLSv1, but you can
change the SSL protocol by calling setProtocol() as long as you do
it before the handshake has started.
@@ -552,7 +552,7 @@ bool QSslSocket::isEncrypted() const
}
/*!
- Returns the socket's SSL protocol. By default, \l QSsl::SslV3 is used.
+ Returns the socket's SSL protocol. By default, \l QSsl::SecureProtocols is used.
\sa setProtocol()
*/
@@ -659,6 +659,34 @@ void QSslSocket::setPeerVerifyDepth(int depth)
}
/*!
+ \since 4.8
+
+ Returns the different hostname for the certificate validation, as set by
+ setPeerVerifyName or by connectToHostEncrypted.
+
+ \sa setPeerVerifyName(), connectToHostEncrypted()
+*/
+QString QSslSocket::peerVerifyName() const
+{
+ Q_D(const QSslSocket);
+ return d->verificationPeerName;
+}
+
+/*!
+ \since 4.8
+
+ Sets a different hostname for the certificate validation instead of the one used for the TCP
+ connection.
+
+ \sa connectToHostEncrypted()
+*/
+void QSslSocket::setPeerVerifyName(const QString &hostName)
+{
+ Q_D(QSslSocket);
+ d->verificationPeerName = hostName;
+}
+
+/*!
\reimp
Returns the number of decrypted bytes that are immediately available for
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 703a1fb..648fd8c 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -106,6 +106,9 @@ public:
int peerVerifyDepth() const;
void setPeerVerifyDepth(int depth);
+ QString peerVerifyName() const;
+ void setPeerVerifyName(const QString &hostName);
+
// From QIODevice
qint64 bytesAvailable() const;
qint64 bytesToWrite() const;
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 83714ed..3d7612a 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -60,6 +60,12 @@
#include <QtCore/qvarlengtharray.h>
#include <QLibrary> // for loading the security lib for the CA store
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+// Symbian does not seem to have the symbol for SNI defined
+#ifndef SSL_CTRL_SET_TLSEXT_HOSTNAME
+#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
+#endif
+#endif
QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC)
@@ -253,6 +259,8 @@ init_context:
case QSsl::SslV3:
ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
break;
+ case QSsl::SecureProtocols: // SslV2 will be disabled below
+ case QSsl::TlsV1SslV3: // SslV2 will be disabled below
case QSsl::AnyProtocol:
default:
ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
@@ -278,7 +286,11 @@ init_context:
}
// Enable all bug workarounds.
- q_SSL_CTX_set_options(ctx, SSL_OP_ALL);
+ if (configuration.protocol == QSsl::TlsV1SslV3 || configuration.protocol == QSsl::SecureProtocols) {
+ q_SSL_CTX_set_options(ctx, SSL_OP_ALL|SSL_OP_NO_SSLv2);
+ } else {
+ q_SSL_CTX_set_options(ctx, SSL_OP_ALL);
+ }
// Initialize ciphers
QByteArray cipherString;
@@ -386,6 +398,24 @@ init_context:
return false;
}
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+ if ((configuration.protocol == QSsl::TlsV1SslV3 ||
+ configuration.protocol == QSsl::TlsV1 ||
+ configuration.protocol == QSsl::SecureProtocols ||
+ configuration.protocol == QSsl::AnyProtocol) &&
+ client && q_SSLeay() >= 0x00090806fL) {
+ // Set server hostname on TLS extension. RFC4366 section 3.1 requires it in ACE format.
+ QString tlsHostName = verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName;
+ if (tlsHostName.isEmpty())
+ tlsHostName = hostName;
+ QByteArray ace = QUrl::toAce(tlsHostName);
+ if (!ace.isEmpty()) {
+ if (!q_SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, ace.constData()))
+ qWarning("could not set SSL_CTRL_SET_TLSEXT_HOSTNAME, Server Name Indication disabled");
+ }
+ }
+#endif
+
// Clear the session.
q_SSL_clear(ssl);
errorList.clear();
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index 5a7963e..ca49fab 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -79,6 +79,10 @@
#include <openssl/x509_vfy.h>
#include <openssl/dsa.h>
#include <openssl/rsa.h>
+#include <openssl/crypto.h>
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+#include <openssl/tls1.h>
+#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
typedef _STACK STACK;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index b9a05f3..b1310cc 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -208,6 +208,9 @@ DEFINEFUNC(long, SSL_get_verify_result, SSL *a, a, return -1, return)
DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return 0, return)
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+DEFINEFUNC4(long, SSL_ctrl, SSL *a, a, int cmd, cmd, long larg, larg, const void *parg, parg, return -1, return)
+#endif
DEFINEFUNC3(int, SSL_read, SSL *a, a, void *b, b, int c, c, return -1, return)
DEFINEFUNC3(void, SSL_set_bio, SSL *a, a, BIO *b, b, BIO *c, c, return, DUMMYARG)
DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG)
@@ -263,6 +266,7 @@ DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c,
DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
+DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
#ifdef Q_OS_SYMBIAN
#define RESOLVEFUNC(func, ordinal, lib) \
@@ -586,6 +590,9 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSL_library_init, 137, libs.first )
RESOLVEFUNC(SSL_load_error_strings, 139, libs.first )
RESOLVEFUNC(SSL_new, 140, libs.first )
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+ RESOLVEFUNC(SSL_ctrl, 95, libs.first )
+#endif
RESOLVEFUNC(SSL_read, 143, libs.first )
RESOLVEFUNC(SSL_set_accept_state, 148, libs.first )
RESOLVEFUNC(SSL_set_bio, 149, libs.first )
@@ -600,6 +607,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSLv3_server_method, 197, libs.first )
RESOLVEFUNC(SSLv23_server_method, 191, libs.first )
RESOLVEFUNC(TLSv1_server_method, 200, libs.first )
+ RESOLVEFUNC(SSL_CTX_load_verify_locations, 34, libs.first )
RESOLVEFUNC(X509_NAME_oneline, 1830, libs.second )
RESOLVEFUNC(X509_PUBKEY_get, 1844, libs.second )
RESOLVEFUNC(X509_STORE_free, 1939, libs.second )
@@ -631,7 +639,7 @@ bool q_resolveOpenSslSymbols()
#endif
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf, 1153, libs.second )
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf, 1152, libs.second )
- RESOLVEFUNC(SSL_CTX_load_verify_locations, 34, libs.second )
+ RESOLVEFUNC(SSLeay, 1504, libs.second )
#else // Q_OS_SYMBIAN
#ifdef SSLEAY_MACROS
RESOLVEFUNC(ASN1_dup)
@@ -711,6 +719,9 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(SSL_library_init)
RESOLVEFUNC(SSL_load_error_strings)
RESOLVEFUNC(SSL_new)
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+ RESOLVEFUNC(SSL_ctrl)
+#endif
RESOLVEFUNC(SSL_read)
RESOLVEFUNC(SSL_set_accept_state)
RESOLVEFUNC(SSL_set_bio)
@@ -757,6 +768,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
RESOLVEFUNC(SSL_CTX_load_verify_locations)
+ RESOLVEFUNC(SSLeay)
#endif // Q_OS_SYMBIAN
symbolsResolved = true;
delete libs.first;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index c05dfe11..49830ac 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -316,6 +316,9 @@ long q_SSL_get_verify_result(SSL *a);
int q_SSL_library_init();
void q_SSL_load_error_strings();
SSL *q_SSL_new(SSL_CTX *a);
+#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
+long q_SSL_ctrl(SSL *ssl,int cmd, long larg, const void *parg);
+#endif
int q_SSL_read(SSL *a, void *b, int c);
void q_SSL_set_bio(SSL *a, BIO *b, BIO *c);
void q_SSL_set_accept_state(SSL *a);
@@ -413,6 +416,7 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
void q_OPENSSL_add_all_algorithms_noconf();
void q_OPENSSL_add_all_algorithms_conf();
int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
+long q_SSLeay();
// Helper function
class QDateTime;
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 93e3051..a7e6f9f 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -498,7 +498,6 @@ public slots:
if (doClose && client->bytesToWrite() == 0) {
client->disconnectFromHost();
disconnect(client, 0, this, 0);
- client = 0;
}
}
};
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 739f902..ef5833ef 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -66,6 +66,7 @@ Q_DECLARE_METATYPE(QSslSocket::SslMode)
typedef QList<QSslError::SslError> SslErrorList;
Q_DECLARE_METATYPE(SslErrorList)
Q_DECLARE_METATYPE(QSslError)
+Q_DECLARE_METATYPE(QSsl::SslProtocol)
#endif
#if defined Q_OS_HPUX && defined Q_CC_GNU
@@ -145,10 +146,11 @@ private slots:
void peerCertificateChain();
void privateKey();
void protocol();
+ void protocolServerSide_data();
+ void protocolServerSide();
void setCaCertificates();
void setLocalCertificate();
void setPrivateKey();
- void setProtocol();
void setSocketDescriptor();
void waitForEncrypted();
void waitForConnectedEncryptedReadyRead();
@@ -385,7 +387,7 @@ void tst_QSslSocket::constructing()
QVERIFY(!socket.waitForConnected(10));
QTest::ignoreMessage(QtWarningMsg, "QSslSocket::waitForDisconnected() is not allowed in UnconnectedState");
QVERIFY(!socket.waitForDisconnected(10));
- QCOMPARE(socket.protocol(), QSsl::SslV3);
+ QCOMPARE(socket.protocol(), QSsl::SecureProtocols);
QSslConfiguration savedDefault = QSslConfiguration::defaultConfiguration();
@@ -763,15 +765,13 @@ void tst_QSslSocket::protocol()
this->socket = socket;
QList<QSslCertificate> certs = QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem");
-// qDebug() << "certs:" << certs.at(0).issuerInfo(QSslCertificate::CommonName);
socket->setCaCertificates(certs);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
-// qDebug() << "socket cert:" << socket->caCertificates().at(0).issuerInfo(QSslCertificate::CommonName);
- QCOMPARE(socket->protocol(), QSsl::SslV3);
+ QCOMPARE(socket->protocol(), QSsl::SecureProtocols);
{
// Fluke allows SSLv3.
socket->setProtocol(QSsl::SslV3);
@@ -835,44 +835,36 @@ void tst_QSslSocket::protocol()
QCOMPARE(socket->protocol(), QSsl::AnyProtocol);
socket->abort();
}
-}
-
-void tst_QSslSocket::setCaCertificates()
-{
- if (!QSslSocket::supportsSsl())
- return;
-
- QSslSocket socket;
- QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
- socket.setCaCertificates(QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem"));
- QCOMPARE(socket.caCertificates().size(), 1);
- socket.setCaCertificates(socket.defaultCaCertificates());
- QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
-}
-
-void tst_QSslSocket::setLocalCertificate()
-{
-}
-
-void tst_QSslSocket::setPrivateKey()
-{
-}
-
-void tst_QSslSocket::setProtocol()
-{
+ {
+ // Fluke allows SSLV3, so it allows NoSslV2
+ socket->setProtocol(QSsl::TlsV1SslV3);
+ QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
+ socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ QVERIFY(socket->waitForEncrypted());
+ QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
+ socket->abort();
+ QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
+ socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
+ socket->startClientEncryption();
+ QVERIFY2(socket->waitForEncrypted(), qPrintable(socket->errorString()));
+ QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
+ socket->abort();
+ }
}
class SslServer : public QTcpServer
{
Q_OBJECT
public:
- SslServer() : socket(0) { }
+ SslServer() : socket(0), protocol(QSsl::TlsV1) { }
QSslSocket *socket;
-
+ QSsl::SslProtocol protocol;
protected:
void incomingConnection(int socketDescriptor)
{
socket = new QSslSocket(this);
+ socket->setProtocol(protocol);
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
QFile file(SRCDIR "certs/fluke.key");
@@ -902,6 +894,116 @@ protected slots:
}
};
+void tst_QSslSocket::protocolServerSide_data()
+{
+
+ QTest::addColumn<QSsl::SslProtocol>("serverProtocol");
+ QTest::addColumn<QSsl::SslProtocol>("clientProtocol");
+ QTest::addColumn<bool>("works");
+
+ QTest::newRow("ssl2-ssl2") << QSsl::SslV2 << QSsl::SslV2 << false; // no idea why it does not work, but we don't care about SSL 2
+ QTest::newRow("ssl3-ssl3") << QSsl::SslV3 << QSsl::SslV3 << true;
+ QTest::newRow("tls1-tls1") << QSsl::TlsV1 << QSsl::TlsV1 << true;
+ QTest::newRow("tls1ssl3-tls1ssl3") << QSsl::TlsV1SslV3 << QSsl::TlsV1SslV3 << true;
+ QTest::newRow("any-any") << QSsl::AnyProtocol << QSsl::AnyProtocol << true;
+ QTest::newRow("secure-secure") << QSsl::SecureProtocols << QSsl::SecureProtocols << true;
+
+ QTest::newRow("ssl2-ssl3") << QSsl::SslV2 << QSsl::SslV3 << false;
+ QTest::newRow("ssl2-tls1") << QSsl::SslV2 << QSsl::TlsV1 << false;
+ QTest::newRow("ssl2-tls1ssl3") << QSsl::SslV2 << QSsl::TlsV1SslV3 << false;
+ QTest::newRow("ssl2-secure") << QSsl::SslV2 << QSsl::SecureProtocols << false;
+ QTest::newRow("ssl2-any") << QSsl::SslV2 << QSsl::AnyProtocol << false; // no idea why it does not work, but we don't care about SSL 2
+
+ QTest::newRow("ssl3-ssl2") << QSsl::SslV3 << QSsl::SslV2 << false;
+ QTest::newRow("ssl3-tls1") << QSsl::SslV3 << QSsl::TlsV1 << false;
+ QTest::newRow("ssl3-tls1ssl3") << QSsl::SslV3 << QSsl::TlsV1SslV3 << true;
+ QTest::newRow("ssl3-secure") << QSsl::SslV3 << QSsl::SecureProtocols << true;
+ QTest::newRow("ssl3-any") << QSsl::SslV3 << QSsl::AnyProtocol << true;
+
+ QTest::newRow("tls1-ssl2") << QSsl::TlsV1 << QSsl::SslV2 << false;
+ QTest::newRow("tls1-ssl3") << QSsl::TlsV1 << QSsl::SslV3 << false;
+ QTest::newRow("tls1-tls1ssl3") << QSsl::TlsV1 << QSsl::TlsV1SslV3 << true;
+ QTest::newRow("tls1-secure") << QSsl::TlsV1 << QSsl::SecureProtocols << true;
+ QTest::newRow("tls1-any") << QSsl::TlsV1 << QSsl::AnyProtocol << true;
+
+ QTest::newRow("tls1ssl3-ssl2") << QSsl::TlsV1SslV3 << QSsl::SslV2 << false;
+ QTest::newRow("tls1ssl3-ssl3") << QSsl::TlsV1SslV3 << QSsl::SslV3 << true;
+ QTest::newRow("tls1ssl3-tls1") << QSsl::TlsV1SslV3 << QSsl::TlsV1 << true;
+ QTest::newRow("tls1ssl3-secure") << QSsl::TlsV1SslV3 << QSsl::SecureProtocols << true;
+ QTest::newRow("tls1ssl3-any") << QSsl::TlsV1SslV3 << QSsl::AnyProtocol << true;
+
+ QTest::newRow("secure-ssl2") << QSsl::SecureProtocols << QSsl::SslV2 << false;
+ QTest::newRow("secure-ssl3") << QSsl::SecureProtocols << QSsl::SslV3 << true;
+ QTest::newRow("secure-tls1") << QSsl::SecureProtocols << QSsl::TlsV1 << true;
+ QTest::newRow("secure-tls1ssl3") << QSsl::SecureProtocols << QSsl::TlsV1SslV3 << true;
+ QTest::newRow("secure-any") << QSsl::SecureProtocols << QSsl::AnyProtocol << true;
+
+ QTest::newRow("any-ssl2") << QSsl::AnyProtocol << QSsl::SslV2 << false; // no idea why it does not work, but we don't care about SSL 2
+ QTest::newRow("any-ssl3") << QSsl::AnyProtocol << QSsl::SslV3 << true;
+ QTest::newRow("any-tls1") << QSsl::AnyProtocol << QSsl::TlsV1 << true;
+ QTest::newRow("any-tls1ssl3") << QSsl::AnyProtocol << QSsl::TlsV1SslV3 << true;
+ QTest::newRow("any-secure") << QSsl::AnyProtocol << QSsl::SecureProtocols << true;
+}
+
+void tst_QSslSocket::protocolServerSide()
+{
+ if (!QSslSocket::supportsSsl()) {
+ qWarning("SSL not supported, skipping test");
+ return;
+ }
+
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ QFETCH(QSsl::SslProtocol, serverProtocol);
+ SslServer server;
+ server.protocol = serverProtocol;
+ QVERIFY(server.listen());
+
+ QEventLoop loop;
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
+
+ QSslSocketPtr client = new QSslSocket;
+ socket = client;
+ QFETCH(QSsl::SslProtocol, clientProtocol);
+ socket->setProtocol(clientProtocol);
+ // upon SSL wrong version error, error will be triggered, not sslErrors
+ connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
+ connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
+ connect(client, SIGNAL(encrypted()), &loop, SLOT(quit()));
+
+ client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+
+ loop.exec();
+
+ QFETCH(bool, works);
+ QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState;
+ QCOMPARE(client->state(), expectedState);
+ QCOMPARE(client->isEncrypted(), works);
+}
+
+void tst_QSslSocket::setCaCertificates()
+{
+ if (!QSslSocket::supportsSsl())
+ return;
+
+ QSslSocket socket;
+ QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
+ socket.setCaCertificates(QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem"));
+ QCOMPARE(socket.caCertificates().size(), 1);
+ socket.setCaCertificates(socket.defaultCaCertificates());
+ QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
+}
+
+void tst_QSslSocket::setLocalCertificate()
+{
+}
+
+void tst_QSslSocket::setPrivateKey()
+{
+}
+
void tst_QSslSocket::setSocketDescriptor()
{
if (!QSslSocket::supportsSsl())
diff --git a/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
index 2a1358d..abdd550 100644
--- a/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
+++ b/tests/auto/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
@@ -209,7 +209,7 @@ void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMe
QSslSocketPtr socket = newSocket();
this->socket = socket;
socket->connectToHostEncrypted(host, 443);
- QVERIFY(socket->waitForEncrypted());
+ QVERIFY2(socket->waitForEncrypted(), qPrintable(socket->errorString()));
// not using any root certs again -> should not work
QSslSocketPtr socket3 = newSocket();
diff --git a/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
index 8259977..5003b5c 100644
--- a/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
+++ b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -210,7 +210,7 @@ void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMe
QSslSocketPtr socket2 = newSocket();
this->socket = socket2;
socket2->connectToHostEncrypted(host, 443);
- QVERIFY(socket2->waitForEncrypted());
+ QVERIFY2(socket2->waitForEncrypted(), qPrintable(socket2->errorString()));
// not using any root certs again -> should not work
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp
index b4f6334..f3c0ea9 100644
--- a/tests/auto/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/qstringbuilder1/stringbuilder.cpp
@@ -40,9 +40,13 @@
****************************************************************************/
#define LITERAL "some literal"
+#define LITERAL_LEN (sizeof(LITERAL)-1)
+#define LITERAL_EXTRA "some literal" "EXTRA"
// "some literal", but replacing all vocals by their umlauted UTF-8 string :)
#define UTF8_LITERAL "s\xc3\xb6m\xc3\xab l\xc3\xaft\xc3\xabr\xc3\xa4l"
+#define UTF8_LITERAL_LEN (sizeof(UTF8_LITERAL)-1)
+#define UTF8_LITERAL_EXTRA "s\xc3\xb6m\xc3\xab l\xc3\xaft\xc3\xabr\xc3\xa4l" "EXTRA"
//fix for gcc4.0: if the operator+ does not exist without QT_USE_FAST_OPERATOR_PLUS
@@ -65,7 +69,6 @@ void runScenario()
QLatin1Char achar('c');
QString r2(QLatin1String(LITERAL LITERAL));
QString r;
- QByteArray ba(LITERAL);
r = l1literal Q l1literal;
QCOMPARE(r, r2);
@@ -86,6 +89,15 @@ void runScenario()
QCOMPARE(r, r2);
r = LITERAL P string;
QCOMPARE(r, r2);
+
+ QByteArray ba = QByteArray(LITERAL);
+ r = ba P string;
+ QCOMPARE(r, r2);
+ r = string P ba;
+ QCOMPARE(r, r2);
+
+ static const char badata[] = LITERAL_EXTRA;
+ ba = QByteArray::fromRawData(badata, LITERAL_LEN);
r = ba P string;
QCOMPARE(r, r2);
r = string P ba;
@@ -109,5 +121,20 @@ void runScenario()
QCOMPARE(r, r2);
r = string P ba;
QCOMPARE(r, r2);
+
+ ba = QByteArray::fromRawData(UTF8_LITERAL_EXTRA, UTF8_LITERAL_LEN);
+ r = ba P string;
+ QCOMPARE(r, r2);
+ r = string P ba;
+ QCOMPARE(r, r2);
+
+ ba = QByteArray(); // empty
+ r = ba P string;
+ QCOMPARE(r, string);
+ r = string P ba;
+ QCOMPARE(r, string);
#endif
+
+ string = QString::fromLatin1(LITERAL);
+ QCOMPARE(QByteArray(qPrintable(string P string)), QByteArray(string.toLatin1() + string.toLatin1()));
}
diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp
index 99f2556..2d7c24d 100644
--- a/tests/auto/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/qtextstream/tst_qtextstream.cpp
@@ -208,6 +208,7 @@ private slots:
void seek();
void pos();
void pos2();
+ void pos3LargeFile();
void readStdin();
void readAllFromStdin();
void readLineFromStdin();
@@ -1502,6 +1503,41 @@ void tst_QTextStream::pos2()
}
// ------------------------------------------------------------------------------
+void tst_QTextStream::pos3LargeFile()
+{
+ {
+ QFile file(TestFileName);
+ file.open(QIODevice::WriteOnly | QIODevice::Text);
+ QTextStream out( &file );
+ // NOTE: The unusual spacing is to ensure non-1-character whitespace.
+ QString lineString = " 0 1 2\t3 4\t \t5 6 7 8 9 \n";
+ // Approximate 50kb text file
+ const int NbLines = (50*1024) / lineString.length() + 1;
+ for (int line = 0; line < NbLines; ++line)
+ out << lineString;
+ // File is automatically flushed and closed on destruction.
+ }
+ QFile file(TestFileName);
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
+ QTextStream in( &file );
+ const int testValues[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ int value;
+ while (true) {
+ in.pos();
+ for ( int i = 0; i < 10; ++i ) {
+ in >> value;
+ if (in.status() != QTextStream::Ok) {
+ // End case, i == 0 && eof reached.
+ QCOMPARE(i, 0);
+ QCOMPARE(in.status(), QTextStream::ReadPastEnd);
+ return;
+ }
+ QCOMPARE(value, testValues[i]);
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------
void tst_QTextStream::readStdin()
{
#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
diff --git a/tools/qtconfig/colorbutton.cpp b/tools/qtconfig/colorbutton.cpp
index 1a98897..33c1b25 100644
--- a/tools/qtconfig/colorbutton.cpp
+++ b/tools/qtconfig/colorbutton.cpp
@@ -52,19 +52,20 @@
QT_BEGIN_NAMESPACE
ColorButton::ColorButton(QWidget *parent)
- : QAbstractButton(parent), mousepressed(false)
+ : QAbstractButton(parent)
+ , col(Qt::black)
+ , mousepressed(false)
{
setAcceptDrops(true);
- col = Qt::black;
connect(this, SIGNAL(clicked()), SLOT(changeColor()));
}
ColorButton::ColorButton(const QColor &c, QWidget *parent)
: QAbstractButton(parent)
+ , col(c)
{
setAcceptDrops(true);
- col = c;
connect(this, SIGNAL(clicked()), SLOT(changeColor()));
}
@@ -182,7 +183,7 @@ void ColorButton::mouseReleaseEvent(QMouseEvent *e)
void ColorButton::mouseMoveEvent(QMouseEvent *e)
{
- if (! mousepressed)
+ if (!mousepressed)
return;
if ((presspos - e->pos()).manhattanLength() > QApplication::startDragDistance()) {
diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp
index 3c17511..38435d9 100644
--- a/tools/qtconfig/main.cpp
+++ b/tools/qtconfig/main.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
-#include "ui_previewwidgetbase.h"
#include "mainwindow.h"
#include <QApplication>
#include <QLibraryInfo>
diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp
index 5dd321e..059adb3 100644
--- a/tools/qtconfig/mainwindow.cpp
+++ b/tools/qtconfig/mainwindow.cpp
@@ -40,6 +40,8 @@
****************************************************************************/
#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
#include "colorbutton.h"
#include "previewframe.h"
#include "paletteeditoradvanced.h"
@@ -59,7 +61,6 @@
#include <QMessageBox>
#include <QStyle>
#include <QtEvents>
-#include <Q3ValueList>
#include <QInputContext>
#include <QInputContextFactory>
#include <QtDebug>
@@ -155,36 +156,20 @@ static const char *phonon_text = QT_TRANSLATE_NOOP("MainWindow",
"<p>It is reccommended to leave all settings on \"Auto\" to let "
"Phonon determine your settings automatically.");
-static QColorGroup::ColorRole centralFromItem( int item )
-{
- switch( item ) {
- case 0: return QColorGroup::Window;
- case 1: return QColorGroup::WindowText;
- 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 )
+QPalette::ColorGroup MainWindow::groupFromIndex(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;
+ 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();
@@ -196,100 +181,141 @@ static void setStyleHelper(QWidget *w, QStyle *s)
w->setStyle(s);
}
-
MainWindow::MainWindow()
- : MainWindowBase(0, "main window"),
- editPalette(palette()), previewPalette(palette()), previewstyle(0)
-{
+ : 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->audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
+ connect(ui->videomodeCombo, 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)");
- setIcon(QPixmap(":/trolltech/qtconfig/images/appicon.png"));
+ setWindowIcon(QPixmap(":/trolltech/qtconfig/images/appicon.png"));
QStringList gstyles = QStyleFactory::keys();
gstyles.sort();
- gstylecombo->addItem(desktopThemeName);
- gstylecombo->setItemData(gstylecombo->findText(desktopThemeName),
- tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole);
- gstylecombo->insertStringList(gstyles);
+ 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("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
QString currentstyle = settings.value(QLatin1String("style")).toString();
if (currentstyle.isEmpty()) {
- gstylecombo->setCurrentItem(gstylecombo->findText(desktopThemeName));
- currentstyle = QLatin1String(QApplication::style()->name());
+ ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName));
+ currentstyle = QApplication::style()->objectName();
} else {
- int index = gstylecombo->findText(currentstyle, Qt::MatchFixedString);
+ int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString);
if (index != -1) {
- gstylecombo->setCurrentItem(index);
+ ui->guiStyleCombo->setCurrentIndex(index);
} else { // we give up
- gstylecombo->insertItem(QLatin1String("Unknown"));
- gstylecombo->setCurrentItem(gstylecombo->count() - 1);
+ ui->guiStyleCombo->addItem(tr("Unknown"));
+ ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1);
}
}
- buttonMainColor->setColor(palette().color(QPalette::Active,
- QColorGroup::Button));
- buttonMainColor2->setColor(palette().color(QPalette::Active,
- QColorGroup::Window));
- connect(buttonMainColor, SIGNAL(colorChanged(QColor)),
- this, SLOT(buildPalette()));
- connect(buttonMainColor2, SIGNAL(colorChanged(QColor)),
- this, SLOT(buildPalette()));
+ 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()));
if (X11->desktopEnvironment == DE_KDE)
- colorConfig->hide();
+ ui->colorConfig->hide();
else
- labelKDENote->hide();
+ ui->kdeNoteLabel->hide();
QFontDatabase db;
QStringList families = db.families();
- familycombo->insertStringList(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))
+ if (!fs.contains(*fsit))
fs += *fsit;
fsit++;
}
fs.sort();
- familysubcombo->insertStringList(fs);
+ ui->familySubstitutionCombo->addItems(fs);
- choosesubcombo->insertStringList(families);
- Q3ValueList<int> sizes = db.standardSizes();
- Q3ValueList<int>::Iterator it = sizes.begin();
- while (it != sizes.end())
- psizecombo->insertItem(QString::number(*it++));
+ ui->chooseSubstitutionCombo->addItems(families);
+ QList<int> sizes = db.standardSizes();
+ foreach(int i, sizes)
+ ui->pointSizeCombo->addItem(QString::number(i));
- dcispin->setValue(QApplication::doubleClickInterval());
- cfispin->setValue(QApplication::cursorFlashTime());
- wslspin->setValue(QApplication::wheelScrollLines());
+ ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval());
+ ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime());
+ ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines());
// #############
-// resolvelinks->setChecked(qt_resolve_symlinks);
+ // resolveLinksCheckBox->setChecked(qt_resolve_symlinks);
- effectcheckbox->setChecked(QApplication::isEffectEnabled(Qt::UI_General));
- effectbase->setEnabled(effectcheckbox->isChecked());
+ ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General));
+ ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked());
if (QApplication::isEffectEnabled(Qt::UI_FadeMenu))
- menueffect->setCurrentItem(2);
+ ui->menuEffectCombo->setCurrentIndex(2);
else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu))
- menueffect->setCurrentItem(1);
+ ui->menuEffectCombo->setCurrentIndex(1);
if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo))
- comboeffect->setCurrentItem(1);
+ ui->comboEffectCombo->setCurrentIndex(1);
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
- tooltipeffect->setCurrentItem(2);
+ ui->toolTipEffectCombo->setCurrentIndex(2);
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
- tooltipeffect->setCurrentItem(1);
+ ui->toolTipEffectCombo->setCurrentIndex(1);
- if ( QApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) )
- toolboxeffect->setCurrentItem( 1 );
+ if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox))
+ ui->toolBoxEffectCombo->setCurrentIndex(1);
QSize globalStrut = QApplication::globalStrut();
- strutwidth->setValue(globalStrut.width());
- strutheight->setValue(globalStrut.height());
+ ui->strutWidthSpinBox->setValue(globalStrut.width());
+ ui->strutHeightSpinBox->setValue(globalStrut.height());
// find the default family
QStringList::Iterator sit = families.begin();
@@ -308,10 +334,10 @@ MainWindow::MainWindow()
if (i == -1) // no clue about the current font
i = 0;
- familycombo->setCurrentItem(i);
+ ui->fontFamilyCombo->setCurrentIndex(i);
- QStringList styles = db.styles(familycombo->currentText());
- stylecombo->insertStringList(styles);
+ QStringList styles = db.styles(ui->fontFamilyCombo->currentText());
+ ui->fontStyleCombo->addItems(styles);
QString stylestring = db.styleString(QApplication::font());
sit = styles.begin();
@@ -330,91 +356,98 @@ MainWindow::MainWindow()
i = possible;
if (i == -1) // no clue about the current font
i = 0;
- stylecombo->setCurrentItem(i);
+ ui->fontStyleCombo->setCurrentIndex(i);
i = 0;
- for (int psize = QApplication::font().pointSize(); i < psizecombo->count(); ++i) {
- const int sz = psizecombo->text(i).toInt();
+ for (int psize = QApplication::font().pointSize(); i < ui->pointSizeCombo->count(); ++i) {
+ const int sz = ui->pointSizeCombo->itemText(i).toInt();
if (sz == psize) {
- psizecombo->setCurrentItem(i);
+ ui->pointSizeCombo->setCurrentIndex(i);
break;
} else if(sz > psize) {
- psizecombo->insertItem(i, QString::number(psize));
- psizecombo->setCurrentItem(i);
+ ui->pointSizeCombo->insertItem(i, QString::number(psize));
+ ui->pointSizeCombo->setCurrentIndex(i);
break;
}
}
- QStringList subs = QFont::substitutes(familysubcombo->currentText());
- sublistbox->clear();
- sublistbox->insertStringList(subs);
+ QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText());
+ ui->substitutionsListBox->clear();
+ ui->substitutionsListBox->insertItems(0, subs);
- rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false).toBool());
+ ui->rtlExtensionsCheckBox->setChecked(settings.value(QLatin1String("useRtlExtensions"), false)
+ .toBool());
#ifdef Q_WS_X11
- inputStyle->setCurrentText(settings.value(QLatin1String("XIMInputStyle"), trUtf8("On The Spot")).toString());
+ QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString();
+ if (!settingsInputStyle.isEmpty())
+ ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle));
#else
- inputStyle->hide();
- inputStyleLabel->hide();
+ ui->inputStyleCombo->hide();
+ ui->inputStyleComboLabel->hide();
#endif
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
- QStringList inputMethods = QInputContextFactory::keys();
- int inputMethodIndex = -1;
+ QStringList inputMethodCombo = QInputContextFactory::keys();
+ int inputMethodComboIndex = -1;
QString defaultInputMethod = settings.value(QLatin1String("DefaultInputMethod"), QLatin1String("xim")).toString();
- for (int i = inputMethods.size()-1; i >= 0; --i) {
- const QString &im = inputMethods.at(i);
+ for (int i = inputMethodCombo.size()-1; i >= 0; --i) {
+ const QString &im = inputMethodCombo.at(i);
if (im.contains(QLatin1String("imsw"))) {
- inputMethods.removeAt(i);
- if (inputMethodIndex > i)
- --inputMethodIndex;
+ inputMethodCombo.removeAt(i);
+ if (inputMethodComboIndex > i)
+ --inputMethodComboIndex;
} else if (im == defaultInputMethod) {
- inputMethodIndex = i;
+ inputMethodComboIndex = i;
}
}
- if (inputMethodIndex == -1 && !inputMethods.isEmpty())
- inputMethodIndex = 0;
- inputMethod->addItems(inputMethods);
- inputMethod->setCurrentIndex(inputMethodIndex);
+ if (inputMethodComboIndex == -1 && !inputMethodCombo.isEmpty())
+ inputMethodComboIndex = 0;
+ ui->inputMethodCombo->addItems(inputMethodCombo);
+ ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex);
#else
- inputMethod->hide();
- inputMethodLabel->hide();
+ ui->inputMethodCombo->hide();
+ ui->inputMethodComboLabel->hide();
#endif
- fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true).toBool());
+ ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true)
+ .toBool());
fontpaths = settings.value(QLatin1String("fontPath")).toStringList();
- fontpathlistbox->insertStringList(fontpaths);
-
- audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto"));
- audiosinkCombo->setItemData(audiosinkCombo->findText(tr("Auto (default)")),
- tr("Choose audio output automatically."), Qt::ToolTipRole);
- audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink"));
- audiosinkCombo->setItemData(audiosinkCombo->findText(tr("aRts")),
- tr("Experimental aRts support for GStreamer."), Qt::ToolTipRole);
+ ui->fontpathListBox->insertItems(0, fontpaths);
+
+ ui->audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto"));
+ ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("Auto (default)")),
+ tr("Choose audio output automatically."), Qt::ToolTipRole);
+ ui->audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink"));
+ ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("aRts")),
+ tr("Experimental aRts support for GStreamer."),
+ Qt::ToolTipRole);
#ifdef HAVE_PHONON
- phononVersionLabel->setText(QLatin1String(Phonon::phononVersion()));
+ ui->phononVersionLabel->setText(QLatin1String(Phonon::phononVersion()));
#endif
#ifndef QT_NO_GSTREAMER
if (gst_init_check(0, 0, 0)) {
gchar *versionString = gst_version_string();
- gstversionLabel->setText(QLatin1String(versionString));
+ ui->gstVersionLabel->setText(QLatin1String(versionString));
g_free(versionString);
- GList* factoryList = gst_registry_get_feature_list(gst_registry_get_default (), GST_TYPE_ELEMENT_FACTORY);
+ GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default(),
+ GST_TYPE_ELEMENT_FACTORY);
QString name, klass, description;
- for (GList* iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) {
+ for (GList *iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) {
GstPluginFeature *feature = GST_PLUGIN_FEATURE(iter->data);
klass = QLatin1String(gst_element_factory_get_klass(GST_ELEMENT_FACTORY(feature)));
if (klass == QLatin1String("Sink/Audio")) {
name = QLatin1String(GST_PLUGIN_FEATURE_NAME(feature));
if (name == QLatin1String("sfsink"))
- continue; //useless to output audio to file when you cannot set the file path
+ continue; // useless to output audio to file when you cannot set the file path
else if (name == QLatin1String("autoaudiosink"))
continue; //This is used implicitly from the auto setting
GstElement *sink = gst_element_factory_make (qPrintable(name), NULL);
if (sink) {
- description = QLatin1String(gst_element_factory_get_description (GST_ELEMENT_FACTORY(feature)));
- audiosinkCombo->addItem(name, name);
- audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, Qt::ToolTipRole);
+ description = QLatin1String(gst_element_factory_get_description(GST_ELEMENT_FACTORY(feature)));
+ ui->audiosinkCombo->addItem(name, name);
+ ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(name), description,
+ Qt::ToolTipRole);
gst_object_unref (sink);
}
}
@@ -422,39 +455,43 @@ MainWindow::MainWindow()
g_list_free(factoryList);
}
#else
- tab4->setEnabled(false);
- phononLabel->setText(tr("Phonon GStreamer backend not available."));
+ ui->phononTab->setEnabled(false);
+ ui->phononLabel->setText(tr("Phonon GStreamer backend not available."));
#endif
- videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto"));
- videomodeCombo->setItemData(videomodeCombo->findText(tr("Auto (default)")), tr("Choose render method automatically"), Qt::ToolTipRole);
+ ui->videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto"));
+ ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Auto (default)")),
+ tr("Choose render method automatically"), Qt::ToolTipRole);
#ifdef Q_WS_X11
- videomodeCombo->addItem(tr("X11"), QLatin1String("X11"));
- videomodeCombo->setItemData(videomodeCombo->findText(tr("X11")), tr("Use X11 Overlays"), Qt::ToolTipRole);
+ ui->videomodeCombo->addItem(tr("X11"), QLatin1String("X11"));
+ ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("X11")),
+ tr("Use X11 Overlays"), Qt::ToolTipRole);
#endif
#ifndef QT_NO_OPENGL
- videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL"));
- videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if available"), Qt::ToolTipRole);
+ ui->videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL"));
+ ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("OpenGL")),
+ tr("Use OpenGL if available"), Qt::ToolTipRole);
#endif
- videomodeCombo->addItem(tr("Software"), QLatin1String("Software"));
- videomodeCombo->setItemData(videomodeCombo->findText(tr("Software")), tr("Use simple software rendering"), Qt::ToolTipRole);
+ ui->videomodeCombo->addItem(tr("Software"), QLatin1String("Software"));
+ ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Software")),
+ tr("Use simple software rendering"), Qt::ToolTipRole);
QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString();
QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString();
- audiosinkCombo->setCurrentItem(audiosinkCombo->findData(audioSink));
- videomodeCombo->setCurrentItem(videomodeCombo->findData(videoMode));
+ ui->audiosinkCombo->setCurrentIndex(ui->audiosinkCombo->findData(audioSink));
+ ui->videomodeCombo->setCurrentIndex(ui->videomodeCombo->findData(videoMode));
settings.endGroup(); // Qt
- helpview->setText(tr(appearance_text));
+ ui->helpView->setText(tr(appearance_text));
setModified(false);
updateStyleLayout();
}
-
MainWindow::~MainWindow()
{
+ delete ui;
}
#ifdef Q_WS_X11
@@ -474,23 +511,23 @@ void MainWindow::fileSave()
QSettings settings(QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
QFontDatabase db;
- QFont font = db.font(familycombo->currentText(),
- stylecombo->currentText(),
- psizecombo->currentText().toInt());
+ QFont font = db.font(ui->fontFamilyCombo->currentText(),
+ ui->fontStyleCombo->currentText(),
+ ui->pointSizeCombo->currentText().toInt());
QStringList actcg, inactcg, discg;
- bool overrideDesktopSettings = (gstylecombo->currentText() != desktopThemeName);
+ bool overrideDesktopSettings = (ui->guiStyleCombo->currentText() != desktopThemeName);
if (overrideDesktopSettings) {
int i;
- for (i = 0; i < QColorGroup::NColorRoles; i++)
+ for (i = 0; i < QPalette::NColorRoles; i++)
actcg << editPalette.color(QPalette::Active,
- (QColorGroup::ColorRole) i).name();
- for (i = 0; i < QColorGroup::NColorRoles; i++)
+ QPalette::ColorRole(i)).name();
+ for (i = 0; i < QPalette::NColorRoles; i++)
inactcg << editPalette.color(QPalette::Inactive,
- (QColorGroup::ColorRole) i).name();
- for (i = 0; i < QColorGroup::NColorRoles; i++)
+ QPalette::ColorRole(i)).name();
+ for (i = 0; i < QPalette::NColorRoles; i++)
discg << editPalette.color(QPalette::Disabled,
- (QColorGroup::ColorRole) i).name();
+ QPalette::ColorRole(i)).name();
}
settings.setValue(QLatin1String("font"), font.toString());
@@ -499,59 +536,63 @@ void MainWindow::fileSave()
settings.setValue(QLatin1String("Palette/disabled"), discg);
settings.setValue(QLatin1String("fontPath"), fontpaths);
- settings.setValue(QLatin1String("embedFonts"), fontembeddingcheckbox->isChecked());
- settings.setValue(QLatin1String("style"), overrideDesktopSettings ? gstylecombo->currentText() : QString());
+ settings.setValue(QLatin1String("embedFonts"), ui->fontEmbeddingCheckBox->isChecked());
+ settings.setValue(QLatin1String("style"),
+ overrideDesktopSettings ? ui->guiStyleCombo->currentText() : QString());
- settings.setValue(QLatin1String("doubleClickInterval"), dcispin->value());
- settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value() );
- settings.setValue(QLatin1String("wheelScrollLines"), wslspin->value());
- settings.setValue(QLatin1String("resolveSymlinks"), resolvelinks->isChecked());
+ 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(strutwidth->value(), strutheight->value());
+ 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"), rtlExtensions->isChecked());
+ settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensionsCheckBox->isChecked());
#ifdef Q_WS_X11
- QString style = inputStyle->currentText();
+ QString style = ui->inputStyleCombo->currentText();
QString str = QLatin1String("On The Spot");
- if ( style == trUtf8( "Over The Spot" ) )
+ if (style == tr("Over The Spot"))
str = QLatin1String("Over The Spot");
- else if ( style == trUtf8( "Off The Spot" ) )
+ else if (style == tr("Off The Spot"))
str = QLatin1String("Off The Spot");
- else if ( style == trUtf8( "Root" ) )
+ else if (style == tr("Root"))
str = QLatin1String("Root");
- settings.setValue( QLatin1String("XIMInputStyle"), str );
+ settings.setValue(QLatin1String("XIMInputStyle"), str);
#endif
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
- settings.setValue(QLatin1String("DefaultInputMethod"), inputMethod->currentText());
+ settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText());
#endif
QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString();
QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString();
- settings.setValue(QLatin1String("audiosink"), audiosinkCombo->itemData(audiosinkCombo->currentIndex()));
- settings.setValue(QLatin1String("videomode"), videomodeCombo->itemData(videomodeCombo->currentIndex()));
+ settings.setValue(QLatin1String("audiosink"),
+ ui->audiosinkCombo->itemData(ui->audiosinkCombo->currentIndex()));
+ settings.setValue(QLatin1String("videomode"),
+ ui->videomodeCombo->itemData(ui->videomodeCombo->currentIndex()));
QStringList effects;
- if (effectcheckbox->isChecked()) {
+ if (ui->effectsCheckBox->isChecked()) {
effects << QLatin1String("general");
- switch (menueffect->currentItem()) {
+ switch (ui->menuEffectCombo->currentIndex()) {
case 1: effects << QLatin1String("animatemenu"); break;
case 2: effects << QLatin1String("fademenu"); break;
}
- switch (comboeffect->currentItem()) {
+ switch (ui->comboEffectCombo->currentIndex()) {
case 1: effects << QLatin1String("animatecombo"); break;
}
- switch (tooltipeffect->currentItem()) {
+ switch (ui->toolTipEffectCombo->currentIndex()) {
case 1: effects << QLatin1String("animatetooltip"); break;
case 2: effects << QLatin1String("fadetooltip"); break;
}
- switch ( toolboxeffect->currentItem() ) {
+ switch (ui->toolBoxEffectCombo->currentIndex()) {
case 1: effects << QLatin1String("animatetoolbox"); break;
}
} else
@@ -575,189 +616,63 @@ void MainWindow::fileSave()
#endif // Q_WS_X11
setModified(false);
- statusBar()->showMessage(QLatin1String("Saved changes."));
+ statusBar()->showMessage(tr("Saved changes."));
}
-
void MainWindow::fileExit()
{
qApp->closeAllWindows();
}
-
void MainWindow::setModified(bool m)
{
if (modified == m)
return;
modified = m;
- fileSaveAction->setEnabled(m);
+ ui->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::Window ) );
-
- 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();
+ 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::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()
+void MainWindow::setPreviewPalette(const QPalette &pal)
{
- editPalette.setInactive( editPalette.active() );
- buildInactiveEffect();
-}
-
+ QPalette::ColorGroup colorGroup = groupFromIndex(ui->paletteCombo->currentIndex());
-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 = Qt::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, Qt::darkGray );
- cg.setColor( QColorGroup::WindowText, Qt::darkGray );
- cg.setColor( QColorGroup::Text, Qt::darkGray );
- cg.setColor( QColorGroup::HighlightedText, Qt::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 = Qt::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;
+ 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));
+ }
}
- previewPalette.setActive( cg );
- previewPalette.setInactive( cg );
- previewPalette.setDisabled( cg );
- previewFrame->setPreviewPalette(previewPalette);
+ ui->previewFrame->setPreviewPalette(previewPalette);
}
-
void MainWindow::updateColorButtons()
{
- buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button ));
- buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Window ));
+ 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,
- backgroundMode(), this);
- if (! ok)
+ backgroundRole(), this);
+ if (!ok)
return;
editPalette = pal;
@@ -765,7 +680,6 @@ void MainWindow::tunePalette()
setModified(true);
}
-
void MainWindow::paletteSelected(int)
{
setPreviewPalette(editPalette);
@@ -773,10 +687,10 @@ void MainWindow::paletteSelected(int)
void MainWindow::updateStyleLayout()
{
- QString currentStyle = gstylecombo->currentText();
+ QString currentStyle = ui->guiStyleCombo->currentText();
bool autoStyle = (currentStyle == desktopThemeName);
- previewFrame->setPreviewVisible(!autoStyle);
- groupAutoPalette->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle);
+ ui->previewFrame->setPreviewVisible(!autoStyle);
+ ui->buildPaletteGroup->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle);
}
void MainWindow::styleSelected(const QString &stylename)
@@ -788,7 +702,7 @@ void MainWindow::styleSelected(const QString &stylename)
style = QStyleFactory::create(stylename);
if (!style)
return;
- setStyleHelper(previewFrame, style);
+ setStyleHelper(ui->previewFrame, style);
delete previewstyle;
previewstyle = style;
setModified(true);
@@ -796,210 +710,191 @@ void MainWindow::styleSelected(const QString &stylename)
updateStyleLayout();
}
-
void MainWindow::familySelected(const QString &family)
{
QFontDatabase db;
QStringList styles = db.styles(family);
- stylecombo->clear();
- stylecombo->insertStringList(styles);
- familysubcombo->insertItem(family);
+ ui->fontStyleCombo->clear();
+ ui->fontStyleCombo->addItems(styles);
+ ui->familySubstitutionCombo->addItem(family);
buildFont();
}
-
void MainWindow::buildFont()
{
QFontDatabase db;
- QFont font = db.font(familycombo->currentText(),
- stylecombo->currentText(),
- psizecombo->currentText().toInt());
- samplelineedit->setFont(font);
+ 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);
- sublistbox->clear();
- sublistbox->insertStringList(subs);
+ ui->substitutionsListBox->clear();
+ ui->substitutionsListBox->insertItems(0, subs);
}
-
void MainWindow::removeSubstitute()
{
- if (sublistbox->currentItem() < 0 ||
- uint(sublistbox->currentItem()) > sublistbox->count())
+ if (!ui->substitutionsListBox->currentItem())
return;
- int item = sublistbox->currentItem();
- QStringList subs = QFont::substitutes(familysubcombo->currentText());
- subs.removeAt(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);
+ 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::removeSubstitution(ui->familySubstitutionCombo->currentText());
+ QFont::insertSubstitutions(ui->familySubstitutionCombo->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);
+ 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 item = sublistbox->currentItem();
- QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText());
- QStringList subs = QFont::substitutes(familysubcombo->currentText());
- sublistbox->clear();
- sublistbox->insertStringList(subs);
- sublistbox->setCurrentItem(item);
+ 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 (sublistbox->currentItem() < 0 ||
- uint(sublistbox->currentItem()) >= sublistbox->count())
+ if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() >= ui->substitutionsListBox->count())
return;
- int item = sublistbox->currentItem();
- QStringList subs = QFont::substitutes(familysubcombo->currentText());
- QString fam = subs.at(item);
- subs.removeAt(item);
- subs.insert(item+1, fam);
- sublistbox->clear();
- sublistbox->insertStringList(subs);
- sublistbox->setCurrentItem(item + 1);
- QFont::removeSubstitution(familysubcombo->currentText());
- QFont::insertSubstitutions(familysubcombo->currentText(), subs);
+ 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::removeSubstitution(ui->familySubstitutionCombo->currentText());
+ QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs);
setModified(true);
}
-
void MainWindow::upSubstitute()
{
- if (sublistbox->currentItem() < 1)
+ if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() < 1)
return;
- int item = sublistbox->currentItem();
- QStringList subs = QFont::substitutes(familysubcombo->currentText());
- QString fam = subs.at(item);
- subs.removeAt(item);
- subs.insert(item-1, fam);
- sublistbox->clear();
- sublistbox->insertStringList(subs);
- sublistbox->setCurrentItem(item - 1);
- QFont::removeSubstitution(familysubcombo->currentText());
- QFont::insertSubstitutions(familysubcombo->currentText(), subs);
+ 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::removeSubstitution(ui->familySubstitutionCombo->currentText());
+ QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs);
setModified(true);
}
-
void MainWindow::removeFontpath()
{
- if (fontpathlistbox->currentItem() < 0 ||
- uint(fontpathlistbox->currentItem()) > fontpathlistbox->count())
+ if (!ui->fontpathListBox->currentItem())
return;
- int item = fontpathlistbox->currentItem();
- fontpaths.removeAt(fontpathlistbox->currentItem());
- fontpathlistbox->clear();
- fontpathlistbox->insertStringList(fontpaths);
- if (uint(item) > fontpathlistbox->count())
- item = int(fontpathlistbox->count()) - 1;
- fontpathlistbox->setCurrentItem(item);
+ 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 (fontpathlineedit->text().isEmpty())
+ if (ui->fontPathLineEdit->text().isEmpty())
return;
- if (fontpathlistbox->currentItem() < 0 ||
- uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) {
- fontpaths.append(fontpathlineedit->text());
- fontpathlistbox->clear();
- fontpathlistbox->insertStringList(fontpaths);
+ if (!ui->fontpathListBox->currentItem()) {
+ fontpaths.append(ui->fontPathLineEdit->text());
+ ui->fontpathListBox->clear();
+ ui->fontpathListBox->insertItems(0, fontpaths);
setModified(true);
return;
}
- int item = fontpathlistbox->currentItem();
- fontpaths.insert(fontpathlistbox->currentItem()+1,
- fontpathlineedit->text());
- fontpathlistbox->clear();
- fontpathlistbox->insertStringList(fontpaths);
- fontpathlistbox->setCurrentItem(item);
+ 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 (fontpathlistbox->currentItem() < 0 ||
- uint(fontpathlistbox->currentItem()) >= fontpathlistbox->count() - 1)
+ if (!ui->fontpathListBox->currentItem()
+ || ui->fontpathListBox->currentRow() >= (ui->fontpathListBox->count() - 1)) {
return;
+ }
- int item = fontpathlistbox->currentItem();
- QString fam = fontpaths.at(item);
- fontpaths.removeAt(item);
- fontpaths.insert(item+1, fam);
- fontpathlistbox->clear();
- fontpathlistbox->insertStringList(fontpaths);
- fontpathlistbox->setCurrentItem(item + 1);
+ 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 (fontpathlistbox->currentItem() < 1)
+ if (!ui->fontpathListBox->currentItem() || ui->fontpathListBox->currentRow() < 1)
return;
- int item = fontpathlistbox->currentItem();
- QString fam = fontpaths.at(item);
- fontpaths.removeAt(item);
- fontpaths.insert(item-1, fam);
- fontpathlistbox->clear();
- fontpathlistbox->insertStringList(fontpaths);
- fontpathlistbox->setCurrentItem(item - 1);
+ 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(QString(), this, 0,
- tr("Select a Directory"));
+ QString dirname = QFileDialog::getExistingDirectory(this, tr("Select a Directory"));
if (dirname.isNull())
return;
- fontpathlineedit->setText(dirname);
+ ui->fontPathLineEdit->setText(dirname);
}
-
void MainWindow::somethingModified()
{
setModified(true);
}
-
void MainWindow::helpAbout()
{
QMessageBox box(this);
@@ -1012,44 +907,43 @@ void MainWindow::helpAbout()
box.exec();
}
-
void MainWindow::helpAboutQt()
{
QMessageBox::aboutQt(this, tr("Qt Configuration"));
}
-
-void MainWindow::pageChanged(QWidget *page)
+void MainWindow::pageChanged(int pageNumber)
{
- if (page == tab)
- helpview->setText(tr(interface_text));
- else if (page == tab1)
- helpview->setText(tr(appearance_text));
- else if (page == tab2)
- helpview->setText(tr(font_text));
- else if (page == tab3)
- helpview->setText(tr(printer_text));
- else if (page == tab4)
- helpview->setText(tr(phonon_text));
+ 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));
+ else if (page == ui->phononTab)
+ ui->helpView->setText(tr(phonon_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
+ 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 1: // don't save
+ case QMessageBox::No: // don't save
e->accept();
break;
- case 2: // cancel
+ case QMessageBox::Cancel: // cancel
e->ignore();
break;
diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h
index cc7d597..6f4c8a5 100644
--- a/tools/qtconfig/mainwindow.h
+++ b/tools/qtconfig/mainwindow.h
@@ -42,11 +42,15 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include "mainwindowbase.h"
+#include <QtGui/QMainWindow>
QT_BEGIN_NAMESPACE
-class MainWindow : public MainWindowBase
+namespace Ui {
+ class MainWindow;
+}
+
+class MainWindow : public QMainWindow
{
Q_OBJECT
@@ -56,7 +60,6 @@ public:
void closeEvent(QCloseEvent *);
-
public slots:
virtual void buildPalette();
virtual void buildFont();
@@ -79,25 +82,21 @@ public slots:
virtual void somethingModified();
virtual void helpAbout();
virtual void helpAboutQt();
- virtual void pageChanged(QWidget *);
+ virtual void pageChanged(int);
private:
- void buildActive();
- void buildActiveEffect();
- void buildInactive();
- void buildInactiveEffect();
- void buildDisabled();
- void buildDisabledEffect();
-
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;
diff --git a/tools/qtconfig/mainwindowbase.ui b/tools/qtconfig/mainwindow.ui
index c5b4470..d906800 100644
--- a/tools/qtconfig/mainwindowbase.ui
+++ b/tools/qtconfig/mainwindow.ui
@@ -40,8 +40,8 @@
** $QT_END_LICENSE$
**
*********************************************************************</comment>
- <class>MainWindowBase</class>
- <widget class="Q3MainWindow" name="MainWindowBase">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
@@ -54,20 +54,12 @@
<string>Qt Configuration</string>
</property>
<widget class="QWidget" name="widget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>26</y>
- <width>815</width>
- <height>690</height>
- </rect>
- </property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>8</number>
</property>
<item row="0" column="0">
- <widget class="QTextEdit" name="helpview">
+ <widget class="QTextEdit" name="helpView">
<property name="minimumSize">
<size>
<width>200</width>
@@ -80,17 +72,17 @@
</widget>
</item>
<item row="0" column="1">
- <widget class="QTabWidget" name="TabWidget3">
+ <widget class="QTabWidget" name="mainTabWidget">
<property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="tab1">
+ <widget class="QWidget" name="appearanceTab">
<attribute name="title">
<string>Appearance</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
- <widget class="QGroupBox" name="GroupBox40">
+ <widget class="QGroupBox" name="guiStyleGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -114,7 +106,7 @@
<number>8</number>
</property>
<item>
- <widget class="QLabel" name="gstylebuddy">
+ <widget class="QLabel" name="guiStyleLabel">
<property name="minimumSize">
<size>
<width>0</width>
@@ -125,18 +117,18 @@
<string>Select GUI &amp;Style:</string>
</property>
<property name="buddy">
- <cstring>gstylecombo</cstring>
+ <cstring>guiStyleCombo</cstring>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="gstylecombo"/>
+ <widget class="QComboBox" name="guiStyleCombo"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
- <widget class="QGroupBox" name="groupPreview">
+ <widget class="QGroupBox" name="previewGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -148,7 +140,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
- <widget class="QLabel" name="TextLabel1">
+ <widget class="QLabel" name="paletteLabel">
<property name="text">
<string>Select &amp;Palette:</string>
</property>
@@ -196,7 +188,7 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QGroupBox" name="groupAutoPalette">
+ <widget class="QGroupBox" name="buildPaletteGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
@@ -222,7 +214,7 @@
<item>
<widget class="QLabel" name="labelMainColor">
<property name="text">
- <string>&amp;3-D Effects:</string>
+ <string>&amp;Button Background:</string>
</property>
<property name="buddy">
<cstring>buttonMainColor</cstring>
@@ -233,7 +225,7 @@
<widget class="ColorButton" name="buttonMainColor" native="true"/>
</item>
<item>
- <widget class="QLabel" name="labelMainColor2">
+ <widget class="QLabel" name="labelWindowColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
@@ -262,12 +254,12 @@
<number>0</number>
</property>
<property name="buddy">
- <cstring>buttonMainColor2</cstring>
+ <cstring>buttonWindowColor</cstring>
</property>
</widget>
</item>
<item>
- <widget class="ColorButton" name="buttonMainColor2" native="true"/>
+ <widget class="ColorButton" name="buttonWindowColor" native="true"/>
</item>
<item>
<spacer name="spacer">
@@ -286,7 +278,7 @@
</spacer>
</item>
<item>
- <widget class="QPushButton" name="btnAdvanced">
+ <widget class="QPushButton" name="tunePaletteButton">
<property name="text">
<string>&amp;Tune Palette...</string>
</property>
@@ -296,7 +288,7 @@
</widget>
</item>
<item>
- <widget class="QLabel" name="labelKDENote">
+ <widget class="QLabel" name="kdeNoteLabel">
<property name="text">
<string>Please use the KDE Control Center to set the palette.</string>
</property>
@@ -307,13 +299,13 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab2">
+ <widget class="QWidget" name="fontsTab">
<attribute name="title">
<string>Fonts</string>
</attribute>
<layout class="QVBoxLayout">
<item>
- <widget class="QGroupBox" name="GroupBox1">
+ <widget class="QGroupBox" name="defaultFontGroup">
<property name="title">
<string>Default Font</string>
</property>
@@ -325,7 +317,7 @@
<number>4</number>
</property>
<item row="1" column="1">
- <widget class="QComboBox" name="stylecombo">
+ <widget class="QComboBox" name="fontStyleCombo">
<property name="autoCompletion">
<bool>true</bool>
</property>
@@ -335,7 +327,7 @@
</widget>
</item>
<item row="0" column="1">
- <widget class="QComboBox" name="familycombo">
+ <widget class="QComboBox" name="fontFamilyCombo">
<property name="autoCompletion">
<bool>true</bool>
</property>
@@ -345,7 +337,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="QComboBox" name="psizecombo">
+ <widget class="QComboBox" name="pointSizeCombo">
<property name="editable">
<bool>true</bool>
</property>
@@ -358,37 +350,37 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="stylebuddy">
+ <widget class="QLabel" name="fontStyleLabel">
<property name="text">
<string>&amp;Style:</string>
</property>
<property name="buddy">
- <cstring>stylecombo</cstring>
+ <cstring>fontStyleCombo</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
- <widget class="QLabel" name="psizebuddy">
+ <widget class="QLabel" name="pointSizeLabel">
<property name="text">
<string>&amp;Point Size:</string>
</property>
<property name="buddy">
- <cstring>psizecombo</cstring>
+ <cstring>pointSizeCombo</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
- <widget class="QLabel" name="familybuddy">
+ <widget class="QLabel" name="fontFamilyLabel">
<property name="text">
<string>F&amp;amily:</string>
</property>
<property name="buddy">
- <cstring>familycombo</cstring>
+ <cstring>fontFamilyCombo</cstring>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
- <widget class="QLineEdit" name="samplelineedit">
+ <widget class="QLineEdit" name="sampleLineEdit">
<property name="text">
<string>Sample Text</string>
</property>
@@ -401,7 +393,7 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="GroupBox2">
+ <widget class="QGroupBox" name="fontSubstitutionGroup">
<property name="title">
<string>Font Substitution</string>
</property>
@@ -421,17 +413,17 @@
<number>0</number>
</property>
<item>
- <widget class="QLabel" name="famsubbuddy">
+ <widget class="QLabel" name="familySubstitutionLabel">
<property name="text">
<string>S&amp;elect or Enter a Family:</string>
</property>
<property name="buddy">
- <cstring>familysubcombo</cstring>
+ <cstring>familySubstitutionCombo</cstring>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="familysubcombo">
+ <widget class="QComboBox" name="familySubstitutionCombo">
<property name="editable">
<bool>true</bool>
</property>
@@ -459,14 +451,14 @@
</widget>
</item>
<item>
- <widget class="QLabel" name="TextLabel5">
+ <widget class="QLabel" name="substitutionsLabel">
<property name="text">
<string>Current Substitutions:</string>
</property>
</widget>
</item>
<item>
- <widget class="Q3ListBox" name="sublistbox"/>
+ <widget class="QListWidget" name="substitutionsListBox"/>
</item>
<item>
<layout class="QHBoxLayout">
@@ -477,21 +469,21 @@
<number>0</number>
</property>
<item>
- <widget class="QPushButton" name="PushButton2">
+ <widget class="QPushButton" name="upSubstitutionButton">
<property name="text">
<string>Up</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="PushButton3">
+ <widget class="QPushButton" name="downSubstitutionButton">
<property name="text">
<string>Down</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="PushButton4">
+ <widget class="QPushButton" name="removeSubstitutionButton">
<property name="text">
<string>Remove</string>
</property>
@@ -521,17 +513,17 @@
<number>0</number>
</property>
<item>
- <widget class="QLabel" name="choosebuddy">
+ <widget class="QLabel" name="chooseSubstitutionLabel">
<property name="text">
<string>Select s&amp;ubstitute Family:</string>
</property>
<property name="buddy">
- <cstring>choosesubcombo</cstring>
+ <cstring>chooseSubstitutionCombo</cstring>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="choosesubcombo">
+ <widget class="QComboBox" name="chooseSubstitutionCombo">
<property name="autoCompletion">
<bool>true</bool>
</property>
@@ -541,7 +533,7 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="PushButton1">
+ <widget class="QPushButton" name="addSubstitutionButton">
<property name="text">
<string>Add</string>
</property>
@@ -554,13 +546,13 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab">
+ <widget class="QWidget" name="interfaceTab">
<attribute name="title">
<string>Interface</string>
</attribute>
<layout class="QVBoxLayout">
<item>
- <widget class="QGroupBox" name="GroupBox4">
+ <widget class="QGroupBox" name="feelSettingsGroup">
<property name="title">
<string>Feel Settings</string>
</property>
@@ -572,7 +564,7 @@
<number>4</number>
</property>
<item row="0" column="1">
- <widget class="QSpinBox" name="dcispin">
+ <widget class="QSpinBox" name="doubleClickIntervalSpinBox">
<property name="suffix">
<string> ms</string>
</property>
@@ -585,17 +577,17 @@
</widget>
</item>
<item row="0" column="0">
- <widget class="QLabel" name="dcibuddy">
+ <widget class="QLabel" name="doubleClickIntervalLabel">
<property name="text">
<string>&amp;Double Click Interval:</string>
</property>
<property name="buddy">
- <cstring>dcispin</cstring>
+ <cstring>doubleClickIntervalSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QSpinBox" name="cfispin">
+ <widget class="QSpinBox" name="cursorFlashTimeSpinBox">
<property name="specialValueText">
<string>No blinking</string>
</property>
@@ -611,17 +603,17 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="cfibuddy">
+ <widget class="QLabel" name="cursorFlashTimeLabel">
<property name="text">
<string>&amp;Cursor Flash Time:</string>
</property>
<property name="buddy">
- <cstring>cfispin</cstring>
+ <cstring>cursorFlashTimeSpinBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
- <widget class="QSpinBox" name="wslspin">
+ <widget class="QSpinBox" name="wheelScrollLinesSpinBox">
<property name="suffix">
<string> lines</string>
</property>
@@ -634,17 +626,17 @@
</widget>
</item>
<item row="2" column="0">
- <widget class="QLabel" name="wslbuddy">
+ <widget class="QLabel" name="wheelScrollLinesLabel">
<property name="text">
<string>Wheel &amp;Scroll Lines:</string>
</property>
<property name="buddy">
- <cstring>wslspin</cstring>
+ <cstring>wheelScrollLinesSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
- <widget class="QCheckBox" name="resolvelinks">
+ <widget class="QCheckBox" name="resolveLinksCheckBox">
<property name="text">
<string>Resolve symlinks in URLs</string>
</property>
@@ -654,7 +646,7 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="GroupBox3">
+ <widget class="QGroupBox" name="guiEffectsGroup">
<property name="title">
<string>GUI Effects</string>
</property>
@@ -666,7 +658,7 @@
<number>8</number>
</property>
<item>
- <widget class="QCheckBox" name="effectcheckbox">
+ <widget class="QCheckBox" name="effectsCheckBox">
<property name="text">
<string>&amp;Enable</string>
</property>
@@ -676,62 +668,53 @@
</widget>
</item>
<item>
- <widget class="Q3Frame" name="effectbase">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
+ <widget class="QFrame" name="effectsFrame">
<layout class="QGridLayout">
- <property name="margin">
- <number>0</number>
- </property>
<property name="spacing">
<number>4</number>
</property>
<item row="0" column="0">
- <widget class="QLabel" name="meffectbuddy">
+ <widget class="QLabel" name="menuEffectLabel">
<property name="text">
<string>&amp;Menu Effect:</string>
</property>
<property name="buddy">
- <cstring>menueffect</cstring>
+ <cstring>menuEffectCombo</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="ceffectbuddy">
+ <widget class="QLabel" name="comboEffectLabel">
<property name="text">
<string>C&amp;omboBox Effect:</string>
</property>
<property name="buddy">
- <cstring>comboeffect</cstring>
+ <cstring>comboEffectCombo</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
- <widget class="QLabel" name="teffectbuddy">
+ <widget class="QLabel" name="toolTipEffectLabel">
<property name="text">
<string>&amp;ToolTip Effect:</string>
</property>
<property name="buddy">
- <cstring>tooltipeffect</cstring>
+ <cstring>toolTipEffectCombo</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
- <widget class="QLabel" name="beffectbuddy">
+ <widget class="QLabel" name="toolBoxEffectLabel">
<property name="text">
<string>Tool&amp;Box Effect:</string>
</property>
<property name="buddy">
- <cstring>toolboxeffect</cstring>
+ <cstring>toolBoxEffectCombo</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QComboBox" name="menueffect">
+ <widget class="QComboBox" name="menuEffectCombo">
<property name="currentIndex">
<number>0</number>
</property>
@@ -756,7 +739,7 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QComboBox" name="comboeffect">
+ <widget class="QComboBox" name="comboEffectCombo">
<item>
<property name="text">
<string>Disable</string>
@@ -770,7 +753,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="QComboBox" name="tooltipeffect">
+ <widget class="QComboBox" name="toolTipEffectCombo">
<item>
<property name="text">
<string>Disable</string>
@@ -789,7 +772,7 @@
</widget>
</item>
<item row="3" column="1">
- <widget class="QComboBox" name="toolboxeffect">
+ <widget class="QComboBox" name="toolBoxEffectCombo">
<item>
<property name="text">
<string>Disable</string>
@@ -809,7 +792,7 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="GroupBox5">
+ <widget class="QGroupBox" name="globalStrutGroup">
<property name="title">
<string>Global Strut</string>
</property>
@@ -821,27 +804,27 @@
<number>4</number>
</property>
<item row="0" column="0">
- <widget class="QLabel" name="swbuddy">
+ <widget class="QLabel" name="strutWidthLabel">
<property name="text">
<string>Minimum &amp;Width:</string>
</property>
<property name="buddy">
- <cstring>strutwidth</cstring>
+ <cstring>strutWidthSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="shbuddy">
+ <widget class="QLabel" name="strutHeightLabel">
<property name="text">
<string>Minimum Hei&amp;ght:</string>
</property>
<property name="buddy">
- <cstring>strutheight</cstring>
+ <cstring>strutHeightSpinBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QSpinBox" name="strutwidth">
+ <widget class="QSpinBox" name="strutWidthSpinBox">
<property name="suffix">
<string> pixels</string>
</property>
@@ -851,7 +834,7 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QSpinBox" name="strutheight">
+ <widget class="QSpinBox" name="strutHeightSpinBox">
<property name="suffix">
<string> pixels</string>
</property>
@@ -864,7 +847,7 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="rtlExtensions">
+ <widget class="QCheckBox" name="rtlExtensionsCheckBox">
<property name="text">
<string>Enhanced support for languages written right-to-left</string>
</property>
@@ -878,7 +861,7 @@
</widget>
</item>
<item>
- <widget class="QComboBox" name="inputStyle">
+ <widget class="QComboBox" name="inputStyleCombo">
<property name="currentIndex">
<number>0</number>
</property>
@@ -912,7 +895,7 @@
</widget>
</item>
<item>
- <widget class="QComboBox" name="inputMethod">
+ <widget class="QComboBox" name="inputMethodCombo">
<property name="currentIndex">
<number>-1</number>
</property>
@@ -936,13 +919,13 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab3">
+ <widget class="QWidget" name="printerTab">
<attribute name="title">
<string>Printer</string>
</attribute>
<layout class="QVBoxLayout">
<item>
- <widget class="QCheckBox" name="fontembeddingcheckbox">
+ <widget class="QCheckBox" name="fontEmbeddingCheckBox">
<property name="text">
<string>Enable Font embedding</string>
</property>
@@ -952,7 +935,7 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="GroupBox10">
+ <widget class="QGroupBox" name="fontPathsGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -978,28 +961,28 @@
<number>4</number>
</property>
<item row="1" column="0">
- <widget class="QPushButton" name="PushButton11">
+ <widget class="QPushButton" name="upFontpathButton">
<property name="text">
<string>Up</string>
</property>
</widget>
</item>
<item row="1" column="2">
- <widget class="QPushButton" name="PushButton13">
+ <widget class="QPushButton" name="removeFontpathButton">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QPushButton" name="PushButton12">
+ <widget class="QPushButton" name="downFontpathButton">
<property name="text">
<string>Down</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
- <widget class="Q3ListBox" name="fontpathlistbox"/>
+ <widget class="QListWidget" name="fontpathListBox"/>
</item>
</layout>
</item>
@@ -1028,28 +1011,28 @@
</spacer>
</item>
<item row="2" column="2">
- <widget class="QPushButton" name="PushButton15">
+ <widget class="QPushButton" name="addFontPathButton">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item row="2" column="1">
- <widget class="QPushButton" name="PushButton14">
+ <widget class="QPushButton" name="browseFontPathButton">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
- <widget class="QLabel" name="TextLabel15_2">
+ <widget class="QLabel" name="browseFontPathLabel">
<property name="text">
<string>Press the &lt;b&gt;Browse&lt;/b&gt; button or enter a directory and press Enter to add them to the list.</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
- <widget class="QLineEdit" name="fontpathlineedit"/>
+ <widget class="QLineEdit" name="fontPathLineEdit"/>
</item>
</layout>
</item>
@@ -1058,19 +1041,19 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab4">
+ <widget class="QWidget" name="phononTab">
<attribute name="title">
<string>Phonon</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QGroupBox" name="groupBox_4">
+ <widget class="QGroupBox" name="aboutPhononGroup">
<property name="title">
<string>About Phonon</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="QLabel" name="label_7">
+ <widget class="QLabel" name="phononVersionBuddyLabel">
<property name="text">
<string>Current Version:</string>
</property>
@@ -1084,20 +1067,16 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="label_5">
+ <widget class="QLabel" name="phononWebsiteBuddyLabel">
<property name="text">
<string>Website:</string>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QLabel" name="gstversionLabel_3">
+ <widget class="QLabel" name="phononWebsiteLabel">
<property name="text">
- <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://phonon.kde.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://phonon.kde.org&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;a href=&quot;http://phonon.kde.org&quot;&gt;http://phonon.kde.org/&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@@ -1108,40 +1087,36 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_3">
+ <widget class="QGroupBox" name="aboutGStreamerGroup">
<property name="title">
<string>About GStreamer</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
- <widget class="QLabel" name="label_3">
+ <widget class="QLabel" name="gstVersionBuddyLabel">
<property name="text">
<string>Current Version:</string>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QLabel" name="gstversionLabel">
+ <widget class="QLabel" name="gstVersionLabel">
<property name="text">
<string>Not available</string>
</property>
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="label_4">
+ <widget class="QLabel" name="gstWebsiteBuddyLabel">
<property name="text">
<string>Website:</string>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QLabel" name="gstversionLabel_2">
+ <widget class="QLabel" name="gstWebsiteLabel">
<property name="text">
- <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://gstreamer.freedesktop.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://gstreamer.freedesktop.org/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;a href=&quot;http://gstreamer.freedesktop.org/&quot;&gt;http://gstreamer.freedesktop.org/&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@@ -1152,13 +1127,13 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox">
+ <widget class="QGroupBox" name="gstBackendGroup">
<property name="title">
<string>GStreamer backend settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="audiosinkLabel">
<property name="text">
<string>Preferred audio sink:</string>
</property>
@@ -1171,7 +1146,7 @@ p, li { white-space: pre-wrap; }
<widget class="QComboBox" name="audiosinkCombo"/>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="label_2">
+ <widget class="QLabel" name="videomodeLabel">
<property name="text">
<string>Preferred render method:</string>
</property>
@@ -1184,7 +1159,7 @@ p, li { white-space: pre-wrap; }
<widget class="QComboBox" name="videomodeCombo"/>
</item>
<item row="2" column="0" colspan="2">
- <widget class="QLabel" name="label_6">
+ <widget class="QLabel" name="gstBackendNoteLabel">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
@@ -1235,41 +1210,38 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
- <widget class="QMenuBar" name="menubar">
+ <widget class="QMenuBar" name="mainMenu">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>815</width>
- <height>26</height>
+ <height>19</height>
</rect>
</property>
- <widget class="QMenu" name="PopupMenu">
+ <widget class="QMenu" name="fileMenu">
<property name="geometry">
<rect>
- <x>0</x>
- <y>0</y>
- <width>123</width>
- <height>92</height>
+ <x>203</x>
+ <y>114</y>
+ <width>161</width>
+ <height>110</height>
</rect>
</property>
<property name="title">
<string>&amp;File</string>
</property>
- <action name=""/>
- <action name=""/>
- <action name=""/>
<addaction name="fileSaveAction"/>
<addaction name="separator"/>
<addaction name="fileExitAction"/>
</widget>
- <widget class="QMenu" name="PopupMenu_2">
+ <widget class="QMenu" name="saveMenu">
<property name="geometry">
<rect>
- <x>0</x>
- <y>0</y>
- <width>123</width>
- <height>90</height>
+ <x>543</x>
+ <y>98</y>
+ <width>161</width>
+ <height>106</height>
</rect>
</property>
<property name="title">
@@ -1278,12 +1250,9 @@ p, li { white-space: pre-wrap; }
<addaction name="helpAboutAction"/>
<addaction name="helpAboutQtAction"/>
</widget>
- <action name=""/>
- <action name=""/>
- <action name=""/>
- <addaction name="PopupMenu"/>
+ <addaction name="fileMenu"/>
<addaction name="separator"/>
- <addaction name="PopupMenu_2"/>
+ <addaction name="saveMenu"/>
</widget>
<action name="fileSaveAction">
<property name="text">
@@ -1304,7 +1273,7 @@ p, li { white-space: pre-wrap; }
<string>Exit</string>
</property>
<property name="shortcut">
- <string/>
+ <string>Ctrl+Q</string>
</property>
</action>
<action name="helpAboutAction">
@@ -1329,23 +1298,6 @@ p, li { white-space: pre-wrap; }
</widget>
<customwidgets>
<customwidget>
- <class>Q3Frame</class>
- <extends>QFrame</extends>
- <header>Qt3Support/Q3Frame</header>
- <container>1</container>
- </customwidget>
- <customwidget>
- <class>Q3MainWindow</class>
- <extends>QWidget</extends>
- <header>q3mainwindow.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
- <class>Q3ListBox</class>
- <extends>Q3Frame</extends>
- <header>q3listbox.h</header>
- </customwidget>
- <customwidget>
<class>ColorButton</class>
<extends></extends>
<header>colorbutton.h</header>
@@ -1357,28 +1309,80 @@ p, li { white-space: pre-wrap; }
</customwidget>
</customwidgets>
<tabstops>
- <tabstop>helpview</tabstop>
- <tabstop>familycombo</tabstop>
- <tabstop>stylecombo</tabstop>
- <tabstop>psizecombo</tabstop>
- <tabstop>samplelineedit</tabstop>
- <tabstop>familysubcombo</tabstop>
- <tabstop>PushButton2</tabstop>
- <tabstop>PushButton3</tabstop>
- <tabstop>PushButton4</tabstop>
- <tabstop>choosesubcombo</tabstop>
- <tabstop>PushButton1</tabstop>
- <tabstop>dcispin</tabstop>
- <tabstop>cfispin</tabstop>
- <tabstop>wslspin</tabstop>
- <tabstop>effectcheckbox</tabstop>
- <tabstop>menueffect</tabstop>
- <tabstop>comboeffect</tabstop>
- <tabstop>tooltipeffect</tabstop>
- <tabstop>strutwidth</tabstop>
- <tabstop>strutheight</tabstop>
- <tabstop>sublistbox</tabstop>
+ <tabstop>helpView</tabstop>
+ <tabstop>mainTabWidget</tabstop>
+ <tabstop>guiStyleCombo</tabstop>
+ <tabstop>tunePaletteButton</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>fontFamilyCombo</tabstop>
+ <tabstop>fontStyleCombo</tabstop>
+ <tabstop>pointSizeCombo</tabstop>
+ <tabstop>sampleLineEdit</tabstop>
+ <tabstop>familySubstitutionCombo</tabstop>
+ <tabstop>substitutionsListBox</tabstop>
+ <tabstop>upSubstitutionButton</tabstop>
+ <tabstop>downSubstitutionButton</tabstop>
+ <tabstop>removeSubstitutionButton</tabstop>
+ <tabstop>chooseSubstitutionCombo</tabstop>
+ <tabstop>addSubstitutionButton</tabstop>
+ <tabstop>doubleClickIntervalSpinBox</tabstop>
+ <tabstop>cursorFlashTimeSpinBox</tabstop>
+ <tabstop>wheelScrollLinesSpinBox</tabstop>
+ <tabstop>resolveLinksCheckBox</tabstop>
+ <tabstop>effectsCheckBox</tabstop>
+ <tabstop>menuEffectCombo</tabstop>
+ <tabstop>comboEffectCombo</tabstop>
+ <tabstop>toolTipEffectCombo</tabstop>
+ <tabstop>toolBoxEffectCombo</tabstop>
+ <tabstop>strutWidthSpinBox</tabstop>
+ <tabstop>strutHeightSpinBox</tabstop>
+ <tabstop>rtlExtensionsCheckBox</tabstop>
+ <tabstop>inputStyleCombo</tabstop>
+ <tabstop>inputMethodCombo</tabstop>
+ <tabstop>fontEmbeddingCheckBox</tabstop>
+ <tabstop>fontpathListBox</tabstop>
+ <tabstop>upFontpathButton</tabstop>
+ <tabstop>downFontpathButton</tabstop>
+ <tabstop>removeFontpathButton</tabstop>
+ <tabstop>fontPathLineEdit</tabstop>
+ <tabstop>browseFontPathButton</tabstop>
+ <tabstop>addFontPathButton</tabstop>
+ <tabstop>audiosinkCombo</tabstop>
+ <tabstop>videomodeCombo</tabstop>
</tabstops>
<resources/>
- <connections/>
+ <connections>
+ <connection>
+ <sender>effectsCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>effectsFrame</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>417</x>
+ <y>257</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>578</x>
+ <y>379</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>fontEmbeddingCheckBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>fontPathsGroup</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>449</x>
+ <y>69</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>447</x>
+ <y>94</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
diff --git a/tools/qtconfig/mainwindowbase.cpp b/tools/qtconfig/mainwindowbase.cpp
deleted file mode 100644
index efca58b..0000000
--- a/tools/qtconfig/mainwindowbase.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mainwindowbase.h"
-#include "colorbutton.h"
-#include "previewframe.h"
-
-#include <QVariant>
-#include <QImage>
-#include <QPixmap>
-
-QT_BEGIN_NAMESPACE
-
-/*
- * Constructs a MainWindowBase as a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- *
- */
-MainWindowBase::MainWindowBase(QWidget* parent, const char* name, Qt::WindowFlags fl)
- : Q3MainWindow(parent, name, fl)
-{
- setupUi(this);
-
- (void)statusBar();
-
- // signals and slots connections
- connect(fontpathlineedit, SIGNAL(returnPressed()), this, SLOT(addFontpath()));
- connect(PushButton15, SIGNAL(clicked()), this, SLOT(addFontpath()));
- connect(PushButton1, SIGNAL(clicked()), this, SLOT(addSubstitute()));
- connect(PushButton14, SIGNAL(clicked()), this, SLOT(browseFontpath()));
- connect(stylecombo, SIGNAL(activated(int)), this, SLOT(buildFont()));
- connect(psizecombo, SIGNAL(activated(int)), this, SLOT(buildFont()));
- connect(PushButton12, SIGNAL(clicked()), this, SLOT(downFontpath()));
- connect(PushButton3, SIGNAL(clicked()), this, SLOT(downSubstitute()));
- connect(familycombo, SIGNAL(activated(QString)), this, SLOT(familySelected(QString)));
- connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
- connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave()));
- connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
- connect(helpAboutQtAction, SIGNAL(activated()), this, SLOT(helpAboutQt()));
- connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), this, SLOT(pageChanged(QWidget*)));
- connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int)));
- connect(PushButton13, SIGNAL(clicked()), this, SLOT(removeFontpath()));
- connect(PushButton4, SIGNAL(clicked()), this, SLOT(removeSubstitute()));
- connect(effectcheckbox, SIGNAL(toggled(bool)), effectbase, SLOT(setEnabled(bool)));
- connect(fontembeddingcheckbox, SIGNAL(toggled(bool)), GroupBox10, SLOT(setEnabled(bool)));
- connect(toolboxeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(dcispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
- connect(cfispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
- connect(wslspin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
- connect(menueffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(comboeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(audiosinkCombo, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(videomodeCombo, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(tooltipeffect, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(strutwidth, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
- connect(strutheight, SIGNAL(valueChanged(int)), this, SLOT(somethingModified()));
- connect(effectcheckbox, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
- connect(resolvelinks, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
- connect(fontembeddingcheckbox, SIGNAL(clicked()), this, SLOT(somethingModified()));
- connect(rtlExtensions, SIGNAL(toggled(bool)), this, SLOT(somethingModified()));
- connect(inputStyle, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(inputMethod, SIGNAL(activated(int)), this, SLOT(somethingModified()));
- connect(gstylecombo, SIGNAL(activated(QString)), this, SLOT(styleSelected(QString)));
- connect(familysubcombo, SIGNAL(activated(QString)), this, SLOT(substituteSelected(QString)));
- connect(btnAdvanced, SIGNAL(clicked()), this, SLOT(tunePalette()));
- connect(PushButton11, SIGNAL(clicked()), this, SLOT(upFontpath()));
- connect(PushButton2, SIGNAL(clicked()), this, SLOT(upSubstitute()));
- init();
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-MainWindowBase::~MainWindowBase()
-{
- destroy();
- // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- * Sets the strings of the subwidgets using the current
- * language.
- */
-void MainWindowBase::languageChange()
-{
- retranslateUi(this);
-}
-
-void MainWindowBase::init()
-{
-}
-
-void MainWindowBase::destroy()
-{
-}
-
-void MainWindowBase::addFontpath()
-{
- qWarning("MainWindowBase::addFontpath(): Not implemented yet");
-}
-
-void MainWindowBase::addSubstitute()
-{
- qWarning("MainWindowBase::addSubstitute(): Not implemented yet");
-}
-
-void MainWindowBase::browseFontpath()
-{
- qWarning("MainWindowBase::browseFontpath(): Not implemented yet");
-}
-
-void MainWindowBase::buildFont()
-{
- qWarning("MainWindowBase::buildFont(): Not implemented yet");
-}
-
-void MainWindowBase::buildPalette()
-{
- qWarning("MainWindowBase::buildPalette(): Not implemented yet");
-}
-
-void MainWindowBase::downFontpath()
-{
- qWarning("MainWindowBase::downFontpath(): Not implemented yet");
-}
-
-void MainWindowBase::downSubstitute()
-{
- qWarning("MainWindowBase::downSubstitute(): Not implemented yet");
-}
-
-void MainWindowBase::familySelected( const QString &)
-{
- qWarning("MainWindowBase::familySelected( const QString &): Not implemented yet");
-}
-
-void MainWindowBase::fileExit()
-{
- qWarning("MainWindowBase::fileExit(): Not implemented yet");
-}
-
-void MainWindowBase::fileSave()
-{
- qWarning("MainWindowBase::fileSave(): Not implemented yet");
-}
-
-void MainWindowBase::helpAbout()
-{
- qWarning("MainWindowBase::helpAbout(): Not implemented yet");
-}
-
-void MainWindowBase::helpAboutQt()
-{
- qWarning("MainWindowBase::helpAboutQt(): Not implemented yet");
-}
-
-void MainWindowBase::new_slot()
-{
- qWarning("MainWindowBase::new_slot(): Not implemented yet");
-}
-
-void MainWindowBase::pageChanged( QWidget *)
-{
- qWarning("MainWindowBase::pageChanged( QWidget *): Not implemented yet");
-}
-
-void MainWindowBase::paletteSelected(int)
-{
- qWarning("MainWindowBase::paletteSelected(int): Not implemented yet");
-}
-
-void MainWindowBase::removeFontpath()
-{
- qWarning("MainWindowBase::removeFontpath(): Not implemented yet");
-}
-
-void MainWindowBase::removeSubstitute()
-{
- qWarning("MainWindowBase::removeSubstitute(): Not implemented yet");
-}
-
-void MainWindowBase::somethingModified()
-{
- qWarning("MainWindowBase::somethingModified(): Not implemented yet");
-}
-
-void MainWindowBase::styleSelected( const QString &)
-{
- qWarning("MainWindowBase::styleSelected( const QString &): Not implemented yet");
-}
-
-void MainWindowBase::substituteSelected( const QString &)
-{
- qWarning("MainWindowBase::substituteSelected( const QString &): Not implemented yet");
-}
-
-void MainWindowBase::tunePalette()
-{
- qWarning("MainWindowBase::tunePalette(): Not implemented yet");
-}
-
-void MainWindowBase::upFontpath()
-{
- qWarning("MainWindowBase::upFontpath(): Not implemented yet");
-}
-
-void MainWindowBase::upSubstitute()
-{
- qWarning("MainWindowBase::upSubstitute(): Not implemented yet");
-}
-
-QT_END_NAMESPACE
diff --git a/tools/qtconfig/mainwindowbase.h b/tools/qtconfig/mainwindowbase.h
deleted file mode 100644
index 97c6716..0000000
--- a/tools/qtconfig/mainwindowbase.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOWBASE_H
-#define MAINWINDOWBASE_H
-
-#include "ui_mainwindowbase.h"
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class ColorButton;
-class PreviewFrame;
-
-class MainWindowBase : public Q3MainWindow, public Ui::MainWindowBase
-{
- Q_OBJECT
-
-public:
- MainWindowBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::Window);
- ~MainWindowBase();
-
-public slots:
- virtual void addFontpath();
- virtual void addSubstitute();
- virtual void browseFontpath();
- virtual void buildFont();
- virtual void buildPalette();
- virtual void downFontpath();
- virtual void downSubstitute();
- virtual void familySelected( const QString & );
- virtual void fileExit();
- virtual void fileSave();
- virtual void helpAbout();
- virtual void helpAboutQt();
- virtual void new_slot();
- virtual void pageChanged( QWidget * );
- virtual void paletteSelected( int );
- virtual void removeFontpath();
- virtual void removeSubstitute();
- virtual void somethingModified();
- virtual void styleSelected( const QString & );
- virtual void substituteSelected( const QString & );
- virtual void tunePalette();
- virtual void upFontpath();
- virtual void upSubstitute();
-
-protected slots:
- virtual void languageChange();
-
- virtual void init();
- virtual void destroy();
-};
-
-QT_END_NAMESPACE
-
-#endif // MAINWINDOWBASE_H
diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp
index 5f28413..4797ead 100644
--- a/tools/qtconfig/paletteeditoradvanced.cpp
+++ b/tools/qtconfig/paletteeditoradvanced.cpp
@@ -38,58 +38,74 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
+#include "ui_paletteeditoradvanced.h"
#include "paletteeditoradvanced.h"
#include "colorbutton.h"
-#include <QCheckBox>
-#include <QComboBox>
-#include <QApplication>
-#include <QPushButton>
-#include <QPainter>
-#include <QGroupBox>
-
QT_BEGIN_NAMESPACE
-PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent,
- const char * name, bool modal, Qt::WindowFlags f )
- : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0)
+PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent)
+ : QDialog(parent), ui(new Ui::PaletteEditorAdvanced), selectedPalette(0)
{
- // work around buggy UI file
- comboEffect->setEnabled(false);
+ 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();
- setPreviewPalette( editPalette );
}
PaletteEditorAdvanced::~PaletteEditorAdvanced()
{
+ delete ui;
}
-void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
+void PaletteEditorAdvanced::onToggleBuildInactive(bool v)
{
if (selectedPalette == 1) {
- groupCentral->setDisabled(v);
- groupEffect->setDisabled(v);
+ ui->groupCentral->setDisabled(v);
+ ui->groupEffect->setDisabled(v);
}
if (v) {
- buildInactive();
+ build(QPalette::Inactive);
updateColorButtons();
}
}
-void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
+void PaletteEditorAdvanced::onToggleBuildDisabled(bool v)
{
if (selectedPalette == 2) {
- groupCentral->setDisabled(v);
- groupEffect->setDisabled(v);
+ ui->groupCentral->setDisabled(v);
+ ui->groupEffect->setDisabled(v);
}
if (v) {
- buildDisabled();
+ build(QPalette::Disabled);
updateColorButtons();
}
}
@@ -99,402 +115,204 @@ 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);
+ 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()
{
- switch(selectedPalette) {
- case 0:
- default:
- mapToActiveCentralRole( buttonCentral->color() );
- break;
- case 1:
- mapToInactiveCentralRole( buttonCentral->color() );
- break;
- case 2:
- mapToDisabledCentralRole( buttonCentral->color() );
- break;
+ 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()
{
- switch(selectedPalette) {
- case 0:
- default:
- mapToActiveEffectRole( buttonEffect->color() );
- break;
- case 1:
- mapToInactiveEffectRole( buttonEffect->color() );
- break;
- case 2:
- mapToDisabledEffectRole( buttonEffect->color() );
- break;
+ 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) return;
- buildActiveEffect();
- buildInactiveEffect();
- buildDisabledEffect();
+ updateColorButtons();
}
-QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+void PaletteEditorAdvanced::onToggleBuildEffects(bool on)
{
- switch( item ) {
- case 0:
- return QColorGroup::Window;
- case 1:
- return QColorGroup::WindowText;
- 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;
+ if (on) {
+ for (int i = 0; i < QPalette::NColorGroups; i++)
+ buildEffect(QPalette::ColorGroup(i));
}
}
-QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
-
+QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item)
{
- switch( item ) {
+ switch (item) {
case 0:
- return QColorGroup::Light;
+ default:
+ return QPalette::Active;
case 1:
- return QColorGroup::Midlight;
+ return QPalette::Inactive;
case 2:
- return QColorGroup::Mid;
- case 3:
- return QColorGroup::Dark;
- case 4:
- return QColorGroup::Shadow;
- default:
- return QColorGroup::NColorRoles;
+ return QPalette::Disabled;
}
}
-void PaletteEditorAdvanced::onCentral( int item )
+QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item)
{
- QColor c;
-
- switch(selectedPalette) {
+ switch (item) {
case 0:
- default:
- c = editPalette.active().color( centralFromItem(item) );
- break;
+ return QPalette::Window;
case 1:
- c = editPalette.inactive().color( centralFromItem(item) );
- break;
+ return QPalette::WindowText;
case 2:
- c = editPalette.disabled().color( centralFromItem(item) );
- break;
+ 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;
}
-
- buttonCentral->setColor(c);
}
-void PaletteEditorAdvanced::onEffect( int item )
+QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item)
{
- QColor c;
- switch(selectedPalette) {
+ switch (item) {
case 0:
- default:
- c = editPalette.active().color( effectFromItem(item) );
- break;
+ return QPalette::Light;
case 1:
- editPalette.inactive().color( effectFromItem(item) );
- break;
+ return QPalette::Midlight;
case 2:
- editPalette.disabled().color( effectFromItem(item) );
- break;
+ return QPalette::Mid;
+ case 3:
+ return QPalette::Dark;
+ case 4:
+ return QPalette::Shadow;
+ default:
+ return QPalette::NoRole;
}
- 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 )
+void PaletteEditorAdvanced::onCentral(int item)
{
- 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 );
+ QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item));
+ buttonCentral->setColor(c);
}
-void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm )
+void PaletteEditorAdvanced::onEffect(int item)
{
- 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 );
+ QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item));
+ buttonEffect->setColor(c);
}
-void PaletteEditorAdvanced::buildActiveEffect()
+QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup,
+ const QPalette &basePalette)
{
- 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) ) );
+ QPalette result(basePalette);
- editPalette.setActive( cg );
- setPreviewPalette( editPalette );
+ if (colorGroup == QPalette::Active) {
+ QPalette calculatedPalette(basePalette.color(colorGroup, QPalette::Button),
+ basePalette.color(colorGroup, QPalette::Window));
- updateColorButtons();
-}
+ 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);
-void PaletteEditorAdvanced::buildInactive()
-{
- editPalette.setInactive( editPalette.active() );
- if ( checkBuildEffect->isChecked() )
- buildInactiveEffect();
- else {
- setPreviewPalette( editPalette );
- updateColorButtons();
+ 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::buildInactiveEffect()
+void PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup)
{
- 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 = Qt::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 );
+ editPalette = buildEffect(colorGroup, editPalette);
updateColorButtons();
}
-void PaletteEditorAdvanced::buildDisabled()
+void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup)
{
- QColorGroup cg = editPalette.active();
- cg.setColor( QColorGroup::ButtonText, Qt::darkGray );
- cg.setColor( QColorGroup::WindowText, Qt::darkGray );
- cg.setColor( QColorGroup::Text, Qt::darkGray );
- cg.setColor( QColorGroup::HighlightedText, Qt::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 = Qt::black;
+ 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)));
- 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 );
+ 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);
+ }
- 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;
+ if (ui->checkBuildEffect->isChecked())
+ buildEffect(colorGroup);
+ else
+ updateColorButtons();
}
- 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);
+ 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 )
+void PaletteEditorAdvanced::setPal(const QPalette &pal)
{
editPalette = pal;
- setPreviewPalette( pal );
updateColorButtons();
}
@@ -503,51 +321,51 @@ QPalette PaletteEditorAdvanced::pal() const
return editPalette;
}
-void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode )
+void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role)
{
int initRole = 0;
- switch( mode ) {
- case Qt::PaletteBackground:
+ switch (role) {
+ case QPalette::Window:
initRole = 0;
break;
- case Qt::PaletteForeground:
+ case QPalette::WindowText:
initRole = 1;
break;
- case Qt::PaletteButton:
+ case QPalette::Base:
initRole = 2;
break;
- case Qt::PaletteBase:
+ case QPalette::AlternateBase:
initRole = 3;
break;
- case Qt::PaletteText:
+ case QPalette::ToolTipBase:
initRole = 4;
break;
- case Qt::PaletteBrightText:
+ case QPalette::ToolTipText:
initRole = 5;
break;
- case Qt::PaletteButtonText:
+ case QPalette::Text:
initRole = 6;
break;
- case Qt::PaletteHighlight:
+ case QPalette::Button:
initRole = 7;
break;
- case Qt::PaletteHighlightedText:
+ case QPalette::ButtonText:
initRole = 8;
break;
- case Qt::PaletteLight:
+ case QPalette::BrightText:
initRole = 9;
break;
- case Qt::PaletteMidlight:
+ case QPalette::Highlight:
initRole = 10;
break;
- case Qt::PaletteDark:
+ case QPalette::HighlightedText:
initRole = 11;
break;
- case Qt::PaletteMid:
+ case QPalette::Link:
initRole = 12;
break;
- case Qt::PaletteShadow:
+ case QPalette::LinkVisited:
initRole = 13;
break;
default:
@@ -555,36 +373,27 @@ void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode )
break;
}
- if ( initRole <= -1 ) return;
-
- if (initRole > 8 ) {
- comboEffect->setCurrentItem( initRole - 9 );
- }
- else {
- comboCentral->setCurrentItem( initRole );
- }
+ if (initRole != -1)
+ ui->comboCentral->setCurrentIndex(initRole);
}
-QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init,
- Qt::BackgroundMode mode, QWidget* parent,
- const char* name )
+QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init,
+ QPalette::ColorRole backgroundRole, QWidget *parent)
{
- PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( parent, name, true );
- dlg->setupBackgroundMode( mode );
+ PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent);
+ dlg->setupBackgroundRole(backgroundRole);
- if ( init != QPalette() )
- dlg->setPal( init );
+ if (init != QPalette())
+ dlg->setPal(init);
int resultCode = dlg->exec();
QPalette result = init;
- if ( resultCode == QDialog::Accepted ) {
- if ( ok )
- *ok = true;
+ if (resultCode == QDialog::Accepted)
result = dlg->pal();
- } else {
- if ( ok )
- *ok = false;
- }
+
+ if (ok)
+ *ok = resultCode;
+
delete dlg;
return result;
}
diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h
index 83bcebb..4f61676 100644
--- a/tools/qtconfig/paletteeditoradvanced.h
+++ b/tools/qtconfig/paletteeditoradvanced.h
@@ -42,69 +42,65 @@
#ifndef PALETTEEDITORADVANCED_H
#define PALETTEEDITORADVANCED_H
-#include "paletteeditoradvancedbase.h"
+#include <QtGui/QDialog>
QT_BEGIN_NAMESPACE
-class PaletteEditorAdvanced : public PaletteEditorAdvancedBase
+namespace Ui {
+ class PaletteEditorAdvanced;
+}
+
+class ColorButton;
+
+class PaletteEditorAdvanced : public QDialog
{
Q_OBJECT
public:
- PaletteEditorAdvanced( QWidget * parent=0, const char * name=0,
- bool modal=false, Qt::WindowFlags f=0 );
+ PaletteEditorAdvanced(QWidget *parent = 0);
~PaletteEditorAdvanced();
- static QPalette getPalette( bool *ok, const QPalette &pal, Qt::BackgroundMode mode = Qt::PaletteBackground,
- QWidget* parent = 0, const char* name = 0 );
+ 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 onCentral(int);
+ void onEffect(int);
void onChooseCentralColor();
void onChooseEffectColor();
- void onToggleBuildEffects( bool );
- void onToggleBuildInactive( bool );
- void onToggleBuildDisabled( bool );
+ 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();
+ void buildEffect(QPalette::ColorGroup);
+ void build(QPalette::ColorGroup);
private:
- void setPreviewPalette( const QPalette& );
void updateColorButtons();
- void setupBackgroundMode( Qt::BackgroundMode );
+ void setupBackgroundRole(QPalette::ColorRole);
QPalette pal() const;
- void setPal( const QPalette& );
+ void setPal(const QPalette &);
- QColorGroup::ColorRole centralFromItem( int );
- QColorGroup::ColorRole effectFromItem( int );
+ static QPalette::ColorGroup groupFromIndex(int);
+ static QPalette::ColorRole centralFromIndex(int);
+ static QPalette::ColorRole effectFromIndex(int);
QPalette editPalette;
- QPalette previewPalette;
+
+ Ui::PaletteEditorAdvanced *ui;
int selectedPalette;
+ ColorButton *buttonCentral;
+ ColorButton *buttonEffect;
};
QT_END_NAMESPACE
-#endif
+#endif // PALETTEEDITORADVANCED_H
diff --git a/tools/qtconfig/paletteeditoradvanced.ui b/tools/qtconfig/paletteeditoradvanced.ui
new file mode 100644
index 0000000..b1d6b95
--- /dev/null
+++ b/tools/qtconfig/paletteeditoradvanced.ui
@@ -0,0 +1,416 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>*********************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** 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 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+*********************************************************************</comment>
+ <class>PaletteEditorAdvanced</class>
+ <widget class="QDialog" name="PaletteEditorAdvanced">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>239</width>
+ <height>344</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Tune Palette</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="paletteComboLabel">
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="paletteCombo">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="autoGroupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Auto</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="checkBuildInactive">
+ <property name="text">
+ <string>Build inactive palette from active</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBuildDisabled">
+ <property name="text">
+ <string>Build disabled palette from active</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupCentral">
+ <property name="title">
+ <string>Central color &amp;roles</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QComboBox" name="comboCentral">
+ <property name="toolTip">
+ <string>Choose central color role</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central roles are: &lt;ul&gt; &lt;li&gt;Window - general background color.&lt;/li&gt; &lt;li&gt;WindowText - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li&gt; &lt;li&gt;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. &lt;/li&gt; &lt;li&gt;Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>WindowText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Base</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>AlternateBase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ToolTipBase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ToolTipText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ButtonText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BrightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Highlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>HighlightedText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Link</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LinkVisited</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="layoutCentral">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelCentral">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&amp;Select Color:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupEffect">
+ <property name="title">
+ <string>3-D shadow &amp;effects</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="checkBuildEffect">
+ <property name="toolTip">
+ <string>Generate shadings</string>
+ </property>
+ <property name="whatsThis">
+ <string>Check to let 3D-effect colors be calculated from button-color.</string>
+ </property>
+ <property name="text">
+ <string>Build &amp;from button color</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboEffect">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Choose 3D-effect color role</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Light</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Midlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mid</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dark</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shadow</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="layoutEffect">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelEffect">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Select Co&amp;lor:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>PaletteEditorAdvanced</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>238</x>
+ <y>384</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>PaletteEditorAdvanced</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>306</x>
+ <y>390</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>82</x>
+ <y>262</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>190</x>
+ <y>262</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tools/qtconfig/paletteeditoradvancedbase.cpp b/tools/qtconfig/paletteeditoradvancedbase.cpp
deleted file mode 100644
index 55a03b7..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "paletteeditoradvancedbase.h"
-#include "colorbutton.h"
-
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-/*
- * Constructs a PaletteEditorAdvancedBase as a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- *
- * The dialog will by default be modeless, unless you set 'modal' to
- * true to construct a modal dialog.
- */
-PaletteEditorAdvancedBase::PaletteEditorAdvancedBase(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
- : QDialog(parent, name, modal, fl)
-{
- setupUi(this);
-
-
- // signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
- connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int)));
- connect(comboCentral, SIGNAL(activated(int)), this, SLOT(onCentral(int)));
- connect(buttonCentral, SIGNAL(clicked()), this, SLOT(onChooseCentralColor()));
- connect(buttonEffect, SIGNAL(clicked()), this, SLOT(onChooseEffectColor()));
- connect(comboEffect, SIGNAL(activated(int)), this, SLOT(onEffect(int)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildEffects(bool)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), comboEffect, SLOT(setDisabled(bool)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool)));
- connect(checkBuildInactive, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildInactive(bool)));
- connect(checkBuildDisabled, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildDisabled(bool)));
- init();
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-PaletteEditorAdvancedBase::~PaletteEditorAdvancedBase()
-{
- destroy();
- // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- * Sets the strings of the subwidgets using the current
- * language.
- */
-void PaletteEditorAdvancedBase::languageChange()
-{
- retranslateUi(this);
-}
-
-void PaletteEditorAdvancedBase::init()
-{
-}
-
-void PaletteEditorAdvancedBase::destroy()
-{
-}
-
-void PaletteEditorAdvancedBase::onCentral(int)
-{
- qWarning("PaletteEditorAdvancedBase::onCentral(int): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onChooseCentralColor()
-{
- qWarning("PaletteEditorAdvancedBase::onChooseCentralColor(): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onChooseEffectColor()
-{
- qWarning("PaletteEditorAdvancedBase::onChooseEffectColor(): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onEffect(int)
-{
- qWarning("PaletteEditorAdvancedBase::onEffect(int): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildDisabled(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildDisabled(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildEffects(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildEffects(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildInactive(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildInactive(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::paletteSelected(int)
-{
- qWarning("PaletteEditorAdvancedBase::paletteSelected(int): Not implemented yet");
-}
-
-QT_END_NAMESPACE
diff --git a/tools/qtconfig/paletteeditoradvancedbase.h b/tools/qtconfig/paletteeditoradvancedbase.h
deleted file mode 100644
index c097382..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PALETTEEDITORADVANCEDBASE_H
-#define PALETTEEDITORADVANCEDBASE_H
-
-#include "ui_paletteeditoradvancedbase.h"
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class ColorButton;
-
-class PaletteEditorAdvancedBase : public QDialog, public Ui::PaletteEditorAdvancedBase
-{
- Q_OBJECT
-
-public:
- PaletteEditorAdvancedBase(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
- ~PaletteEditorAdvancedBase();
-
-protected slots:
- virtual void languageChange();
-
- virtual void init();
- virtual void destroy();
- virtual void onCentral(int);
- virtual void onChooseCentralColor();
- virtual void onChooseEffectColor();
- virtual void onEffect(int);
- virtual void onToggleBuildDisabled(bool);
- virtual void onToggleBuildEffects(bool);
- virtual void onToggleBuildInactive(bool);
- virtual void paletteSelected(int);
-
-};
-
-QT_END_NAMESPACE
-
-#endif // PALETTEEDITORADVANCEDBASE_H
diff --git a/tools/qtconfig/paletteeditoradvancedbase.ui b/tools/qtconfig/paletteeditoradvancedbase.ui
deleted file mode 100644
index 8965960..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.ui
+++ /dev/null
@@ -1,617 +0,0 @@
-<ui version="4.0" stdsetdef="1" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
- <exportmacro></exportmacro>
- <class>PaletteEditorAdvancedBase</class>
- <widget class="QDialog" name="PaletteEditorAdvancedBase" >
- <property name="objectName" >
- <string notr="true" >PaletteEditorAdvancedBase</string>
- </property>
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>295</width>
- <height>346</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Tune Palette</string>
- </property>
- <property name="sizeGripEnabled" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Edit Palette&lt;/b>&lt;p>Change the palette of the current widget or form.&lt;/p>&lt;p>Use a generated palette or select colors for each color group and each color role.&lt;/p>&lt;p>The palette can be tested with different widget layouts in the preview section.&lt;/p></string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="TextLabel1" >
- <property name="objectName" >
- <string notr="true" >TextLabel1</string>
- </property>
- <property name="text" >
- <string>Select &amp;Palette:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>paletteCombo</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="paletteCombo" >
- <property name="objectName" >
- <string notr="true" >paletteCombo</string>
- </property>
- <item>
- <property name="text" >
- <string>Active Palette</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Inactive Palette</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Disabled Palette</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="Q3ButtonGroup" name="ButtonGroup1" >
- <property name="objectName" >
- <string notr="true" >ButtonGroup1</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>4</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>Auto</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="checkBuildInactive" >
- <property name="objectName" >
- <string notr="true" >checkBuildInactive</string>
- </property>
- <property name="text" >
- <string>Build inactive palette from active</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBuildDisabled" >
- <property name="objectName" >
- <string notr="true" >checkBuildDisabled</string>
- </property>
- <property name="text" >
- <string>Build disabled palette from active</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="Q3GroupBox" name="groupCentral" >
- <property name="objectName" >
- <string notr="true" >groupCentral</string>
- </property>
- <property name="title" >
- <string>Central color &amp;roles</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QComboBox" name="comboCentral" >
- <property name="objectName" >
- <string notr="true" >comboCentral</string>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose central color role</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Select a color role.&lt;/b>&lt;p>Available central roles are: &lt;ul> &lt;li>Window - general background color.&lt;/li> &lt;li>WindowText - general foreground color. &lt;/li> &lt;li>Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li> &lt;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. &lt;/li> &lt;li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. &lt;/li> &lt;li>ButtonText - a foreground color used with the Button color. &lt;/li> &lt;li>Highlight - a color to indicate a selected or highlighted item. &lt;/li> &lt;li>HighlightedText - a text color that contrasts to Highlight. &lt;/li> &lt;li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. &lt;/li> &lt;/ul> &lt;/p></string>
- </property>
- <item>
- <property name="text" >
- <string>Window</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>WindowText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Button</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Base</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Text</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>BrightText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>ButtonText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Highlight</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>HighlightedText</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing1" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="labelCentral" >
- <property name="objectName" >
- <string notr="true" >labelCentral</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>&amp;Select Color:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>buttonCentral</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ColorButton" name="buttonCentral" >
- <property name="objectName" >
- <string notr="true" >buttonCentral</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose a color</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Choose a color for the selected central color role.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="Q3GroupBox" name="groupEffect" >
- <property name="objectName" >
- <string notr="true" >groupEffect</string>
- </property>
- <property name="title" >
- <string>3-D shadow &amp;effects</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="checkBuildEffect" >
- <property name="objectName" >
- <string notr="true" >checkBuildEffect</string>
- </property>
- <property name="text" >
- <string>Build &amp;from button color</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Generate shadings</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Check to let 3D-effect colors be calculated from button-color.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboEffect" >
- <property name="objectName" >
- <string notr="true" >comboEffect</string>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose 3D-effect color role</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Select a color role.&lt;/b>&lt;p>Available effect roles are: &lt;ul> &lt;li>Light - lighter than Button color. &lt;/li> &lt;li>Midlight - between Button and Light. &lt;/li> &lt;li>Mid - between Button and Dark. &lt;/li> &lt;li>Dark - darker than Button. &lt;/li> &lt;li>Shadow - a very dark color. &lt;/li> &lt;/ul></string>
- </property>
- <item>
- <property name="text" >
- <string>Light</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Midlight</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Mid</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Dark</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Shadow</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing3" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="labelEffect" >
- <property name="objectName" >
- <string notr="true" >labelEffect</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>Select Co&amp;lor:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>buttonEffect</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ColorButton" name="buttonEffect" >
- <property name="objectName" >
- <string notr="true" >buttonEffect</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose a color</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Choose a color for the selected effect color role.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing2" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="buttonOk" >
- <property name="objectName" >
- <string notr="true" >buttonOk</string>
- </property>
- <property name="text" >
- <string>OK</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Close dialog and apply all changes.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="buttonCancel" >
- <property name="objectName" >
- <string notr="true" >buttonCancel</string>
- </property>
- <property name="text" >
- <string>Cancel</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Close dialog and discard all changes.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <pixmapfunction></pixmapfunction>
- <customwidgets>
- <customwidget>
- <class>ColorButton</class>
- <extends></extends>
- <header location="local" >colorbutton.h</header>
- <sizehint>
- <width>40</width>
- <height>25</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- <properties>
- <property type="Color" >color</property>
- <property type="Pixmap" >pixmap</property>
- </properties>
- </customwidget>
- </customwidgets>
- <tabstops>
- <tabstop>buttonOk</tabstop>
- <tabstop>buttonCancel</tabstop>
- <tabstop>paletteCombo</tabstop>
- <tabstop>checkBuildInactive</tabstop>
- <tabstop>checkBuildDisabled</tabstop>
- <tabstop>comboCentral</tabstop>
- <tabstop>buttonCentral</tabstop>
- <tabstop>checkBuildEffect</tabstop>
- <tabstop>comboEffect</tabstop>
- <tabstop>buttonEffect</tabstop>
- </tabstops>
- <images>
- <image name="image0" >
- <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
- </image>
- </images>
-</ui>
diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp
index 2d7b113..c6df899 100644
--- a/tools/qtconfig/previewframe.cpp
+++ b/tools/qtconfig/previewframe.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "previewframe.h"
+#include "previewwidget.h"
#include <QBoxLayout>
#include <QPainter>
@@ -47,8 +48,8 @@
QT_BEGIN_NAMESPACE
-PreviewFrame::PreviewFrame( QWidget *parent, const char *name )
- : QFrame( parent, name )
+PreviewFrame::PreviewFrame(QWidget *parent)
+ : QFrame(parent)
{
setMinimumSize(200, 200);
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
@@ -82,23 +83,22 @@ void PreviewFrame::setPreviewVisible(bool visible)
workspace->viewport()->update();
}
-Workspace::Workspace(PreviewFrame* parent, const char* name)
+Workspace::Workspace(PreviewFrame *parent)
: QMdiArea(parent)
{
previewFrame = parent;
PreviewWidget *previewWidget = previewFrame->widget();
- setObjectName(QLatin1String(name));
QMdiSubWindow *frame = addSubWindow(previewWidget, Qt::Window);
- frame->move(10,10);
+ frame->move(10, 10);
frame->show();
}
-void Workspace::paintEvent( QPaintEvent* )
+void Workspace::paintEvent(QPaintEvent *)
{
- QPainter p (viewport());
+ 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());
+ p.setPen(QPen(Qt::white));
+ p.drawText(0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText());
}
QT_END_NAMESPACE
diff --git a/tools/qtconfig/previewframe.h b/tools/qtconfig/previewframe.h
index cd7bd0b..5cb0d59 100644
--- a/tools/qtconfig/previewframe.h
+++ b/tools/qtconfig/previewframe.h
@@ -42,8 +42,6 @@
#ifndef PREVIEWFRAME_H
#define PREVIEWFRAME_H
-#include "previewwidget.h"
-
#include <QMdiArea>
QT_BEGIN_NAMESPACE
@@ -54,28 +52,29 @@ class Workspace : public QMdiArea
Q_OBJECT
public:
- Workspace( PreviewFrame* parent = 0, const char* name = 0 );
+ Workspace(PreviewFrame *parent = 0);
~Workspace() {}
protected:
- void paintEvent( QPaintEvent* );
+ void paintEvent(QPaintEvent *);
private:
PreviewFrame *previewFrame;
};
+class PreviewWidget;
class PreviewFrame : public QFrame
{
Q_OBJECT
public:
- PreviewFrame( QWidget *parent = 0, const char *name = 0 );
+ PreviewFrame(QWidget *parent = 0);
void setPreviewPalette(QPalette);
void setPreviewVisible(bool val);
QString previewText() const;
PreviewWidget *widget() const { return previewWidget; }
private:
- Workspace *workspace;
- PreviewWidget *previewWidget;
+ Workspace *workspace;
+ PreviewWidget *previewWidget;
QString m_previewWindowText;
};
diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp
index 71cef23..66ebb92 100644
--- a/tools/qtconfig/previewwidget.cpp
+++ b/tools/qtconfig/previewwidget.cpp
@@ -40,32 +40,32 @@
****************************************************************************/
#include "previewwidget.h"
+#include "ui_previewwidget.h"
#include <QtEvents>
QT_BEGIN_NAMESPACE
-PreviewWidget::PreviewWidget( QWidget *parent, const char *name )
- : PreviewWidgetBase( parent, name )
+PreviewWidget::PreviewWidget(QWidget *parent)
+ : QWidget(parent), ui(new Ui::PreviewWidget)
{
+ ui->setupUi(this);
+
// install event filter on child widgets
- QObjectList l = queryList("QWidget");
- for (int i = 0; i < l.size(); ++i) {
- QObject * obj = l.at(i);
- obj->installEventFilter(this);
- ((QWidget*)obj)->setFocusPolicy(Qt::NoFocus);
+ QList<QWidget *> l = findChildren<QWidget *>();
+ foreach(QWidget *w, l) {
+ w->installEventFilter(this);
+ w->setFocusPolicy(Qt::NoFocus);
}
}
-
-void PreviewWidget::closeEvent(QCloseEvent *e)
+PreviewWidget::~PreviewWidget()
{
- e->ignore();
+ delete ui;
}
-
bool PreviewWidget::eventFilter(QObject *, QEvent *e)
{
- switch ( e->type() ) {
+ switch (e->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:
@@ -81,4 +81,9 @@ bool PreviewWidget::eventFilter(QObject *, QEvent *e)
return false;
}
+void PreviewWidget::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
QT_END_NAMESPACE
diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h
index a6ec5b3..d39fd75 100644
--- a/tools/qtconfig/previewwidget.h
+++ b/tools/qtconfig/previewwidget.h
@@ -42,21 +42,29 @@
#ifndef PREVIEWWIDGET_H
#define PREVIEWWIDGET_H
-#include "previewwidgetbase.h"
+#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
-class PreviewWidget : public PreviewWidgetBase
+namespace Ui {
+ class PreviewWidget;
+}
+
+
+class PreviewWidget : public QWidget
{
Q_OBJECT
public:
- PreviewWidget( QWidget *parent = 0, const char *name = 0 );
+ PreviewWidget(QWidget *parent = 0);
+ ~PreviewWidget();
- void closeEvent(QCloseEvent *);
bool eventFilter(QObject *, QEvent *);
+private:
+ void closeEvent(QCloseEvent *);
+ Ui::PreviewWidget *ui;
};
QT_END_NAMESPACE
-#endif
+#endif // PREVIEWWIDGET_H
diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui
new file mode 100644
index 0000000..2e0789f
--- /dev/null
+++ b/tools/qtconfig/previewwidget.ui
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>*********************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** 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 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+*********************************************************************</comment>
+ <class>PreviewWidget</class>
+ <widget class="QWidget" name="PreviewWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>398</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle">
+ <string>Preview Window</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="GroupBox1">
+ <property name="title">
+ <string>GroupBox</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <item>
+ <widget class="QRadioButton" name="RadioButton1">
+ <property name="text">
+ <string>RadioButton1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="RadioButton2">
+ <property name="text">
+ <string>RadioButton2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="RadioButton3">
+ <property name="text">
+ <string>RadioButton3</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="GroupBox2">
+ <property name="title">
+ <string>GroupBox2</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="CheckBox1">
+ <property name="text">
+ <string>CheckBox1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="CheckBox2">
+ <property name="text">
+ <string>CheckBox2</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="ProgressBar1">
+ <property name="value">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="LineEdit1">
+ <property name="text">
+ <string>LineEdit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="ComboBox1">
+ <item>
+ <property name="text">
+ <string>ComboBox</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QSpinBox" name="SpinBox1"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="PushButton1">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QScrollBar" name="ScrollBar1">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="Slider1">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textView">
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string>&lt;p&gt;&lt;a href=&quot;http://qt.nokia.com&quot;&gt;http://qt.nokia.com&lt;/a&gt;&lt;/p&gt;
+&lt;p&gt;&lt;a href=&quot;http://www.kde.org&quot;&gt;http://www.kde.org&lt;/a&gt;&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="Spacer2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tools/qtconfig/previewwidgetbase.cpp b/tools/qtconfig/previewwidgetbase.cpp
deleted file mode 100644
index c156c32..0000000
--- a/tools/qtconfig/previewwidgetbase.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "previewwidgetbase.h"
-
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-/*
- * Constructs a PreviewWidgetBase as a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- */
-PreviewWidgetBase::PreviewWidgetBase(QWidget* parent, const char* name, Qt::WindowFlags fl)
- : QWidget(parent, name, fl)
-{
- setupUi(this);
-
-
- // signals and slots connections
- init();
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-PreviewWidgetBase::~PreviewWidgetBase()
-{
- destroy();
- // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- * Sets the strings of the subwidgets using the current
- * language.
- */
-void PreviewWidgetBase::languageChange()
-{
- retranslateUi(this);
-}
-
-void PreviewWidgetBase::init()
-{
-}
-
-void PreviewWidgetBase::destroy()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/tools/qtconfig/previewwidgetbase.h b/tools/qtconfig/previewwidgetbase.h
deleted file mode 100644
index 624e612..0000000
--- a/tools/qtconfig/previewwidgetbase.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PREVIEWWIDGETBASE_H
-#define PREVIEWWIDGETBASE_H
-
-#include "ui_previewwidgetbase.h"
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class PreviewWidgetBase : public QWidget, public Ui::PreviewWidgetBase
-{
- Q_OBJECT
-
-public:
- PreviewWidgetBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = 0);
- ~PreviewWidgetBase();
-
-protected slots:
- virtual void languageChange();
-
- virtual void init();
- virtual void destroy();
-
-};
-
-QT_END_NAMESPACE
-
-#endif // PREVIEWWIDGETBASE_H
diff --git a/tools/qtconfig/previewwidgetbase.ui b/tools/qtconfig/previewwidgetbase.ui
deleted file mode 100644
index bd8a5f3..0000000
--- a/tools/qtconfig/previewwidgetbase.ui
+++ /dev/null
@@ -1,340 +0,0 @@
-<ui version="4.0" stdsetdef="1" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** 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 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
- <exportmacro></exportmacro>
- <class>PreviewWidgetBase</class>
- <widget class="QWidget" name="PreviewWidgetBase" >
- <property name="objectName" >
- <string notr="true" >PreviewWidgetBase</string>
- </property>
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>378</width>
- <height>236</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle" >
- <string>Preview Window</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="Q3ButtonGroup" name="ButtonGroup1" >
- <property name="objectName" >
- <string notr="true" >ButtonGroup1</string>
- </property>
- <property name="title" >
- <string>ButtonGroup</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QRadioButton" name="RadioButton1" >
- <property name="objectName" >
- <string notr="true" >RadioButton1</string>
- </property>
- <property name="text" >
- <string>RadioButton1</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RadioButton2" >
- <property name="objectName" >
- <string notr="true" >RadioButton2</string>
- </property>
- <property name="text" >
- <string>RadioButton2</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="RadioButton3" >
- <property name="objectName" >
- <string notr="true" >RadioButton3</string>
- </property>
- <property name="text" >
- <string>RadioButton3</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="Q3ButtonGroup" name="ButtonGroup2" >
- <property name="objectName" >
- <string notr="true" >ButtonGroup2</string>
- </property>
- <property name="title" >
- <string>ButtonGroup2</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="CheckBox1" >
- <property name="objectName" >
- <string notr="true" >CheckBox1</string>
- </property>
- <property name="text" >
- <string>CheckBox1</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="CheckBox2" >
- <property name="objectName" >
- <string notr="true" >CheckBox2</string>
- </property>
- <property name="text" >
- <string>CheckBox2</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QProgressBar" name="ProgressBar1" >
- <property name="objectName" >
- <string notr="true" >ProgressBar1</string>
- </property>
- <property name="value" >
- <number>50</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLineEdit" name="LineEdit1" >
- <property name="objectName" >
- <string notr="true" >LineEdit1</string>
- </property>
- <property name="text" >
- <string>LineEdit</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="ComboBox1" >
- <property name="objectName" >
- <string notr="true" >ComboBox1</string>
- </property>
- <item>
- <property name="text" >
- <string>ComboBox</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QSpinBox" name="SpinBox1" >
- <property name="objectName" >
- <string notr="true" >SpinBox1</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PushButton1" >
- <property name="objectName" >
- <string notr="true" >PushButton1</string>
- </property>
- <property name="text" >
- <string>PushButton</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QScrollBar" name="ScrollBar1" >
- <property name="objectName" >
- <string notr="true" >ScrollBar1</string>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSlider" name="Slider1" >
- <property name="objectName" >
- <string notr="true" >Slider1</string>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="textView" >
- <property name="objectName" >
- <string notr="true" >textView</string>
- </property>
- <property name="maximumSize" >
- <size>
- <width>32767</width>
- <height>50</height>
- </size>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- <property name="text" >
- <string>&lt;p>
-&lt;a href=&quot;http://qt.nokia.com&quot;>http://qt.nokia.com&lt;/a>
-&lt;/p>
-&lt;p>
-&lt;a href=&quot;http://www.kde.org&quot;>http://www.kde.org&lt;/a>
-&lt;/p></string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="Spacer2" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Vertical</enum>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
-</ui>
diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro
index d1fd320..cb06e5a 100644
--- a/tools/qtconfig/qtconfig.pro
+++ b/tools/qtconfig/qtconfig.pro
@@ -1,11 +1,10 @@
TEMPLATE = app
-CONFIG += qt warn_on x11
+CONFIG += qt warn_on x11
build_all:!build_pass {
CONFIG -= build_all
CONFIG += release
}
LANGUAGE = C++
-QT += qt3support
contains(QT_CONFIG, gstreamer):LIBS += $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10
contains(QT_CONFIG, gstreamer):QMAKE_CXXFLAGS += $$QT_CFLAGS_GSTREAMER
@@ -13,19 +12,17 @@ contains(QT_CONFIG, phonon) {
QT += phonon
DEFINES += HAVE_PHONON
}
-SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \
- mainwindowbase.cpp paletteeditoradvancedbase.cpp previewwidgetbase.cpp
-HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \
- mainwindowbase.h paletteeditoradvancedbase.h previewwidgetbase.h
+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
+FORMS = mainwindow.ui paletteeditoradvanced.ui previewwidget.ui
RESOURCES = qtconfig.qrc
PROJECTNAME = Qt Configuration
-TARGET = qtconfig
-DESTDIR = ../../bin
+TARGET = qtconfig
+DESTDIR = ../../bin
target.path=$$[QT_INSTALL_BINS]
INSTALLS += target
-INCLUDEPATH += .
-DBFILE = qtconfig.db
+INCLUDEPATH += .
+DBFILE = qtconfig.db
diff --git a/tools/tools.pro b/tools/tools.pro
index e82bcaa..f090b86 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -20,7 +20,7 @@ TEMPLATE = subdirs
SUBDIRS += designer
}
}
- unix:!mac:!embedded:!qpa:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig
+ unix:!symbian:!mac:!embedded:!qpa:SUBDIRS += qtconfig
win32:!wince*:SUBDIRS += activeqt
}
contains(QT_CONFIG, declarative):SUBDIRS += qml