Commit a2739f55 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.5'

Change-Id: Ic7c16091268083c0426cf29f0691a7ee458f2bd9
parents 8f1a161c 4514208a
......@@ -251,13 +251,17 @@ DockWidget::DockWidget(QWidget *inner, FancyMainWindow *parent, bool immutable)
setWidget(inner);
setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable);
setObjectName(inner->objectName() + QLatin1String("DockWidget"));
setWindowTitle(inner->windowTitle());
setMouseTracking(true);
QString title = inner->windowTitle();
toggleViewAction()->setProperty("original_title", title);
title = Utils::stripAccelerator(title);
setWindowTitle(title);
QStyleOptionDockWidget opt;
initStyleOption(&opt);
m_titleBar = new TitleBarWidget(this, opt);
m_titleBar->m_titleLabel->setText(inner->windowTitle());
m_titleBar->m_titleLabel->setText(title);
setTitleBarWidget(m_titleBar);
if (immutable)
......@@ -527,7 +531,9 @@ void FancyMainWindow::addDockActionsToMenu(QMenu *menu)
QDockWidget *dockWidget = dockwidgets.at(i);
if (dockWidget->property("managed_dockwidget").isNull()
&& dockWidget->parentWidget() == this) {
actions.append(dockwidgets.at(i)->toggleViewAction());
QAction *action = dockWidget->toggleViewAction();
action->setText(action->property("original_title").toString());
actions.append(action);
}
}
Utils::sort(actions, [](const QAction *action1, const QAction *action2) {
......
......@@ -2834,7 +2834,8 @@ void GitClient::subversionLog(const QString &workingDirectory)
void GitClient::push(const QString &workingDirectory, const QStringList &pushArgs)
{
vcsExec(workingDirectory, QStringList({"push"}) + pushArgs, nullptr, true);
vcsExec(workingDirectory, QStringList({"push"}) + pushArgs, nullptr, true,
VcsCommand::ShowSuccessMessage);
}
bool GitClient::synchronousMerge(const QString &workingDirectory, const QString &branch,
......
......@@ -30,6 +30,7 @@
#include "../nimconstants.h"
#include <coreplugin/icontext.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
......@@ -60,6 +61,8 @@ NimProject::NimProject(const FileName &fileName) : Project(Constants::C_NIM_MIME
{
setId(Constants::C_NIMPROJECT_ID);
setDisplayName(fileName.toFileInfo().completeBaseName());
// ensure debugging is enabled (Nim plugin translates nim code to C code)
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
m_projectScanTimer.setSingleShot(true);
connect(&m_projectScanTimer, &QTimer::timeout, this, &NimProject::collectProjectFiles);
......
......@@ -582,7 +582,8 @@ void AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode)
m_tabWidget->removeTab(tabIndex);
delete window;
runControl->initiateFinish(); // Will self-destruct.
if (runControl)
runControl->initiateFinish(); // Will self-destruct.
m_runControlTabs.removeAt(index);
updateCloseActions();
......
......@@ -123,8 +123,14 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target)
});
connect(BuildManager::instance(), &BuildManager::buildStateChanged, this,
[this, project](Project *p) {
if (p == project && !BuildManager::isBuilding(p))
if (p == project && !BuildManager::isBuilding(p)) {
const QString defaultWorkingDir = baseWorkingDirectory();
if (!defaultWorkingDir.isEmpty()) {
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(
Utils::FileName::fromString(defaultWorkingDir));
}
emit enabledChanged();
}
}
);
......@@ -326,7 +332,6 @@ void QbsRunConfigurationWidget::targetInformationHasChanged()
setExecutableLineText(m_rc->executable());
WorkingDirectoryAspect *aspect = m_rc->extraAspect<WorkingDirectoryAspect>();
aspect->setDefaultWorkingDirectory(Utils::FileName::fromString(m_rc->baseWorkingDirectory()));
aspect->pathChooser()->setBaseFileName(m_rc->target()->project()->projectDirectory());
m_ignoreChange = false;
}
......
......@@ -339,8 +339,12 @@ void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
} // pro
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (qtVersion && m_isUsingLibrarySearchPath)
env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS"));
if (qtVersion && m_isUsingLibrarySearchPath) {
if (HostOsInfo::isWindowsHost())
env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_BINS"));
else
env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS"));
}
}
QString DesktopQmakeRunConfiguration::buildSystemTarget() const
......
......@@ -70,6 +70,10 @@ public:
void moveAllFrames(qreal offset);
void scaleAllFrames(qreal factor);
int getSupposedTargetIndex(qreal newFrame) const;
int indexOfFrame(const ModelNode &frame) const;
void slideFrame(int sourceIndex, int targetIndex);
};
} //QmlDesigner
......@@ -54,6 +54,8 @@ public:
qreal currentFrame() const;
qreal duration() const;
bool isEnabled() const;
qreal minActualFrame(const ModelNode &target) const;
qreal maxActualFrame(const ModelNode &target) const;
......
......@@ -90,6 +90,35 @@ void QmlTimelineFrames::setPropertyName(const PropertyName &propertyName)
modelNode().variantProperty("property").setValue(QString::fromUtf8(propertyName));
}
int QmlTimelineFrames::getSupposedTargetIndex(qreal newFrame) const
{
const NodeListProperty nodeListProperty = modelNode().defaultNodeListProperty();
int i = 0;
for (auto node : nodeListProperty.toModelNodeList()) {
if (node.hasVariantProperty("frame")) {
const qreal currentFrame = node.variantProperty("frame").value().toReal();
if (!qFuzzyCompare(currentFrame, newFrame)) { //Ignore the frame itself
if (currentFrame > newFrame)
return i;
++i;
}
}
}
return nodeListProperty.count();
}
int QmlTimelineFrames::indexOfFrame(const ModelNode &frame) const
{
return modelNode().defaultNodeListProperty().indexOf(frame);
}
void QmlTimelineFrames::slideFrame(int sourceIndex, int targetIndex)
{
if (targetIndex != sourceIndex)
modelNode().defaultNodeListProperty().slide(sourceIndex, targetIndex);
}
void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame)
{
......@@ -104,7 +133,14 @@ void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame)
{PropertyName("value"), value}};
ModelNode frame = modelNode().view()->createModelNode("QtQuick.Timeline.Keyframe", 1, 0, propertyPairList);
modelNode().defaultNodeListProperty().reparentHere(frame);
NodeListProperty nodeListProperty = modelNode().defaultNodeListProperty();
const int sourceIndex = nodeListProperty.count();
const int targetIndex = getSupposedTargetIndex(currentFrame);
nodeListProperty.reparentHere(frame);
slideFrame(sourceIndex, targetIndex);
}
QVariant QmlTimelineFrames::value(qreal frame) const
......
......@@ -130,6 +130,11 @@ qreal QmlTimelineMutator::duration() const
return endFrame() - startFrame();
}
bool QmlTimelineMutator::isEnabled() const
{
return QmlObjectNode(modelNode()).modelValue("enabled").toBool();
}
qreal QmlTimelineMutator::minActualFrame(const ModelNode &target) const
{
qreal min = std::numeric_limits<double>::max();
......
......@@ -2809,24 +2809,19 @@ void TextEditorWidget::gotoLine(int line, int column, bool centerLine, bool anim
const DisplaySettings &ds = d->m_displaySettings;
if (animate && ds.m_animateNavigationWithinFile) {
const QScrollBar *scrollBar = verticalScrollBar();
QScrollBar *scrollBar = verticalScrollBar();
const int start = scrollBar->value();
setTextCursor(cursor);
ensureBlockIsUnfolded(block);
const int visibleLines = lastVisibleLine() - firstVisibleLine();
int end = 0;
auto it = document()->firstBlock();
while (it.isValid() && it != block) {
if (it.isVisible())
++end;
it = it.next();
}
setUpdatesEnabled(false);
setTextCursor(cursor);
if (centerLine)
end = qMin(scrollBar->maximum(), qMax(scrollBar->minimum(), end - visibleLines / 2));
centerCursor();
else
ensureCursorVisible();
const int end = scrollBar->value();
scrollBar->setValue(start);
setUpdatesEnabled(true);
const int delta = end - start;
// limit the number of steps for the animation otherwise you wont be able to tell
......
......@@ -32,6 +32,8 @@
#include <projectexplorer/target.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/runnables.h>
#include <qmakeprojectmanager/qmakeproject.h>
namespace WinRt {
......@@ -93,5 +95,44 @@ QString WinRtRunConfiguration::buildSystemTarget() const
->mapProFilePathToTarget(Utils::FileName::fromString(m_proFilePath));
}
ProjectExplorer::Runnable WinRtRunConfiguration::runnable() const
{
ProjectExplorer::StandardRunnable r;
r.executable = executable();
r.commandLineArguments = arguments();
return r;
}
QString WinRtRunConfiguration::executable() const
{
QmakeProjectManager::QmakeProject *project
= static_cast<QmakeProjectManager::QmakeProject *>(target()->project());
if (!project)
return QString();
QmakeProjectManager::QmakeProFile *rootProFile = project->rootProFile();
if (!rootProFile)
return QString();
const QmakeProjectManager::QmakeProFile *pro
= rootProFile->findProFile(Utils::FileName::fromString(m_proFilePath));
if (!pro)
return QString();
QmakeProjectManager::TargetInformation ti = pro->targetInformation();
if (!ti.valid)
return QString();
QString destDir = ti.destDir.toString();
if (destDir.isEmpty())
destDir = ti.buildDir.toString();
else if (QDir::isRelativePath(destDir))
destDir = QDir::cleanPath(ti.buildDir.toString() + '/' + destDir);
QString executable = QDir::cleanPath(destDir + '/' + ti.target);
executable = Utils::HostOsInfo::withExecutableSuffix(executable);
return executable;
}
} // namespace Internal
} // namespace WinRt
......@@ -48,6 +48,8 @@ public:
QString buildSystemTarget() const final;
ProjectExplorer::Runnable runnable() const override;
signals:
void argumentsChanged(QString);
void uninstallAfterStopChanged(bool);
......@@ -58,6 +60,8 @@ private:
QString m_proFilePath;
bool m_uninstallAfterStop = false;
QString executable() const;
};
} // namespace Internal
......
Subproject commit 08ce978733b33c1b1a64e5e1e62dea22cde6148c
Subproject commit 1ee4260129336c83d7acab1e3e675f7f507ad46f
......@@ -460,8 +460,7 @@ static bool unregisterDebuggerKey(const WCHAR *key,
break;
}
QString oldDebugger;
if (!registryReadStringKey(handle, debuggerRegistryDefaultValueNameC, &oldDebugger, errorMessage))
break;
registryReadStringKey(handle, debuggerRegistryDefaultValueNameC, &oldDebugger, errorMessage);
// Re-register old debugger or delete key if it was empty.
if (oldDebugger.isEmpty()) {
if (!registryDeleteValue(handle, debuggerRegistryValueNameC, errorMessage))
......
......@@ -544,13 +544,24 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
else:
return result
# set "Always Start Full Help" in "Tools" -> "Options..." -> "Help" -> "General"
def setAlwaysStartFullHelp():
# set a help viewer that will always be used, regardless of Creator's width
class HelpViewer:
HELPMODE, SIDEBYSIDE, EXTERNALWINDOW = range(3)
def setFixedHelpViewer(helpViewer):
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 5, 5, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "General")
selectFromCombo(":Startup.contextHelpComboBox_QComboBox", "Always Show in Help Mode")
mode = "Always Show "
if helpViewer == HelpViewer.HELPMODE:
mode += "in Help Mode"
elif helpViewer == HelpViewer.SIDEBYSIDE:
mode += "Side-by-Side"
elif helpViewer == HelpViewer.EXTERNALWINDOW:
mode += "in External Window"
selectFromCombo(":Startup.contextHelpComboBox_QComboBox", mode)
clickButton(waitForObject(":Options.OK_QPushButton"))
def removePackagingDirectory(projectPath):
......
......@@ -23,18 +23,27 @@
#
############################################################################
def __getWelcomeScreenButtonHelper__(buttonLabel, widgetWithQFrames):
frames = [child for child in object.children(widgetWithQFrames) if className(child) == 'QWidget']
def __childrenOfType__(parentObject, typeName):
return [child for child in object.children(parentObject) if className(child) == typeName]
def __getWelcomeScreenButtonHelper__(buttonLabel, widgetWithQFrames, isUrlButton = False):
frames = __childrenOfType__(widgetWithQFrames, 'QWidget')
for frame in frames:
label = getChildByClass(frame, 'QLabel')
if str(label.text) == buttonLabel:
return frame, label
childCount = 1 # incorrect but okay for framed sidebar buttons
if isUrlButton:
childCount = len(__childrenOfType__(frame, 'QLabel'))
for occurrence in range(1, childCount + 1):
label = getChildByClass(frame, 'QLabel', occurrence)
if label is None:
continue
if str(label.text) == buttonLabel:
return frame, label
return None, None
def getWelcomeScreenSideBarButton(buttonLabel):
def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False):
sideBar = waitForObject("{type='Welcome::Internal::SideBar' unnamed='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar)
return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton)
def getWelcomeScreenMainButton(buttonLabel):
stackedWidget = waitForObject("{type='QStackedWidget' name='WelcomeScreenStackedWidget' "
......@@ -52,7 +61,7 @@ def getWelcomeTreeView(treeViewLabel):
def findExampleOrTutorial(tableView, regex, verbose=False):
model = tableView.model()
children = [ch for ch in object.children(tableView) if className(ch) == 'QModelIndex']
children = __childrenOfType__(tableView, 'QModelIndex')
for child in children:
if re.match(regex, str(child.text)):
if verbose:
......
......@@ -52,6 +52,7 @@ def main():
for p in Qt5Path.getPaths(Qt5Path.DOCS):
qchs.append(os.path.join(p, "qtquick.qch"))
addHelpDocumentation(qchs)
setFixedHelpViewer(HelpViewer.SIDEBYSIDE)
# create qt quick application
createNewQtQuickApplication(tempDir(), "SampleApp")
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
......
......@@ -79,7 +79,7 @@ def main():
if not startedWithoutPluginError():
return
setAlwaysStartFullHelp()
setFixedHelpViewer(HelpViewer.HELPMODE)
addCurrentCreatorDocumentation()
buttonsAndState = {'Projects':True, 'Examples':False, 'Tutorials':False}
......@@ -109,11 +109,10 @@ def main():
'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html'
}
for text, url in textUrls.items():
test.verify(checkIfObjectExists("{type='QLabel' text='%s' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}"
% text),
"Verifying whether link button (%s) exists." % text)
# TODO find way to verify URLs (or tweak source code of Welcome page to become able)
button, label = getWelcomeScreenSideBarButton(text, True)
if test.verify(all((button, label)),
"Verifying whether link button (%s) exists." % text):
test.compare(str(button.toolTip), url, "Verifying URL for %s" % text)
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(getStarted)
if wsButtonLabel is not None:
mouseClick(wsButtonLabel)
......
......@@ -66,7 +66,7 @@ def main():
for p in Qt5Path.getPaths(Qt5Path.DOCS):
qchs.extend([os.path.join(p, "qtopengl.qch"), os.path.join(p, "qtwidgets.qch")])
addHelpDocumentation(qchs)
setAlwaysStartFullHelp()
setFixedHelpViewer(HelpViewer.HELPMODE)
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started Now')
if not test.verify(all((wsButtonFrame, wsButtonLabel)),
"Verifying: Qt Creator displays Welcome Page with Getting Started."):
......
......@@ -52,7 +52,7 @@ def main():
test.log("Setting breakpoints")
result = setBreakpointsForCurrentProject(filesAndLines)
if result:
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10},
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):12},
{os.path.join(workingDir, projectName, "main.qml"):13}]
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
progressBarWait()
......
......@@ -37,7 +37,7 @@ def main():
if not startedWithoutPluginError():
return
openQbsProject(pathCreator)
if not addAndActivateKit(Targets.DESKTOP_541_GCC):
if not addAndActivateKit(Targets.DESKTOP_561_DEFAULT):
test.fatal("Failed to activate '%s'" % Targets.getStringForTarget(Targets.DESKTOP_541_GCC))
invokeMenuItem("File", "Exit")
return
......
......@@ -13201,7 +13201,6 @@
"src" "1"
"qbs-resources" "3"
"imports" "4"
"QbsApp.qbs" "5"
"QbsLibrary.qbs" "5"
"QbsProduct.qbs" "5"
"modules" "4"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment