mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
remove unused QErrorMessage class
Katana uses KMessageBox or system notifcations for such things Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
385e7a50fc
commit
1b102cb371
12 changed files with 1575 additions and 2176 deletions
|
@ -3,7 +3,7 @@
|
|||
# https://wiki.archlinux.org/index.php/Arch_package_guidelines
|
||||
|
||||
pkgname=katie-git
|
||||
pkgver=4.12.0.r7677.980ce7a30
|
||||
pkgver=4.12.0.r7752.385e7a50f
|
||||
pkgrel=1
|
||||
pkgdesc='C++ toolkit derived from the Qt 4.8 framework'
|
||||
arch=('i486' 'i686' 'pentium4' 'x86_64' 'arm')
|
||||
|
|
|
@ -400,7 +400,6 @@ include/katie/QtGui/QDragEnterEvent
|
|||
include/katie/QtGui/QDragLeaveEvent
|
||||
include/katie/QtGui/QDragMoveEvent
|
||||
include/katie/QtGui/QDropEvent
|
||||
include/katie/QtGui/QErrorMessage
|
||||
include/katie/QtGui/QFileDialog
|
||||
include/katie/QtGui/QFileIconProvider
|
||||
include/katie/QtGui/QFileSystemModel
|
||||
|
@ -745,7 +744,6 @@ include/katie/QtGui/qdirmodel.h
|
|||
include/katie/QtGui/qdockwidget.h
|
||||
include/katie/QtGui/qdrag.h
|
||||
include/katie/QtGui/qdrawutil.h
|
||||
include/katie/QtGui/qerrormessage.h
|
||||
include/katie/QtGui/qevent.h
|
||||
include/katie/QtGui/qfiledialog.h
|
||||
include/katie/QtGui/qfileiconprovider.h
|
||||
|
|
|
@ -151,7 +151,6 @@ classlist = [
|
|||
"QDynamicPropertyChangeEvent",
|
||||
"QEasingCurve",
|
||||
"QElapsedTimer",
|
||||
"QErrorMessage",
|
||||
"QEvent",
|
||||
"QEventLoop",
|
||||
"QEventSizeOfChecker",
|
||||
|
|
|
@ -376,11 +376,6 @@
|
|||
# define QT_NO_TEXTEDIT
|
||||
#endif
|
||||
|
||||
// QErrorMessage
|
||||
#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_TEXTEDIT))
|
||||
# define QT_NO_ERRORMESSAGE
|
||||
#endif
|
||||
|
||||
// QListView
|
||||
#if !defined(QT_NO_LISTVIEW) && defined(QT_NO_ITEMVIEWS)
|
||||
# define QT_NO_LISTVIEW
|
||||
|
|
|
@ -52,7 +52,6 @@ set(GUI_PUBLIC_HEADERS
|
|||
QDirModel
|
||||
QDockWidget
|
||||
QDrag
|
||||
QErrorMessage
|
||||
QFileDialog
|
||||
QFileIconProvider
|
||||
QFileSystemModel
|
||||
|
@ -234,7 +233,6 @@ set(GUI_HEADERS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfscompleter_p.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qdialog.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qdialog_p.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qerrormessage.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfiledialog.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfiledialog_p.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfontdialog.h
|
||||
|
@ -593,7 +591,6 @@ set(GUI_SOURCES
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qabstractpagesetupdialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qcolordialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qdialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qerrormessage.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfiledialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qfontdialog.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qinputdialog.cpp
|
||||
|
|
|
@ -1,357 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Copyright (C) 2016 Ivailo Monev
|
||||
**
|
||||
** This file is part of the QtGui module of the Katie Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qerrormessage.h"
|
||||
|
||||
#ifndef QT_NO_ERRORMESSAGE
|
||||
|
||||
#include "qapplication.h"
|
||||
#include "qcheckbox.h"
|
||||
#include "qlabel.h"
|
||||
#include "qlayout.h"
|
||||
#include "qmessagebox.h"
|
||||
#include "qpushbutton.h"
|
||||
#include "qstringlist.h"
|
||||
#include "qtextedit.h"
|
||||
#include "qdialog_p.h"
|
||||
#include "qpixmap.h"
|
||||
#include "qmetaobject.h"
|
||||
#include "qthread.h"
|
||||
#include "qqueue.h"
|
||||
#include "qset.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QErrorMessagePrivate : public QDialogPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QErrorMessage)
|
||||
public:
|
||||
QPushButton * ok;
|
||||
QCheckBox * again;
|
||||
QTextEdit * errors;
|
||||
QLabel * icon;
|
||||
QQueue<QPair<QString, QString> > pending;
|
||||
QSet<QString> doNotShow;
|
||||
QSet<QString> doNotShowType;
|
||||
QString currentMessage;
|
||||
QString currentType;
|
||||
|
||||
bool nextPending();
|
||||
void retranslateStrings();
|
||||
};
|
||||
|
||||
class QErrorMessageTextView : public QTextEdit
|
||||
{
|
||||
public:
|
||||
QErrorMessageTextView(QWidget *parent)
|
||||
: QTextEdit(parent) { setReadOnly(true); }
|
||||
|
||||
virtual QSize minimumSizeHint() const;
|
||||
virtual QSize sizeHint() const;
|
||||
};
|
||||
|
||||
QSize QErrorMessageTextView::minimumSizeHint() const
|
||||
{
|
||||
return QSize(50, 50);
|
||||
}
|
||||
|
||||
QSize QErrorMessageTextView::sizeHint() const
|
||||
{
|
||||
return QSize(250, 75);
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QErrorMessage
|
||||
|
||||
\brief The QErrorMessage class provides an error message display dialog.
|
||||
|
||||
\ingroup standard-dialog
|
||||
|
||||
An error message widget consists of a text label and a checkbox. The
|
||||
checkbox lets the user control whether the same error message will be
|
||||
displayed again in the future, typically displaying the text,
|
||||
"Show this message again" translated into the appropriate local
|
||||
language.
|
||||
|
||||
For production applications, the class can be used to display messages which
|
||||
the user only needs to see once. To use QErrorMessage like this, you create
|
||||
the dialog in the usual way, and show it by calling the showMessage() slot or
|
||||
connecting signals to it.
|
||||
|
||||
The static qtHandler() function installs a message handler
|
||||
using qInstallMsgHandler() and creates a QErrorMessage that displays
|
||||
qDebug(), qWarning() and qFatal() messages. This is most useful in
|
||||
environments where no console is available to display warnings and
|
||||
error messages.
|
||||
|
||||
In both cases QErrorMessage will queue pending messages and display
|
||||
them in order, with each new message being shown as soon as the user
|
||||
has accepted the previous message. Once the user has specified that a
|
||||
message is not to be shown again it is automatically skipped, and the
|
||||
dialog will show the next appropriate message in the queue.
|
||||
|
||||
The \l{dialogs/standarddialogs}{Standard Dialogs} example shows
|
||||
how to use QErrorMessage as well as other built-in Qt dialogs.
|
||||
|
||||
\img qerrormessage.png
|
||||
|
||||
\sa QMessageBox, QStatusBar::showMessage(), {Standard Dialogs Example}
|
||||
*/
|
||||
|
||||
static QErrorMessage * qtMessageHandler = 0;
|
||||
|
||||
static void deleteStaticcQErrorMessage() // post-routine
|
||||
{
|
||||
if (qtMessageHandler) {
|
||||
delete qtMessageHandler;
|
||||
qtMessageHandler = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static bool metFatal = false;
|
||||
|
||||
static void jump(QtMsgType t, const char * m)
|
||||
{
|
||||
if (!qtMessageHandler)
|
||||
return;
|
||||
|
||||
QString rich;
|
||||
|
||||
switch (t) {
|
||||
case QtWarningMsg:
|
||||
rich = QErrorMessage::tr("Warning:");
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
rich = QErrorMessage::tr("Fatal Error:");
|
||||
case QtDebugMsg:
|
||||
default:
|
||||
rich = QErrorMessage::tr("Debug Message:");
|
||||
break;
|
||||
}
|
||||
rich = QString::fromLatin1("<p><b>%1</b></p>").arg(rich);
|
||||
rich += Qt::convertFromPlainText(QLatin1String(m), Qt::WhiteSpaceNormal);
|
||||
|
||||
// ### work around text engine quirk
|
||||
if (rich.endsWith(QLatin1String("</p>")))
|
||||
rich.chop(4);
|
||||
|
||||
if (!metFatal) {
|
||||
if (QThread::currentThread() == qApp->thread()) {
|
||||
qtMessageHandler->showMessage(rich);
|
||||
} else {
|
||||
QMetaObject::invokeMethod(qtMessageHandler,
|
||||
"showMessage",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QString, rich));
|
||||
}
|
||||
metFatal = (t == QtFatalMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Constructs and installs an error handler window with the given \a
|
||||
parent.
|
||||
*/
|
||||
|
||||
QErrorMessage::QErrorMessage(QWidget * parent)
|
||||
: QDialog(*new QErrorMessagePrivate, parent)
|
||||
{
|
||||
Q_D(QErrorMessage);
|
||||
QGridLayout * grid = new QGridLayout(this);
|
||||
d->icon = new QLabel(this);
|
||||
#ifndef QT_NO_MESSAGEBOX
|
||||
d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
|
||||
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
|
||||
#endif
|
||||
const int preferredIconColumn = 0;
|
||||
const int preferredTextColumn = 1;
|
||||
grid->addWidget(d->icon, 0, preferredIconColumn, Qt::AlignTop);
|
||||
d->errors = new QErrorMessageTextView(this);
|
||||
grid->addWidget(d->errors, 0, preferredTextColumn);
|
||||
d->again = new QCheckBox(this);
|
||||
d->again->setChecked(true);
|
||||
grid->addWidget(d->again, 1, preferredTextColumn, Qt::AlignTop);
|
||||
d->ok = new QPushButton(this);
|
||||
|
||||
connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
|
||||
d->ok->setFocus();
|
||||
grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
|
||||
grid->setColumnStretch(preferredTextColumn, 42);
|
||||
grid->setRowStretch(0, 42);
|
||||
d->retranslateStrings();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Destroys the error message dialog.
|
||||
*/
|
||||
|
||||
QErrorMessage::~QErrorMessage()
|
||||
{
|
||||
if (this == qtMessageHandler) {
|
||||
qtMessageHandler = 0;
|
||||
QtMsgHandler tmp = qInstallMsgHandler(0);
|
||||
// in case someone else has later stuck in another...
|
||||
if (tmp != jump)
|
||||
qInstallMsgHandler(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*! \reimp */
|
||||
|
||||
void QErrorMessage::done(int a)
|
||||
{
|
||||
Q_D(QErrorMessage);
|
||||
if (!d->again->isChecked() && !d->currentMessage.isEmpty() && d->currentType.isEmpty()) {
|
||||
d->doNotShow.insert(d->currentMessage);
|
||||
}
|
||||
if (!d->again->isChecked() && !d->currentType.isEmpty()) {
|
||||
d->doNotShowType.insert(d->currentType);
|
||||
}
|
||||
d->currentMessage.clear();
|
||||
d->currentType.clear();
|
||||
if (!d->nextPending()) {
|
||||
QDialog::done(a);
|
||||
if (this == qtMessageHandler && metFatal)
|
||||
QApplication::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Returns a pointer to a QErrorMessage object that outputs the
|
||||
default Qt messages. This function creates such an object, if there
|
||||
isn't one already.
|
||||
*/
|
||||
|
||||
QErrorMessage * QErrorMessage::qtHandler()
|
||||
{
|
||||
if (!qtMessageHandler) {
|
||||
qtMessageHandler = new QErrorMessage(0);
|
||||
qAddPostRoutine(deleteStaticcQErrorMessage); // clean up
|
||||
qtMessageHandler->setWindowTitle(QApplication::applicationName());
|
||||
qInstallMsgHandler(jump);
|
||||
}
|
||||
return qtMessageHandler;
|
||||
}
|
||||
|
||||
|
||||
/*! \internal */
|
||||
|
||||
bool QErrorMessagePrivate::nextPending()
|
||||
{
|
||||
while (!pending.isEmpty()) {
|
||||
QPair<QString,QString> pendingMessage = pending.dequeue();
|
||||
QString message = pendingMessage.first;
|
||||
QString type = pendingMessage.second;
|
||||
if (!message.isEmpty() && ((type.isEmpty() && !doNotShow.contains(message)) || (!type.isEmpty() && !doNotShowType.contains(type)))) {
|
||||
#ifndef QT_NO_TEXTHTMLPARSER
|
||||
errors->setHtml(message);
|
||||
#else
|
||||
errors->setPlainText(message);
|
||||
#endif
|
||||
currentMessage = message;
|
||||
currentType = type;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Shows the given message, \a message, and returns immediately. If the user
|
||||
has requested for the message not to be shown again, this function does
|
||||
nothing.
|
||||
|
||||
Normally, the message is displayed immediately. However, if there are
|
||||
pending messages, it will be queued to be displayed later.
|
||||
*/
|
||||
|
||||
void QErrorMessage::showMessage(const QString &message)
|
||||
{
|
||||
Q_D(QErrorMessage);
|
||||
if (d->doNotShow.contains(message))
|
||||
return;
|
||||
d->pending.enqueue(qMakePair(message,QString()));
|
||||
if (!isVisible() && d->nextPending())
|
||||
show();
|
||||
}
|
||||
|
||||
/*!
|
||||
\since 4.5
|
||||
\overload
|
||||
|
||||
Shows the given message, \a message, and returns immediately. If the user
|
||||
has requested for messages of type, \a type, not to be shown again, this
|
||||
function does nothing.
|
||||
|
||||
Normally, the message is displayed immediately. However, if there are
|
||||
pending messages, it will be queued to be displayed later.
|
||||
|
||||
\sa showMessage()
|
||||
*/
|
||||
|
||||
void QErrorMessage::showMessage(const QString &message, const QString &type)
|
||||
{
|
||||
Q_D(QErrorMessage);
|
||||
if (d->doNotShow.contains(message) && d->doNotShowType.contains(type))
|
||||
return;
|
||||
d->pending.push_back(qMakePair(message,type));
|
||||
if (!isVisible() && d->nextPending())
|
||||
show();
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void QErrorMessage::changeEvent(QEvent *e)
|
||||
{
|
||||
Q_D(QErrorMessage);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
d->retranslateStrings();
|
||||
}
|
||||
QDialog::changeEvent(e);
|
||||
}
|
||||
|
||||
void QErrorMessagePrivate::retranslateStrings()
|
||||
{
|
||||
again->setText(QErrorMessage::tr("&Show this message again"));
|
||||
ok->setText(QErrorMessage::tr("&OK"));
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QErrorMessage::message(const QString & message)
|
||||
|
||||
Use showMessage(\a message) instead.
|
||||
*/
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
#include "moc_qerrormessage.h"
|
||||
|
||||
#endif // QT_NO_ERRORMESSAGE
|
|
@ -1,62 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Copyright (C) 2016 Ivailo Monev
|
||||
**
|
||||
** This file is part of the QtGui module of the Katie Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QERRORMESSAGE_H
|
||||
#define QERRORMESSAGE_H
|
||||
|
||||
#include <QtGui/qdialog.h>
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_ERRORMESSAGE
|
||||
|
||||
class QErrorMessagePrivate;
|
||||
|
||||
class Q_GUI_EXPORT QErrorMessage: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(QErrorMessage)
|
||||
public:
|
||||
explicit QErrorMessage(QWidget* parent = nullptr);
|
||||
~QErrorMessage();
|
||||
|
||||
static QErrorMessage * qtHandler();
|
||||
|
||||
public Q_SLOTS:
|
||||
void showMessage(const QString &message);
|
||||
void showMessage(const QString &message, const QString &type);
|
||||
|
||||
protected:
|
||||
void done(int);
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QErrorMessage)
|
||||
};
|
||||
|
||||
#endif // QT_NO_ERRORMESSAGE
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
#endif // QERRORMESSAGE_H
|
|
@ -184,7 +184,6 @@ static const struct ClassTblData {
|
|||
{ QLatin1String("QDynamicPropertyChangeEvent"), QLatin1String("QtCore/qcoreevent.h") },
|
||||
{ QLatin1String("QEasingCurve"), QLatin1String("QtCore/qeasingcurve.h") },
|
||||
{ QLatin1String("QElapsedTimer"), QLatin1String("QtCore/qelapsedtimer.h") },
|
||||
{ QLatin1String("QErrorMessage"), QLatin1String("QtGui/qerrormessage.h") },
|
||||
{ QLatin1String("QEvent"), QLatin1String("QtCore/qcoreevent.h") },
|
||||
{ QLatin1String("QEventLoop"), QLatin1String("QtCore/qeventloop.h") },
|
||||
{ QLatin1String("QFile"), QLatin1String("QtCore/qfile.h") },
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
katie_gui_test(tst_qerrormessage
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tst_qerrormessage.cpp
|
||||
)
|
|
@ -1,148 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Copyright (C) 2016 Ivailo Monev
|
||||
**
|
||||
** This file is part of the test suite of the Katie Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QErrorMessage>
|
||||
#include <QDebug>
|
||||
#include <QCheckBox>
|
||||
|
||||
#ifndef QT_NO_ERRORMESSAGE
|
||||
|
||||
class tst_QErrorMessage : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void dontShowAgain();
|
||||
void dontShowCategoryAgain();
|
||||
|
||||
};
|
||||
|
||||
void tst_QErrorMessage::dontShowAgain()
|
||||
{
|
||||
QString plainString = QLatin1String("foo");
|
||||
QString htmlString = QLatin1String("foo<br>bar");
|
||||
QCheckBox *checkBox = 0;
|
||||
|
||||
QErrorMessage errorMessageDialog(0);
|
||||
|
||||
// show an error with plain string
|
||||
errorMessageDialog.showMessage(plainString);
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(plainString);
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(false);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(plainString);
|
||||
QVERIFY(!errorMessageDialog.isVisible());
|
||||
|
||||
// show an error with an html string
|
||||
errorMessageDialog.showMessage(htmlString);
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(!checkBox->isChecked());
|
||||
checkBox->setChecked(true);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString);
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(false);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString);
|
||||
QVERIFY(!errorMessageDialog.isVisible());
|
||||
}
|
||||
|
||||
void tst_QErrorMessage::dontShowCategoryAgain()
|
||||
{
|
||||
QString htmlString = QLatin1String("foo<br>bar");
|
||||
QString htmlString2 = QLatin1String("foo2<br>bar2");
|
||||
QCheckBox *checkBox = 0;
|
||||
|
||||
QErrorMessage errorMessageDialog(0);
|
||||
|
||||
errorMessageDialog.showMessage(htmlString,"Cat 1");
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(true);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString,"Cat 1");
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(true);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString2,"Cat 1");
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(true);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString,"Cat 1");
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
checkBox = errorMessageDialog.findChild<QCheckBox*>();
|
||||
QVERIFY(checkBox);
|
||||
QVERIFY(checkBox->isChecked());
|
||||
checkBox->setChecked(false);
|
||||
errorMessageDialog.close();
|
||||
|
||||
errorMessageDialog.showMessage(htmlString2,"Cat 1");
|
||||
QVERIFY(!errorMessageDialog.isVisible());
|
||||
|
||||
errorMessageDialog.showMessage(htmlString,"Cat 1");
|
||||
QVERIFY(!errorMessageDialog.isVisible());
|
||||
|
||||
errorMessageDialog.showMessage(htmlString);
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
|
||||
errorMessageDialog.showMessage(htmlString,"Cat 2");
|
||||
QVERIFY(errorMessageDialog.isVisible());
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QErrorMessage)
|
||||
|
||||
#include "moc_tst_qerrormessage.cpp"
|
||||
|
||||
#else // QT_NO_ERRORMESSAGE
|
||||
|
||||
QTEST_NOOP_MAIN
|
||||
|
||||
#endif // QT_NO_ERRORMESSAGE
|
2959
translations/qt.pot
2959
translations/qt.pot
File diff suppressed because it is too large
Load diff
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-11-14 20:38+0200\n"
|
||||
"POT-Creation-Date: 2022-11-14 23:21+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -17,109 +17,6 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/tools/qtconfig/previewframe.cpp:63
|
||||
msgid "Desktop settings will only take effect after an application restart."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:56
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Appearance</font></b></p><hr><p>Use this tab to "
|
||||
"customize the appearance of your Katie applications.</p><p>You can select "
|
||||
"the default GUI Style from the drop down list and customize the colors.</"
|
||||
"p><p>Any GUI Style plugins in your plugin path will automatically be added "
|
||||
"to the list of built-in Katie styles. (See the Library Paths tab for "
|
||||
"information on adding new plugin paths.)</p><p>When you choose 3-D Effects "
|
||||
"and Window Background colors, the Katie Configuration program will "
|
||||
"automatically generate a palette for you. To customize colors further, press "
|
||||
"the Tune Palette button to open the advanced palette editor.</p><p>The "
|
||||
"Preview Window shows what the selected Style and colors look like.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:73
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Fonts</font></b></p><hr><p>Use this tab to select the "
|
||||
"default font for your Katie applications. The selected font is shown "
|
||||
"(initially as 'Sample Text') in the line edit below the Family, Style and "
|
||||
"Point Size drop down lists.</p><p>You can specify if Katie should try to "
|
||||
"embed fonts into its generated output when printing. If you enable font "
|
||||
"embedding, the resulting postscript will be more portable and will more "
|
||||
"accurately reflect the visual output on the screen; however the resulting "
|
||||
"postscript file size will be bigger.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:86
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Interface</font></b></p><hr><p>Use this tab to customize "
|
||||
"the feel of your Katie applications.</p><p>If the Resolve Symlinks checkbox "
|
||||
"is checked Katie will follow symlinks when handling URLs. For example, in "
|
||||
"the file dialog, if this setting is turned on and /usr/tmp is a symlink to /"
|
||||
"var/tmp, entering the /usr/tmp directory will cause the file dialog to "
|
||||
"change to /var/tmp. With this setting turned off, symlinks are not resolved "
|
||||
"or followed.</p><p>The Global Strut setting is useful for people who require "
|
||||
"a minimum size for all widgets (e.g. when using a touch panel or for users "
|
||||
"who are visually impaired). Leaving the Global Strut width and height at 0 "
|
||||
"will disable the Global Strut feature.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:169
|
||||
msgid "Desktop Settings (Default)"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:175
|
||||
msgid "Choose style and palette based on your desktop settings."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:190
|
||||
msgid "Unknown"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:324
|
||||
msgid "No changes to be saved."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:330
|
||||
msgid "Saving changes..."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:408
|
||||
msgid "Saved changes."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:529
|
||||
msgid ""
|
||||
"<h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2015 The Qt Company Ltd."
|
||||
"<br/><br/>Copyright (C) 2016 Ivailo Monev"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:534 src/tools/qtconfig/mainwindow.cpp:535
|
||||
#: src/tools/qtconfig/mainwindow.cpp:542
|
||||
msgid "Katie Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:565
|
||||
msgid "Save Changes"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:566
|
||||
msgid "Save changes to settings?"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:34
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:42
|
||||
msgid "Choose a color"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:36
|
||||
msgid "Choose a color for the selected central color role."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:44
|
||||
msgid "Choose a color for the selected effect color role."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qdbusviewer/qdbusviewermain.cpp:49
|
||||
msgctxt "QtDBusViewer"
|
||||
msgid "Katie D-Bus Viewer"
|
||||
|
@ -213,3 +110,106 @@ msgstr ""
|
|||
#: src/tools/qdbusviewer/qdbusviewer.cpp:482
|
||||
msgid "D-Bus Viewer"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/previewframe.cpp:63
|
||||
msgid "Desktop settings will only take effect after an application restart."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:34
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:42
|
||||
msgid "Choose a color"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:36
|
||||
msgid "Choose a color for the selected central color role."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/paletteeditoradvanced.cpp:44
|
||||
msgid "Choose a color for the selected effect color role."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:56
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Appearance</font></b></p><hr><p>Use this tab to "
|
||||
"customize the appearance of your Katie applications.</p><p>You can select "
|
||||
"the default GUI Style from the drop down list and customize the colors.</"
|
||||
"p><p>Any GUI Style plugins in your plugin path will automatically be added "
|
||||
"to the list of built-in Katie styles. (See the Library Paths tab for "
|
||||
"information on adding new plugin paths.)</p><p>When you choose 3-D Effects "
|
||||
"and Window Background colors, the Katie Configuration program will "
|
||||
"automatically generate a palette for you. To customize colors further, press "
|
||||
"the Tune Palette button to open the advanced palette editor.</p><p>The "
|
||||
"Preview Window shows what the selected Style and colors look like.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:73
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Fonts</font></b></p><hr><p>Use this tab to select the "
|
||||
"default font for your Katie applications. The selected font is shown "
|
||||
"(initially as 'Sample Text') in the line edit below the Family, Style and "
|
||||
"Point Size drop down lists.</p><p>You can specify if Katie should try to "
|
||||
"embed fonts into its generated output when printing. If you enable font "
|
||||
"embedding, the resulting postscript will be more portable and will more "
|
||||
"accurately reflect the visual output on the screen; however the resulting "
|
||||
"postscript file size will be bigger.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:86
|
||||
msgctxt "MainWindow"
|
||||
msgid ""
|
||||
"<p><b><font size+=2>Interface</font></b></p><hr><p>Use this tab to customize "
|
||||
"the feel of your Katie applications.</p><p>If the Resolve Symlinks checkbox "
|
||||
"is checked Katie will follow symlinks when handling URLs. For example, in "
|
||||
"the file dialog, if this setting is turned on and /usr/tmp is a symlink to /"
|
||||
"var/tmp, entering the /usr/tmp directory will cause the file dialog to "
|
||||
"change to /var/tmp. With this setting turned off, symlinks are not resolved "
|
||||
"or followed.</p><p>The Global Strut setting is useful for people who require "
|
||||
"a minimum size for all widgets (e.g. when using a touch panel or for users "
|
||||
"who are visually impaired). Leaving the Global Strut width and height at 0 "
|
||||
"will disable the Global Strut feature.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:169
|
||||
msgid "Desktop Settings (Default)"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:175
|
||||
msgid "Choose style and palette based on your desktop settings."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:190
|
||||
msgid "Unknown"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:324
|
||||
msgid "No changes to be saved."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:330
|
||||
msgid "Saving changes..."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:408
|
||||
msgid "Saved changes."
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:529
|
||||
msgid ""
|
||||
"<h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2015 The Qt Company Ltd."
|
||||
"<br/><br/>Copyright (C) 2016 Ivailo Monev"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:534 src/tools/qtconfig/mainwindow.cpp:535
|
||||
#: src/tools/qtconfig/mainwindow.cpp:542
|
||||
msgid "Katie Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:565
|
||||
msgid "Save Changes"
|
||||
msgstr ""
|
||||
|
||||
#: src/tools/qtconfig/mainwindow.cpp:566
|
||||
msgid "Save changes to settings?"
|
||||
msgstr ""
|
||||
|
|
Loading…
Add table
Reference in a new issue