diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 63947e8ed6c426111d4a3c513fda62f19cff39f4..50d29a747dcf3a7f31771788ebd08d180a028e2a 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -74,7 +74,7 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) // Disabled since for now we'll make sure that all icons fit with our // own custom icons by returning an empty one if we don't know it. -#if 0 +#ifdef Q_OS_WIN // This is incorrect if the OS does not always return the same icon for the // same suffix (Mac OS X), but should speed up the retrieval a lot ... icon = m_systemIconProvider.icon(fileInfo); @@ -127,7 +127,7 @@ void FileIconProvider::registerIconOverlayForSuffix(const QIcon &icon, const QSt QIcon FileIconProvider::iconForSuffix(const QString &suffix) const { QIcon icon; - +#ifndef Q_OS_WIN // On windows we use the file system icons if (suffix.isEmpty()) return icon; @@ -138,7 +138,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const break; } } - +#endif return icon; } diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 72b86d85d7cf8db3381035ad6dcae0aff2179115..c61dbbbe3e13e08d907af3ebd135523fe0376b89 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -1054,3 +1054,11 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti break; } } + +// Mac style reimplements this to control the +// focus widget among other things +bool ManhattanStyle::event(QEvent *e) +{ + Q_ASSERT(d->style); + return d->style->event(e); +} diff --git a/src/plugins/coreplugin/manhattanstyle.h b/src/plugins/coreplugin/manhattanstyle.h index 1f61b931e9df7c3517a3b0ba5886f0162db4f4f8..5dd832ffdf88549728262626a163d15abdbe93dc 100644 --- a/src/plugins/coreplugin/manhattanstyle.h +++ b/src/plugins/coreplugin/manhattanstyle.h @@ -78,6 +78,9 @@ public: void unpolish(QWidget *widget); void unpolish(QApplication *app); +protected: + bool event(QEvent *e); + protected Q_SLOTS: QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const; int layoutSpacingImplementation(QSizePolicy::ControlType control1, diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index f357c451061666a8cb9d95e86aae5bb69ec35735..6550cf342fe915a291291084eb1c9cfb872b8eb3 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -55,8 +55,8 @@ enum { INameRole = Qt::UserRole, VisualRole, ExpandedRole }; ///////////////////////////////////////////////////////////////////// WatchWindow::WatchWindow(Type type, QWidget *parent) - : QTreeView(parent), m_type(type) - , m_alwaysResizeColumnsToContents(true) + : QTreeView(parent) + , m_alwaysResizeColumnsToContents(true), m_type(type) { setWindowTitle(tr("Locals and Watchers")); setAlternatingRowColors(true); diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index a8d9653160453488d20b987550c9ba27c241cd4a..7d8072b7ac3650487ea2828a877ecf154fde1aa9 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -38,6 +38,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/findplaceholder.h> #include <coreplugin/icore.h> +#include <coreplugin/stylehelper.h> #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/command.h> @@ -224,6 +225,16 @@ FindToolBar::~FindToolBar() { } +void FindToolBar::paintEvent(QPaintEvent *event) +{ + QToolBar::paintEvent(event); + + QPainter p(this); + const QRect r = rect(); + p.setPen(StyleHelper::borderColor()); + p.drawLine(r.topLeft(), r.topRight()); +} + bool FindToolBar::eventFilter(QObject *obj, QEvent *event) { if ((obj == m_ui.findEdit || obj == m_findCompleter->popup()) diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h index 030a57876a38adde52cad9308cb804fb634141af..ce3dfdd74490cfdd7da7c2ddfac66c10da54b961 100644 --- a/src/plugins/find/findtoolbar.h +++ b/src/plugins/find/findtoolbar.h @@ -58,6 +58,8 @@ public: void invokeClearResults(); + void paintEvent(QPaintEvent *event); + private slots: void invokeFindNext(); void invokeFindPrevious(); diff --git a/src/plugins/git/settingspage.ui b/src/plugins/git/settingspage.ui index 151608d03b01d3a8d77e2c725a86fe32bfddf70b..94c04493aabb47f69ea469348f3d3304a2d08868 100644 --- a/src/plugins/git/settingspage.ui +++ b/src/plugins/git/settingspage.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>389</width> + <width>403</width> <height>183</height> </rect> </property> @@ -25,16 +25,16 @@ <property name="checkable"> <bool>true</bool> </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="pathlabel"> - <property name="text"> - <string>PATH:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="pathlabel"> + <property name="text"> + <string>PATH:</string> + </property> + </widget> + </item> <item> <widget class="QLineEdit" name="pathLineEdit"/> </item> @@ -47,19 +47,23 @@ </item> </layout> </item> - <item row="1" column="0"> - <widget class="QLabel" name="noteLabel"> - <property name="text"> - <string><b>Note:</b></string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLabel" name="noteFieldlabel"> - <property name="text"> - <string>Git needs to find Perl in the environment as well.</string> - </property> - </widget> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="noteLabel"> + <property name="text"> + <string><b>Note:</b></string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="noteFieldlabel"> + <property name="text"> + <string>Git needs to find Perl in the environment as well.</string> + </property> + </widget> + </item> + </layout> </item> </layout> </widget> diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index a944efa29b3af5a28c0f1f8306d7360f22e8f68f..138bb437bd64030d8ce536899f481d86d084e25d 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -248,8 +248,6 @@ void CentralWidget::setLastShownPages() } setSource(url); } - - updateBrowserFont(); } bool CentralWidget::hasSelection() const @@ -407,24 +405,6 @@ void CentralWidget::setSourceInNewTab(const QUrl &url) tabWidget->setCurrentIndex(tabWidget->addTab(viewer, quoteTabTitle(viewer->documentTitle()))); -#if defined(QT_NO_WEBIT) - QFont font = qApp->font(); - if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()) - font = qVariantValue<QFont>(helpEngine->customValue(QLatin1String("browserFont"))); - viewer->setFont(font); -#else - QWebView* view = qobject_cast<QWebView*> (viewer); - if (view) { - QWebSettings* settings = QWebSettings::globalSettings(); - int fontSize = settings->fontSize(QWebSettings::DefaultFontSize); - QString fontFamily = settings->fontFamily(QWebSettings::StandardFont); - - settings = view->settings(); - settings->setFontSize(QWebSettings::DefaultFontSize, fontSize); - settings->setFontFamily(QWebSettings::StandardFont, fontFamily); - } -#endif - connectSignals(); } @@ -612,36 +592,6 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) return QWidget::eventFilter(object, e); } -void CentralWidget::updateBrowserFont() -{ -#if defined(QT_NO_WEBKIT) - QFont font = qApp->font(); - if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()) - font = qVariantValue<QFont>(helpEngine->customValue(QLatin1String("browserFont"))); - - QWidget* widget = 0; - for (int i = 0; i < tabWidget->count(); ++i) { - widget = tabWidget->widget(i); - if (widget->font() != font) - widget->setFont(font); - } -#else - QWebSettings* settings = QWebSettings::globalSettings(); - int fontSize = settings->fontSize(QWebSettings::DefaultFontSize); - QString fontFamily = settings->fontFamily(QWebSettings::StandardFont); - - QWebView* widget = 0; - for (int i = 0; i < tabWidget->count(); ++i) { - widget = qobject_cast<QWebView*> (tabWidget->widget(i)); - if (widget) { - settings = widget->settings(); - settings->setFontSize(QWebSettings::DefaultFontSize, fontSize); - settings->setFontFamily(QWebSettings::StandardFont, fontFamily); - } - } -#endif -} - bool CentralWidget::find(const QString &txt, QTextDocument::FindFlags findFlags, bool incremental) { diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index 5532f5ded83661ecbeb5bc52217e4d0d38018b44..f99b68d64325f6352566320c3c9c4d4fccba60fb 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -85,7 +85,7 @@ public: void activateTab(bool onlyHelpViewer = false); bool find(const QString &txt, QTextDocument::FindFlags findFlags, bool incremental); void setLastShownPages(); - + static CentralWidget *instance(); public slots: @@ -98,7 +98,6 @@ public slots: void print(); void pageSetup(); void printPreview(); - void updateBrowserFont(); void setSource(const QUrl &url); void setSourceInNewTab(const QUrl &url); HelpViewer *newEmptyTab(); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 4012cee8e13e6be8c9f060883dad07f5866fa3ec..3bd747260147dbaccb9998db543e7659e85ec461 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -54,46 +54,34 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE QFormLayout *layout = new QFormLayout(); layout->setMargin(0); - m_executableLineEdit = new QLineEdit; - QToolButton *exectuableToolButton = new QToolButton(); - exectuableToolButton->setText("..."); - QHBoxLayout *hl = new QHBoxLayout; - hl->addWidget(m_executableLineEdit); - hl->addWidget(exectuableToolButton); - layout->addRow("Executable", hl); + m_executableChooser = new Core::Utils::PathChooser(); + m_executableChooser->setExpectedKind(Core::Utils::PathChooser::File); + layout->addRow("Executable:", m_executableChooser); m_commandLineArgumentsLineEdit = new QLineEdit; - layout->addRow("Arguments", m_commandLineArgumentsLineEdit); + m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here... + layout->addRow("Arguments:", m_commandLineArgumentsLineEdit); - m_workingDirectoryLineEdit = new QLineEdit(); - QToolButton *workingDirectoryToolButton = new QToolButton(); - workingDirectoryToolButton->setText("..."); - hl = new QHBoxLayout; - hl->addWidget(m_workingDirectoryLineEdit); - hl->addWidget(workingDirectoryToolButton); - layout->addRow("Working Directory", hl); + m_workingDirectory = new Core::Utils::PathChooser(); + layout->addRow("Working Directory:", m_workingDirectory); setLayout(layout); changed(); - connect(m_executableLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(setExecutable(const QString&))); + connect(m_executableChooser, SIGNAL(changed()), + this, SLOT(setExecutable())); connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(setCommandLineArguments(const QString&))); - connect(m_workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(setWorkingDirectory(const QString&))); - connect(exectuableToolButton, SIGNAL(clicked(bool)), - this, SLOT(executableToolButtonClicked())); - connect(workingDirectoryToolButton, SIGNAL(clicked(bool)), - this, SLOT(workingDirectoryToolButtonClicked())); + connect(m_workingDirectory, SIGNAL(changed()), + this, SLOT(setWorkingDirectory())); connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); } -void CustomExecutableConfigurationWidget::setExecutable(const QString &executable) +void CustomExecutableConfigurationWidget::setExecutable() { m_ignoreChange = true; - m_runConfiguration->setExecutable(executable); + m_runConfiguration->setExecutable(m_executableChooser->path()); m_ignoreChange = false; } void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString &commandLineArguments) @@ -102,47 +90,21 @@ void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString m_runConfiguration->setCommandLineArguments(commandLineArguments); m_ignoreChange = false; } -void CustomExecutableConfigurationWidget::setWorkingDirectory(const QString &workingDirectory) +void CustomExecutableConfigurationWidget::setWorkingDirectory() { m_ignoreChange = true; - m_runConfiguration->setWorkingDirectory(workingDirectory); + m_runConfiguration->setWorkingDirectory(m_workingDirectory->path()); m_ignoreChange = false; } -void CustomExecutableConfigurationWidget::executableToolButtonClicked() -{ - QString newValue; - QString executableFilter; -#ifdef Q_OS_WIN - executableFilter = "Executable (*.exe)"; -#endif - newValue = QFileDialog::getOpenFileName(this, "Executable", "", executableFilter); - if (!newValue.isEmpty()) { - m_executableLineEdit->setText(newValue); - setExecutable(newValue); - } -} - -void CustomExecutableConfigurationWidget::workingDirectoryToolButtonClicked() -{ - QString newValue; - QString executableFilter; - - newValue = QFileDialog::getExistingDirectory(this, "Directory", m_workingDirectoryLineEdit->text()); - if (newValue.isEmpty()) { - m_workingDirectoryLineEdit->setText(newValue); - setWorkingDirectory(newValue); - } -} - void CustomExecutableConfigurationWidget::changed() { // We triggered the change, don't update us if (m_ignoreChange) return; - m_executableLineEdit->setText(m_runConfiguration->baseExecutable()); + m_executableChooser->setPath(m_runConfiguration->baseExecutable()); m_commandLineArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); - m_workingDirectoryLineEdit->setText(m_runConfiguration->baseWorkingDirectory()); + m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); } CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index 52cbedd51c688e9b67e2685989b589d297043741..f2f05cb0b2008934a36d75326528e2095a06cc79 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -36,6 +36,8 @@ #include "applicationrunconfiguration.h" +#include <utils/pathchooser.h> + #include <QtGui/QToolButton> QT_BEGIN_NAMESPACE @@ -108,18 +110,16 @@ public: CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc); private slots: void changed(); - void executableToolButtonClicked(); - void workingDirectoryToolButtonClicked(); - void setExecutable(const QString &executable); + void setExecutable(); void setCommandLineArguments(const QString &commandLineArguments); - void setWorkingDirectory(const QString &workingDirectory); + void setWorkingDirectory(); private: bool m_ignoreChange; CustomExecutableRunConfiguration *m_runConfiguration; - QLineEdit *m_executableLineEdit; + Core::Utils::PathChooser *m_executableChooser; QLineEdit *m_commandLineArgumentsLineEdit; - QLineEdit *m_workingDirectoryLineEdit; + Core::Utils::PathChooser *m_workingDirectory; }; } } diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index e53e6a109928e49a7928e24897fed8f52584cd07..50f4ed81adf289a712edb72621c781663375a6a4 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -136,17 +136,14 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : m_step(step) { m_ui.setupUi(this); - connect(m_ui.commandBrowseButton, SIGNAL(clicked(bool)), - this, SLOT(commandBrowseButtonClicked())); - connect(m_ui.workingDirBrowseButton, SIGNAL(clicked(bool)), - this, SLOT(workingDirBrowseButtonClicked())); + m_ui.command->setExpectedKind(Core::Utils::PathChooser::File); + connect(m_ui.command, SIGNAL(changed()), + this, SLOT(commandLineEditTextEdited())); + connect(m_ui.workingDirectory, SIGNAL(changed()), + this, SLOT(workingDirectoryLineEditTextEdited())); connect(m_ui.nameLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(nameLineEditTextEdited())); - connect(m_ui.commandLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(commandLineEditTextEdited())); - connect(m_ui.workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(workingDirectoryLineEditTextEdited())); connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(commandArgumentsLineEditTextEdited())); connect(m_ui.enabledGroupBox, SIGNAL(clicked(bool)), @@ -158,34 +155,16 @@ QString ProcessStepConfigWidget::displayName() const return m_step->name(); } -void ProcessStepConfigWidget::workingDirBrowseButtonClicked() -{ - QString workingDirectory = QFileDialog::getExistingDirectory(this, "Select the working directory", m_ui.workingDirectoryLineEdit->text()); - if (workingDirectory.isEmpty()) - return; - m_ui.workingDirectoryLineEdit->setText(workingDirectory); - workingDirectoryLineEditTextEdited(); -} - -void ProcessStepConfigWidget::commandBrowseButtonClicked() -{ - QString filename = QFileDialog::getOpenFileName(this, "Select the executable"); - if (filename.isEmpty()) - return; - m_ui.commandLineEdit->setText(filename); - commandLineEditTextEdited(); -} - void ProcessStepConfigWidget::init(const QString &buildConfiguration) { m_buildConfiguration = buildConfiguration; if (buildConfiguration != QString::null) { - m_ui.commandLineEdit->setText(m_step->command(buildConfiguration)); + m_ui.command->setPath(m_step->command(buildConfiguration)); QString workingDirectory = m_step->value(buildConfiguration, "workingDirectory").toString(); if (workingDirectory.isEmpty()) workingDirectory = "$BUILDDIR"; - m_ui.workingDirectoryLineEdit->setText(workingDirectory); + m_ui.workingDirectory->setPath(workingDirectory); m_ui.commandArgumentsLineEdit->setText(m_step->arguments(buildConfiguration).join(" ")); m_ui.enabledGroupBox->setChecked(m_step->enabled(buildConfiguration)); @@ -200,12 +179,12 @@ void ProcessStepConfigWidget::nameLineEditTextEdited() void ProcessStepConfigWidget::commandLineEditTextEdited() { - m_step->setCommand(m_buildConfiguration, m_ui.commandLineEdit->text()); + m_step->setCommand(m_buildConfiguration, m_ui.command->path()); } void ProcessStepConfigWidget::workingDirectoryLineEditTextEdited() { - QString wd = m_ui.workingDirectoryLineEdit->text(); + QString wd = m_ui.workingDirectory->path(); m_step->setValue(m_buildConfiguration, "workingDirectory", wd); } diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index 808aaa2a95bfee134d2ff3de615efbc8eae6bc6d..aa8b2760df24ce6a20e7f201bd2e3c9a7e3cc28e 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -84,8 +84,6 @@ private slots: void workingDirectoryLineEditTextEdited(); void commandArgumentsLineEditTextEdited(); void enabledGroupBoxClicked(bool); - void workingDirBrowseButtonClicked(); - void commandBrowseButtonClicked(); private: QString m_buildConfiguration; ProcessStep *m_step; diff --git a/src/plugins/projectexplorer/processstep.ui b/src/plugins/projectexplorer/processstep.ui index 9875ef474cb9019b6f2d05e31d4c19432afb92a8..01255ab891ae79df2fb58b6e5e101222729974db 100644 --- a/src/plugins/projectexplorer/processstep.ui +++ b/src/plugins/projectexplorer/processstep.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>428</width> - <height>222</height> + <width>505</width> + <height>271</height> </rect> </property> <property name="windowTitle"> @@ -22,61 +22,50 @@ <property name="checkable"> <bool>true</bool> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0"> - <widget class="QLabel" name="commandLabel"> + <layout class="QFormLayout" name="formLayout"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="nameLabel"> <property name="text"> - <string>Command</string> + <string>Name:</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="commandLineEdit"/> + <item row="0" column="1"> + <widget class="QLineEdit" name="nameLineEdit"/> </item> - <item row="1" column="2"> - <widget class="QToolButton" name="commandBrowseButton"> + <item row="1" column="0"> + <widget class="QLabel" name="commandLabel"> <property name="text"> - <string>...</string> + <string>Command:</string> </property> </widget> </item> + <item row="1" column="1"> + <widget class="Core::Utils::PathChooser" name="command"/> + </item> <item row="2" column="0"> <widget class="QLabel" name="workingDirecoryLabel"> <property name="text"> - <string>Working Directory</string> + <string>Working Directory:</string> </property> </widget> </item> <item row="2" column="1"> - <widget class="QLineEdit" name="workingDirectoryLineEdit"/> - </item> - <item row="2" column="2"> - <widget class="QToolButton" name="workingDirBrowseButton"> - <property name="text"> - <string>...</string> - </property> - </widget> + <widget class="Core::Utils::PathChooser" name="workingDirectory"/> </item> <item row="3" column="0"> <widget class="QLabel" name="commandArgumentsLabel"> <property name="text"> - <string>command arguments</string> + <string>Command Arguments:</string> </property> </widget> </item> - <item row="3" column="1" colspan="2"> + <item row="3" column="1"> <widget class="QLineEdit" name="commandArgumentsLineEdit"/> </item> - <item row="0" column="0"> - <widget class="QLabel" name="nameLabel"> - <property name="text"> - <string>Name</string> - </property> - </widget> - </item> - <item row="0" column="1" colspan="2"> - <widget class="QLineEdit" name="nameLineEdit"/> - </item> </layout> </widget> </item> @@ -95,6 +84,13 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>Core::Utils::PathChooser</class> + <extends>QWidget</extends> + <header location="global">utils/pathchooser.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui b/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui index 7ce0d1950d19a658dacb394fd61ab8a5d8a3830c..c29023a6ddf3d8cea5f288f3c6be35b835b6cb67 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui @@ -22,7 +22,7 @@ <item row="0" column="0"> <widget class="QLabel" name="nameLabel"> <property name="text"> - <string>Configuration Name</string> + <string>Configuration Name:</string> </property> </widget> </item> @@ -45,7 +45,7 @@ </sizepolicy> </property> <property name="text"> - <string>Qt Version</string> + <string>Qt Version:</string> </property> </widget> </item> @@ -93,7 +93,7 @@ <item row="2" column="0"> <widget class="QLabel" name="label"> <property name="text"> - <string>Shadow Build</string> + <string>Shadow Build:</string> </property> </widget> </item> @@ -113,7 +113,7 @@ </sizepolicy> </property> <property name="text"> - <string>Build Directory</string> + <string>Build Directory:</string> </property> </widget> </item> diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index d769313b58a1bbef5ce334571301c0129a4d925b..dea220c837ee9c3a71526bf61ce89ee9899e35f8 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -56,9 +56,7 @@ QT_END_NAMESPACE #include <QtCore/QFileInfo> #include <QtCore/QFile> #include <QtCore/QTimer> -#include <QtCore/QRegExp> #include <QtCore/QSettings> -#include <QtCore/QDebug> #include <QtGui/QAction> #include <QtGui/QApplication> #include <QtGui/QContextMenuEvent> diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index a2fb68e5b20b123e774adcd3e9f451a752dc54ec..e6414918c22fb63c92e40ed3c745a9038389dd4f 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -215,9 +215,9 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> + <layout class="QHBoxLayout" name="cleanIndentationLayout"> <item> - <spacer name="horizontalSpacer_3"> + <spacer name="cleanIndentationSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 085c8cb54ef34e66fabc2e2e38447fa4ad6c9314..572c9f6665b41ba8b3366a453d97a286a0cffc57 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2508,7 +2508,8 @@ bool Parser::parseBoolLiteral(ExpressionAST *&node) bool Parser::parseNumericLiteral(ExpressionAST *&node) { - if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL || LA() == T_CHAR_LITERAL) { + if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL || + LA() == T_CHAR_LITERAL || LA() == T_WIDE_CHAR_LITERAL) { NumericLiteralAST *ast = new (_pool) NumericLiteralAST; ast->token = consumeToken(); node = ast; diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index 5149576e61f89814bd8d952099e196e2b0319032..1cebaec19fb68255f5698d9808e393bf142efebb 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -234,6 +234,11 @@ void QrcEditor::resolveLocationIssues(QStringList &files) const QString copyName = QFileDialog::getSaveFileName(this, tr("Choose copy location"), suggestion.absoluteFilePath()); if (!copyName.isEmpty()) { + QString relPath = dir.relativeFilePath(copyName); + if (relPath.startsWith(dotdotSlash)) { // directory is still invalid + i--; // Compensate i++ and try again + continue; + } if (QFile::exists(copyName)) { if (!QFile::remove(copyName)) { QMessageBox::critical(this, tr("Overwrite failed"), diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index 55141ba0364a18e29257665bcde2a0ba577e3f56..ae003d31532166a4845249d0f4bed79c21bee389 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -619,12 +619,12 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - void * const internalPointer = index.internalPointer(); - Node * const node = reinterpret_cast<Node *>(internalPointer); - Prefix const * const prefix = node->prefix(); - File const * const file = node->file(); + const void *internalPointer = index.internalPointer(); + const Node *node = reinterpret_cast<const Node *>(internalPointer); + const Prefix *prefix = node->prefix(); + File *file = node->file(); Q_ASSERT(prefix); - bool const isFileNode = (prefix != node); + const bool isFileNode = (prefix != node); QVariant result; @@ -641,7 +641,8 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const } else { // File node Q_ASSERT(file); - stringRes = QFileInfo(file->name).fileName(); + QString conv_file = m_resource_file.relativePath(file->name); + stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); const QString alias = file->alias; if (!alias.isEmpty()) appendParenthesized(alias, stringRes); @@ -653,28 +654,15 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const if (isFileNode) { // File node Q_ASSERT(file); - const QString path = m_resource_file.absolutePath(file->name); - if (iconFileExtension(path)) { - const QIcon icon(path); - if (!icon.isNull()) - result = icon; + if (file->icon.isNull()) { + const QString path = m_resource_file.absolutePath(file->name); + if (iconFileExtension(path)) + file->icon = QIcon(path); } + if (!file->icon.isNull()) + result = file->icon; } break; - case Qt::ToolTipRole: - if (isFileNode) { - // File node - Q_ASSERT(file); - QString conv_file = m_resource_file.relativePath(file->name); - QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); - const QString &alias_file = file->alias; - if (!alias_file.isEmpty()) - appendParenthesized(alias_file, stringRes); - - result = stringRes; - } - break; - default: break; } diff --git a/src/shared/qrceditor/resourcefile_p.h b/src/shared/qrceditor/resourcefile_p.h index 00d999c90c6570f21d902f63c6032d9e82a47f10..4a7d510dc48edbadb84010940661db22e189d0a0 100644 --- a/src/shared/qrceditor/resourcefile_p.h +++ b/src/shared/qrceditor/resourcefile_p.h @@ -40,6 +40,7 @@ #include <QtCore/QMap> #include <QtCore/QString> #include <QtCore/QStringList> +#include <QtGui/QIcon> #include "shared_global_p.h" @@ -89,6 +90,7 @@ struct File : public Node { bool operator != (const File &other) const { return name != other.name; } QString name; QString alias; + QIcon icon; }; class FileList : public QList<File *> diff --git a/src/shared/qrceditor/resourceview.cpp b/src/shared/qrceditor/resourceview.cpp index ee9c507337f2c06d23d9b26f30c8e86513ba1a29..cb010f0f4b9138e0d597c3a697d0e896e9aca188 100644 --- a/src/shared/qrceditor/resourceview.cpp +++ b/src/shared/qrceditor/resourceview.cpp @@ -382,6 +382,14 @@ void ResourceView::mouseReleaseEvent(QMouseEvent *e) QTreeView::mouseReleaseEvent(e); } +void ResourceView::keyPressEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Delete) + removeItem(); + else + QTreeView::keyPressEvent(e); +} + void ResourceView::popupMenu(const QModelIndex &index) { if (!m_releasePos.isNull()) { diff --git a/src/shared/qrceditor/resourceview.h b/src/shared/qrceditor/resourceview.h index ae11b2db93de2c03b65f3ad12c5171d536d3e2ab..f50e6e6c43bb4de9ab3cf95311bc7ee4827f191f 100644 --- a/src/shared/qrceditor/resourceview.h +++ b/src/shared/qrceditor/resourceview.h @@ -138,6 +138,7 @@ protected: void changeLang(const QModelIndex &index); void changeAlias(const QModelIndex &index); void mouseReleaseEvent(QMouseEvent *e); + void keyPressEvent(QKeyEvent *e); signals: void removeItem(); diff --git a/src/tools/qtlibspatcher/binpatch.cpp b/src/tools/qtlibspatcher/binpatch.cpp index e2fd4cc2f2e392212455c1c36bd773b665bf6cbd..7e1dcfbbdd83159e37908e7798d8956ff7ad0834 100644 --- a/src/tools/qtlibspatcher/binpatch.cpp +++ b/src/tools/qtlibspatcher/binpatch.cpp @@ -181,7 +181,7 @@ bool BinPatch::patch(const char *oldstr, const char *newstr) if (!(input = fopen(fileName, "r+b"))) { - fprintf(stderr, "Cannot open file %s!\n", fileName); + fprintf(stderr, "Warning: Could not open file %s\n", fileName); return false; } diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index c3ff6a0387e0dfff5e149b086ff5f49f97415a02..c186b8a895dffde2a2cc4d4f2b37b726cdea1243 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -85,13 +85,13 @@ bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath) logFileName(fileName); for (int i = 0; i < (int)(sizeof(variables) / sizeof(variables[0])); i++) { - const char * const newStr = allocFileNameCopyAppend(variables[i].variable, baseQtPath, variables[i].subDirectory); + const char * const newStr = allocFileNameCopyAppend( + variables[i].variable, baseQtPath, variables[i].subDirectory); BinPatch binFile(fileName); const bool success = binFile.patch(variables[i].variable, newStr); delete[] newStr; if (!success) { result = false; - break; } } @@ -119,7 +119,6 @@ bool patchBinariesWithQtPathes(const char *baseQtPath) delete[] fileName; if (!success) { result = false; - break; } } @@ -602,9 +601,6 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) delete[] fileName; delete[] oldSourcePath; delete[] newSourcePath; - - if (!result) - break; } return result; @@ -635,67 +631,67 @@ const char * const textFileFileNames[] = { #ifndef Q_OS_WIN // *.la - "lib/libQtCore.la", - "lib/libQt3Support.la", - "lib/libQtCLucene.la", - "lib/libQtDBus.la", - "lib/libQtGui.la", - "lib/libQtHelp.la", - "lib/libQtNetwork.la", - "lib/libQtOpenGL.la", - "lib/libQtScript.la", - "lib/libQtSql.la", - "lib/libQtSvg.la", - "lib/libQtTest.la", - "lib/libQtWebKit.la", - "lib/libQtXml.la", - "lib/libQtXmlPatterns.la", + "/lib/libQtCore.la", + "/lib/libQt3Support.la", + "/lib/libQtCLucene.la", + "/lib/libQtDBus.la", + "/lib/libQtGui.la", + "/lib/libQtHelp.la", + "/lib/libQtNetwork.la", + "/lib/libQtOpenGL.la", + "/lib/libQtScript.la", + "/lib/libQtSql.la", + "/lib/libQtSvg.la", + "/lib/libQtTest.la", + "/lib/libQtWebKit.la", + "/lib/libQtXml.la", + "/lib/libQtXmlPatterns.la", // *.prl - "demos/shared/libdemo_shared.prl", - "lib/libQt3Support.prl", - "lib/libQtAssistantClient.prl", - "lib/libQtCLucene.prl", - "lib/libQtCore.prl", - "lib/libQtDBus.prl", - "lib/libQtDesignerComponents.prl", - "lib/libQtDesigner.prl", - "lib/libQtGui.prl", - "lib/libQtHelp.prl", - "lib/libQtNetwork.prl", - "lib/libQtOpenGL.prl", - "lib/libQtScript.prl", - "lib/libQtSql.prl", - "lib/libQtSvg.prl", - "lib/libQtTest.prl", - "lib/libQtUiTools.prl", - "lib/libQtWebKit.prl", - "lib/libQtXmlPatterns.prl", - "lib/libQtXml.prl", + "/demos/shared/libdemo_shared.prl", + "/lib/libQt3Support.prl", + "/lib/libQtAssistantClient.prl", + "/lib/libQtCLucene.prl", + "/lib/libQtCore.prl", + "/lib/libQtDBus.prl", + "/lib/libQtDesignerComponents.prl", + "/lib/libQtDesigner.prl", + "/lib/libQtGui.prl", + "/lib/libQtHelp.prl", + "/lib/libQtNetwork.prl", + "/lib/libQtOpenGL.prl", + "/lib/libQtScript.prl", + "/lib/libQtSql.prl", + "/lib/libQtSvg.prl", + "/lib/libQtTest.prl", + "/lib/libQtUiTools.prl", + "/lib/libQtWebKit.prl", + "/lib/libQtXmlPatterns.prl", + "/lib/libQtXml.prl", // *.pc - "lib/pkgconfig/Qt3Support.pc", - "lib/pkgconfig/QtAssistantClient.pc", - "lib/pkgconfig/QtCLucene.pc", - "lib/pkgconfig/QtCore.pc", - "lib/pkgconfig/QtDBus.pc", - "lib/pkgconfig/QtDesignerComponents.pc", - "lib/pkgconfig/QtDesigner.pc", - "lib/pkgconfig/QtGui.pc", - "lib/pkgconfig/QtHelp.pc", - "lib/pkgconfig/QtNetwork.pc", - "lib/pkgconfig/QtOpenGL.pc", - "lib/pkgconfig/QtScript.pc", - "lib/pkgconfig/QtSql.pc", - "lib/pkgconfig/QtSvg.pc", - "lib/pkgconfig/QtTest.pc", - "lib/pkgconfig/QtUiTools.pc", - "lib/pkgconfig/QtWebKit.pc", - "lib/pkgconfig/QtXmlPatterns.pc", - "lib/pkgconfig/QtXml.pc", + "/lib/pkgconfig/Qt3Support.pc", + "/lib/pkgconfig/QtAssistantClient.pc", + "/lib/pkgconfig/QtCLucene.pc", + "/lib/pkgconfig/QtCore.pc", + "/lib/pkgconfig/QtDBus.pc", + "/lib/pkgconfig/QtDesignerComponents.pc", + "/lib/pkgconfig/QtDesigner.pc", + "/lib/pkgconfig/QtGui.pc", + "/lib/pkgconfig/QtHelp.pc", + "/lib/pkgconfig/QtNetwork.pc", + "/lib/pkgconfig/QtOpenGL.pc", + "/lib/pkgconfig/QtScript.pc", + "/lib/pkgconfig/QtSql.pc", + "/lib/pkgconfig/QtSvg.pc", + "/lib/pkgconfig/QtTest.pc", + "/lib/pkgconfig/QtUiTools.pc", + "/lib/pkgconfig/QtWebKit.pc", + "/lib/pkgconfig/QtXmlPatterns.pc", + "/lib/pkgconfig/QtXml.pc", // misc - "mkspecs/qconfig.pri" + "/mkspecs/qconfig.pri" #endif }; @@ -703,11 +699,11 @@ void replaceInTextFile(const char * fileName, const char * oldText, const char * newText, const char * oldText2 = NULL, const char * newText2 = NULL) { - const QString errorMessage = QString("Could not patch file ") + fileName; + const QString errorMessage = QString("Warning: Could not patch file ") + fileName; QFile f(fileName); if (!f.open(QIODevice::ReadOnly)) { - std::cout << qPrintable(errorMessage) << std::endl; + std::cerr << qPrintable(errorMessage) << std::endl; return; } QTextStream in(&f); @@ -720,7 +716,7 @@ void replaceInTextFile(const char * fileName, } if (!f.open(QIODevice::WriteOnly)) { - std::cout << qPrintable(errorMessage) << std::endl; + std::cerr << qPrintable(errorMessage) << std::endl; return; } QTextStream out(&f); @@ -730,19 +726,22 @@ void replaceInTextFile(const char * fileName, void patchTextFiles(const char *newInstallBase) { + const char * const baseQtPath = newInstallBase; const char * const newSourceBase = newInstallBase; const int fileCount = sizeof(textFileFileNames) / sizeof(const char *); for (int i = 0; i < fileCount; i++) { - logFileName(textFileFileNames[i]); + char * const fileName = allocFileNameCopyAppend(baseQtPath, textFileFileNames[i]); + logFileName(fileName); logDiff(oldSourceBase, newSourceBase); #ifndef Q_OS_WIN logDiff(oldInstallBase, newInstallBase); #endif - replaceInTextFile(textFileFileNames[i], + replaceInTextFile(fileName, #ifndef Q_OS_WIN oldSourceBase, newSourceBase, #endif oldInstallBase, newInstallBase); + delete[] fileName; } patchQMakeSpec(newInstallBase); @@ -774,8 +773,8 @@ int main(int argc, char *args[]) break; patchTextFiles(baseQtPath); - const bool success = patchBinariesWithQtPathes(baseQtPath) - && patchDebugLibrariesWithQtPath(baseQtPath); + patchBinariesWithQtPathes(baseQtPath); + patchDebugLibrariesWithQtPath(baseQtPath); delete[] baseQtPath; - return success ? 0 : 1; + return 0; }