Commit 412ac981 authored by dt's avatar dt
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents da901f4a 7968a7d6
......@@ -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;
}
......
......@@ -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);
}
......@@ -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,
......
......@@ -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);
......
......@@ -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())
......
......@@ -58,6 +58,8 @@ public:
void invokeClearResults();
void paintEvent(QPaintEvent *event);
private slots:
void invokeFindNext();
void invokeFindPrevious();
......
......@@ -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>&lt;b&gt;Note:&lt;/b&gt;</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>&lt;b&gt;Note:&lt;/b&gt;</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>
......
......@@ -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)
{
......
......@@ -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();
......
......@@ -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)
......
......@@ -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;
};
}
}
......
......@@ -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);
}
......
......@@ -84,8 +84,6 @@ private slots:
void workingDirectoryLineEditTextEdited();
void commandArgumentsLineEditTextEdited();
void enabledGroupBoxClicked(bool);
void workingDirBrowseButtonClicked();
void commandBrowseButtonClicked();
private:
QString m_buildConfiguration;
ProcessStep *m_step;
......
......@@ -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/>