summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.cpp71
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.h3
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.cpp8
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.h1
-rw-r--r--tools/designer/src/lib/shared/widgetfactory.cpp2
-rw-r--r--tools/runonphone/main.cpp4
-rw-r--r--tools/runonphone/runonphone.pro6
-rw-r--r--tools/runonphone/serenum_stub.cpp53
-rw-r--r--tools/runonphone/serenum_unix.cpp64
9 files changed, 192 insertions, 20 deletions
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp
index 193f3a5..ab48dac 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.cpp
+++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp
@@ -119,6 +119,22 @@ private:
// nothing todo
}
+ void retranslate()
+ {
+ simpleSearchLabel->setText(tr("Search for:"));
+ prevQueryButton->setToolTip(tr("Previous search"));
+ nextQueryButton->setToolTip(tr("Next search"));
+ searchButton->setText(tr("Search"));
+#ifdef QT_CLUCENE_SUPPORT
+ advancedSearchLabel->setText(tr("Advanced search"));
+ similarLabel->setText(tr("words <B>similar</B> to:"));
+ withoutLabel->setText(tr("<B>without</B> the words:"));
+ exactLabel->setText(tr("with <B>exact phrase</B>:"));
+ allLabel->setText(tr("with <B>all</B> of the words:"));
+ atLeastLabel->setText(tr("with <B>at least one</B> of the words:"));
+#endif
+ }
+
QStringList buildTermList(const QString query)
{
bool s = false;
@@ -338,6 +354,13 @@ private:
friend class QHelpSearchQueryWidget;
bool simpleSearch;
+ QLabel *simpleSearchLabel;
+ QLabel *advancedSearchLabel;
+ QLabel *similarLabel;
+ QLabel *withoutLabel;
+ QLabel *exactLabel;
+ QLabel *allLabel;
+ QLabel *atLeastLabel;
QPushButton *searchButton;
QWidget* advancedSearchWidget;
QToolButton *showHideAdvancedSearchButton;
@@ -387,19 +410,17 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->setMargin(0);
QHBoxLayout* hBoxLayout = new QHBoxLayout();
- QLabel *label = new QLabel(tr("Search for:"), this);
+ d->simpleSearchLabel = new QLabel(this);
d->defaultQuery = new QLineEdit(this);
d->defaultQuery->setCompleter(&d->searchCompleter);
d->prevQueryButton = new QToolButton(this);
d->prevQueryButton->setArrowType(Qt::LeftArrow);
- d->prevQueryButton->setToolTip(tr("Previous search"));
d->prevQueryButton->setEnabled(false);
d->nextQueryButton = new QToolButton(this);
d->nextQueryButton->setArrowType(Qt::RightArrow);
- d->nextQueryButton->setToolTip(tr("Next search"));
d->nextQueryButton->setEnabled(false);
- d->searchButton = new QPushButton(tr("Search"), this);
- hBoxLayout->addWidget(label);
+ d->searchButton = new QPushButton(this);
+ hBoxLayout->addWidget(d->simpleSearchLabel);
hBoxLayout->addWidget(d->defaultQuery);
hBoxLayout->addWidget(d->prevQueryButton);
hBoxLayout->addWidget(d->nextQueryButton);
@@ -418,15 +439,15 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
d->showHideAdvancedSearchButton->setText(QLatin1String("+"));
d->showHideAdvancedSearchButton->setMinimumSize(25, 20);
- label = new QLabel(tr("Advanced search"), this);
+ d->advancedSearchLabel = new QLabel(this);
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
- sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
- label->setSizePolicy(sizePolicy);
+ sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth());
+ d->advancedSearchLabel->setSizePolicy(sizePolicy);
QFrame* hLine = new QFrame(this);
hLine->setFrameStyle(QFrame::HLine);
hBoxLayout->addWidget(d->showHideAdvancedSearchButton);
- hBoxLayout->addWidget(label);
+ hBoxLayout->addWidget(d->advancedSearchLabel);
hBoxLayout->addWidget(hLine);
vLayout->addLayout(hBoxLayout);
@@ -436,32 +457,32 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget);
gLayout->setMargin(0);
- label = new QLabel(tr("words <B>similar</B> to:"), this);
- gLayout->addWidget(label, 0, 0);
+ d->similarLabel = new QLabel(this);
+ gLayout->addWidget(d->similarLabel, 0, 0);
d->similarQuery = new QLineEdit(this);
d->similarQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->similarQuery, 0, 1);
- label = new QLabel(tr("<B>without</B> the words:"), this);
- gLayout->addWidget(label, 1, 0);
+ d->withoutLabel = new QLabel(this);
+ gLayout->addWidget(d->withoutLabel, 1, 0);
d->withoutQuery = new QLineEdit(this);
d->withoutQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->withoutQuery, 1, 1);
- label = new QLabel(tr("with <B>exact phrase</B>:"), this);
- gLayout->addWidget(label, 2, 0);
+ d->exactLabel = new QLabel(this);
+ gLayout->addWidget(d->exactLabel, 2, 0);
d->exactQuery = new QLineEdit(this);
d->exactQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->exactQuery, 2, 1);
- label = new QLabel(tr("with <B>all</B> of the words:"), this);
- gLayout->addWidget(label, 3, 0);
+ d->allLabel = new QLabel(this);
+ gLayout->addWidget(d->allLabel, 3, 0);
d->allQuery = new QLineEdit(this);
d->allQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->allQuery, 3, 1);
- label = new QLabel(tr("with <B>at least one</B> of the words:"), this);
- gLayout->addWidget(label, 4, 0);
+ d->atLeastLabel = new QLabel(this);
+ gLayout->addWidget(d->atLeastLabel, 4, 0);
d->atLeastQuery = new QLineEdit(this);
d->atLeastQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->atLeastQuery, 4, 1);
@@ -469,6 +490,8 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->addWidget(d->advancedSearchWidget);
d->advancedSearchWidget->hide();
+ d->retranslate();
+
connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
@@ -511,4 +534,14 @@ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent)
}
}
+/*! \reimp
+*/
+void QHelpSearchQueryWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->retranslate();
+ else
+ QWidget::changeEvent(event);
+}
+
QT_END_NAMESPACE
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.h b/tools/assistant/lib/qhelpsearchquerywidget.h
index a99bae0..2afc4b4 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.h
+++ b/tools/assistant/lib/qhelpsearchquerywidget.h
@@ -74,7 +74,8 @@ Q_SIGNALS:
void search();
private:
- void focusInEvent(QFocusEvent *focusEvent);
+ virtual void focusInEvent(QFocusEvent *focusEvent);
+ virtual void changeEvent(QEvent *event);
private:
QHelpSearchQueryWidgetPrivate *d;
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp
index 3cac880..a3f5aed 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.cpp
+++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp
@@ -408,6 +408,14 @@ QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine)
connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int)));
}
+/*! \reimp
+*/
+void QHelpSearchResultWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->setResults(d->searchEngine->hitCount());
+}
+
/*!
Destroys the search result widget.
*/
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.h b/tools/assistant/lib/qhelpsearchresultwidget.h
index d078079..ff29adc 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.h
+++ b/tools/assistant/lib/qhelpsearchresultwidget.h
@@ -75,6 +75,7 @@ private:
QHelpSearchResultWidgetPrivate *d;
QHelpSearchResultWidget(QHelpSearchEngine *engine);
+ virtual void changeEvent(QEvent *event);
};
QT_END_NAMESPACE
diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp
index eda551d..c7b13a1 100644
--- a/tools/designer/src/lib/shared/widgetfactory.cpp
+++ b/tools/designer/src/lib/shared/widgetfactory.cpp
@@ -774,6 +774,8 @@ void WidgetFactory::applyStyleTopLevel(const QString &styleName, QWidget *w)
void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget)
{
+ if (!style)
+ return;
const QPalette standardPalette = style->standardPalette();
if (widget->style() == style && widget->palette() == standardPalette)
return;
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index d8c306f..c7fc43f 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -175,7 +175,11 @@ int main(int argc, char *argv[])
}
if(loglevel > 0)
outstream << "Connecting to target via " << serialPortName << endl;
+#ifdef Q_OS_WIN
launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
+#else
+ launcher->setTrkServerName(serialPortName);
+#endif
launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
launcher->setCommandLineArgs(cmdLine);
diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro
index cf0c055..cb27d1b 100644
--- a/tools/runonphone/runonphone.pro
+++ b/tools/runonphone/runonphone.pro
@@ -18,3 +18,9 @@ windows {
-luuid \
-ladvapi32
}
+unix:!symbian {
+ SOURCES += serenum_unix.cpp
+}
+else {
+ SOURCES += serenum_stub.cpp
+}
diff --git a/tools/runonphone/serenum_stub.cpp b/tools/runonphone/serenum_stub.cpp
new file mode 100644
index 0000000..f39765e
--- /dev/null
+++ b/tools/runonphone/serenum_stub.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ qWarning() << "enumerateSerialPorts not implemented" << endl;
+ return list;
+}
+
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp
new file mode 100644
index 0000000..ca6c437
--- /dev/null
+++ b/tools/runonphone/serenum_unix.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+#include <QFileInfo>
+#include <QDir>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ QDir dir("/dev/serial/by-id/");
+ QFileInfoList ports(dir.entryInfoList());
+ foreach(QFileInfo info, ports) {
+ if (!info.isDir()) {
+ SerialPortId id;
+ id.friendlyName = info.fileName();
+ id.portName = info.canonicalFilePath();
+ list << id;
+ }
+ }
+ return list;
+}
+