diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-08-30 20:43:02 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-08-30 20:43:02 +0200 |
commit | a32e243e6168d0cf329390e74e547fc6b2cc0460 (patch) | |
tree | 62b8955655cbaf0a58b18820ed440403e8fa91b1 /src/plugins | |
parent | e6270852a3a29dfa0afb9ad00d93504d7460598a (diff) | |
parent | 5fdb9f0df92e14c3ab92a0c34dfbbd0956131c2c (diff) | |
download | qt-creator-a32e243e6168d0cf329390e74e547fc6b2cc0460.tar.gz |
Merge branch '2.6'
Conflicts:
src/libs/utils/consoleprocess_unix.cpp
Change-Id: I196f61e882bfce94e165d9c724bffee9df1011b7
Diffstat (limited to 'src/plugins')
52 files changed, 759 insertions, 296 deletions
diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index a6ab371b2b..d8d98a8fee 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -113,10 +113,13 @@ QWidget *GeneralSettings::createPage(QWidget *parent) m_page->colorButton->setColor(StyleHelper::requestedBaseColor()); m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting()); #ifdef Q_OS_UNIX - m_page->terminalEdit->setText(ConsoleProcess::terminalEmulator(settings)); + const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators(); + const QString currentTerminal = ConsoleProcess::terminalEmulator(settings); + m_page->terminalComboBox->addItems(availableTerminals); + m_page->terminalComboBox->lineEdit()->setText(currentTerminal); #else m_page->terminalLabel->hide(); - m_page->terminalEdit->hide(); + m_page->terminalComboBox->hide(); m_page->resetTerminalButton->hide(); #endif @@ -175,7 +178,7 @@ void GeneralSettings::apply() EditorManager::instance()->setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex())); #ifdef Q_OS_UNIX ConsoleProcess::setTerminalEmulator(Core::ICore::settings(), - m_page->terminalEdit->text()); + m_page->terminalComboBox->lineEdit()->text()); #ifndef Q_OS_MAC Utils::UnixUtils::setFileBrowser(Core::ICore::settings(), m_page->externalFileBrowserEdit->text()); #endif @@ -200,7 +203,7 @@ void GeneralSettings::resetInterfaceColor() void GeneralSettings::resetTerminal() { #if defined(Q_OS_UNIX) - m_page->terminalEdit->setText(ConsoleProcess::defaultTerminalEmulator() + QLatin1String(" -e")); + m_page->terminalComboBox->lineEdit()->setText(ConsoleProcess::defaultTerminalEmulator()); #endif } diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui index 960d05b098..08b42c94e0 100644 --- a/src/plugins/coreplugin/generalsettings.ui +++ b/src/plugins/coreplugin/generalsettings.ui @@ -124,7 +124,11 @@ </widget> </item> <item row="0" column="1"> - <widget class="QLineEdit" name="terminalEdit"/> + <widget class="QComboBox" name="terminalComboBox"> + <property name="editable"> + <bool>true</bool> + </property> + </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="externalFileBrowserLabel"> @@ -305,7 +309,7 @@ <tabstop>colorButton</tabstop> <tabstop>resetButton</tabstop> <tabstop>languageBox</tabstop> - <tabstop>terminalEdit</tabstop> + <tabstop>terminalComboBox</tabstop> <tabstop>resetTerminalButton</tabstop> <tabstop>externalFileBrowserEdit</tabstop> <tabstop>resetFileBrowserButton</tabstop> diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 7a8015a96f..3aa2137314 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -78,6 +78,7 @@ struct ModeManagerPrivate QSignalMapper *m_signalMapper; Context m_addedContexts; int m_oldCurrent; + bool m_saveSettingsOnModeChange; }; static ModeManagerPrivate *d; @@ -104,10 +105,13 @@ ModeManager::ModeManager(Internal::MainWindow *mainWindow, d->m_oldCurrent = -1; d->m_actionBar = new Internal::FancyActionBar(modeStack); d->m_modeStack->addCornerWidget(d->m_actionBar); + d->m_saveSettingsOnModeChange = false; connect(d->m_modeStack, SIGNAL(currentAboutToShow(int)), SLOT(currentTabAboutToChange(int))); connect(d->m_modeStack, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int))); connect(d->m_signalMapper, SIGNAL(mapped(int)), this, SLOT(slotActivateMode(int))); + connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()), this, SLOT(handleStartup())); + connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(handleShutdown())); } void ModeManager::init() @@ -252,6 +256,12 @@ void ModeManager::enabledStateChanged() } } +void ModeManager::handleStartup() +{ d->m_saveSettingsOnModeChange = true; } + +void ModeManager::handleShutdown() +{ d->m_saveSettingsOnModeChange = false; } + void ModeManager::aboutToRemoveObject(QObject *obj) { IMode *mode = Aggregation::query<IMode>(obj); @@ -290,8 +300,11 @@ void ModeManager::currentTabAboutToChange(int index) { if (index >= 0) { IMode *mode = d->m_modes.at(index); - if (mode) + if (mode) { + if (d->m_saveSettingsOnModeChange) + ICore::saveSettings(); emit currentModeAboutToChange(mode); + } } } diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index cdf26b84ae..d1fc497d9e 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -85,6 +85,8 @@ private slots: void currentTabChanged(int index); void updateModeToolTip(); void enabledStateChanged(); + void handleStartup(); + void handleShutdown(); }; } // namespace Core diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 13eb6dcde7..85ef02020f 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1765,8 +1765,8 @@ void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) fs.toTextCharFormat(TextEditor::C_LOCAL); m_semanticHighlightFormatMap[SemanticInfo::FieldUse] = fs.toTextCharFormat(TextEditor::C_FIELD); - m_semanticHighlightFormatMap[SemanticInfo::StaticUse] = - fs.toTextCharFormat(TextEditor::C_STATIC); + m_semanticHighlightFormatMap[SemanticInfo::EnumerationUse] = + fs.toTextCharFormat(TextEditor::C_ENUMERATION); m_semanticHighlightFormatMap[SemanticInfo::VirtualMethodUse] = fs.toTextCharFormat(TextEditor::C_VIRTUAL_METHOD); m_semanticHighlightFormatMap[SemanticInfo::LabelUse] = diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp index 2c5c79d5d2..88ca5f8928 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.cpp +++ b/src/plugins/cppeditor/cpptypehierarchy.cpp @@ -196,46 +196,24 @@ void CppTypeHierarchyWidget::perform() m_inspectedClass->setup(cppClass); QStandardItem *bases = new QStandardItem(tr("Bases")); m_model->invisibleRootItem()->appendRow(bases); - QVector<CppClass> v; - v.push_back(*cppClass); - buildBaseHierarchy(&v); - m_treeView->expand(m_model->indexFromItem(bases)); + buildHierarchy(*cppClass, bases, true, &CppClass::bases); QStandardItem *derived = new QStandardItem(tr("Derived")); m_model->invisibleRootItem()->appendRow(derived); - foreach (const CppClass &derivedClass, sortClasses(cppClass->derived())) - buildDerivedHierarchy(derivedClass, derived); + buildHierarchy(*cppClass, derived, true, &CppClass::derived); + m_treeView->expandAll(); } } } -void CppTypeHierarchyWidget::buildBaseHierarchy(QVector<CppClass> *s) +void CppTypeHierarchyWidget::buildHierarchy(const CppClass &cppClass, QStandardItem *parent, bool isRoot, HierarchyFunc func) { - const CppClass ¤t = s->back(); - const QList<CppClass> &bases = sortClasses(current.bases()); - if (!bases.isEmpty()) { - foreach (const CppClass &base, bases) { - s->push_back(base); - buildBaseHierarchy(s); - s->pop_back(); - } - } else { - QStandardItem *parent = m_model->item(0, 0); - for (int i = s->size() - 1; i > 0; --i) { - QStandardItem *item = itemForClass(s->at(i)); - parent->appendRow(item); - m_treeView->expand(m_model->indexFromItem(parent)); - parent = item; - } + if (!isRoot) { + QStandardItem *item = itemForClass(cppClass); + parent->appendRow(item); + parent = item; } -} - -void CppTypeHierarchyWidget::buildDerivedHierarchy(const CppClass &cppClass, QStandardItem *parent) -{ - QStandardItem *item = itemForClass(cppClass); - parent->appendRow(item); - foreach (const CppClass &derived, sortClasses(cppClass.derived())) - buildDerivedHierarchy(derived, item); - m_treeView->expand(m_model->indexFromItem(parent)); + foreach (const CppClass &klass, sortClasses((cppClass.*func)())) + buildHierarchy(klass, parent, false, func); } void CppTypeHierarchyWidget::onItemClicked(const QModelIndex &index) diff --git a/src/plugins/cppeditor/cpptypehierarchy.h b/src/plugins/cppeditor/cpptypehierarchy.h index d9c5e8d941..2d862d6904 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.h +++ b/src/plugins/cppeditor/cpptypehierarchy.h @@ -43,6 +43,7 @@ class QStandardItem; class QModelIndex; class QLabel; template <class> class QVector; +template <class> class QList; QT_END_NAMESPACE namespace Core { @@ -77,8 +78,8 @@ private slots: void onItemClicked(const QModelIndex &index); private: - void buildDerivedHierarchy(const CppClass &cppClass, QStandardItem *parent); - void buildBaseHierarchy(QVector<CppClass> *s); + typedef const QList<CppClass> &(CppClass::* HierarchyFunc)() const; + void buildHierarchy(const CppClass &cppClass, QStandardItem *parent, bool isRoot, HierarchyFunc func); CPPEditorWidget *m_cppEditor; Utils::NavigationTreeView *m_treeView; diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp index ab8efe5abf..c24acc2f0e 100644 --- a/src/plugins/cpptools/cppchecksymbols.cpp +++ b/src/plugins/cpptools/cppchecksymbols.cpp @@ -485,7 +485,7 @@ bool CheckSymbols::visit(UsingDirectiveAST *) bool CheckSymbols::visit(EnumeratorAST *ast) { - addUse(ast->identifier_token, SemanticInfo::StaticUse); + addUse(ast->identifier_token, SemanticInfo::EnumerationUse); return true; } @@ -1163,7 +1163,7 @@ bool CheckSymbols::maybeAddTypeOrStatic(const QList<LookupItem> &candidates, Nam UseKind kind = SemanticInfo::TypeUse; if (c->enclosingEnum() != 0) - kind = SemanticInfo::StaticUse; + kind = SemanticInfo::EnumerationUse; const Use use(line, column, length, kind); addUse(use); diff --git a/src/plugins/cpptools/cppsemanticinfo.h b/src/plugins/cpptools/cppsemanticinfo.h index f87feb334d..5502a51b21 100644 --- a/src/plugins/cpptools/cppsemanticinfo.h +++ b/src/plugins/cpptools/cppsemanticinfo.h @@ -48,7 +48,7 @@ public: TypeUse, LocalUse, FieldUse, - StaticUse, + EnumerationUse, VirtualMethodUse, LabelUse, MacroUse, diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index a88b7e9e4e..12de1c163e 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -775,12 +775,59 @@ void CdbEngine::setupInferior() postExtensionCommand("pid", QByteArray(), 0, &CdbEngine::handlePid); } +static QByteArray msvcRunTime(const Abi::OSFlavor flavour) +{ + switch (flavour) { + case Abi::WindowsMsvc2005Flavor: + return "MSVCR80"; + case Abi::WindowsMsvc2008Flavor: + return "MSVCR90"; + case Abi::WindowsMsvc2010Flavor: + return "MSVCR100"; + case Abi::WindowsMsvc2012Flavor: + return "MSVCR110"; // #FIXME: VS2012 beta, will probably be 12 in final? + default: + break; + } + return "MSVCRT"; // MinGW, others. +} + +static QByteArray breakAtFunctionCommand(const QByteArray &function, + const QByteArray &module = QByteArray()) +{ + QByteArray result = "bu "; + if (!module.isEmpty()) { + result += module; + result += '!'; + } + result += function; + return result; +} + void CdbEngine::runEngine() { if (debug) qDebug("runEngine"); foreach (const QString &breakEvent, m_options->breakEvents) postCommand(QByteArray("sxe ") + breakEvent.toAscii(), 0); + // Break functions: each function must be fully qualified, + // else the debugger will slow down considerably. + foreach (const QString &breakFunctionS, m_options->breakFunctions) { + const QByteArray breakFunction = breakFunctionS.toLatin1(); + if (breakFunction == CdbOptions::crtDbgReport) { + // CrtDbgReport(): Add MSVC runtime (debug, release) + // and stop at Wide character version as well + const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor()); + const QByteArray debugModule = module + 'D'; + const QByteArray wideFunc = breakFunction + 'W'; + postCommand(breakAtFunctionCommand(breakFunction, module), 0); + postCommand(breakAtFunctionCommand(wideFunc, module), 0); + postCommand(breakAtFunctionCommand(breakFunction, debugModule), 0); + postCommand(breakAtFunctionCommand(wideFunc, debugModule), 0); + } else { + postCommand(breakAtFunctionCommand(breakFunction), 0); + } + } if (startParameters().startMode == AttachCore) { QTC_ASSERT(!m_coreStopReason.isNull(), return; ); notifyInferiorUnrunnable(); @@ -2990,6 +3037,8 @@ void CdbEngine::handleBreakPoints(const GdbMi &value) qPrintable(reportedResponse.toString())); if (reportedResponse.id.isValid() && !reportedResponse.pending) { const BreakpointModelId mid = handler->findBreakpointByResponseId(reportedResponse.id); + if (!mid.isValid() && reportedResponse.type == BreakpointByFunction) + continue; // Breakpoints from options, CrtDbgReport() and others. QTC_ASSERT(mid.isValid(), continue); const PendingBreakPointMap::iterator it = m_pendingBreakpointMap.find(mid); if (it != m_pendingBreakpointMap.end()) { diff --git a/src/plugins/debugger/cdb/cdboptions.cpp b/src/plugins/debugger/cdb/cdboptions.cpp index 413b2763c8..1c629da941 100644 --- a/src/plugins/debugger/cdb/cdboptions.cpp +++ b/src/plugins/debugger/cdb/cdboptions.cpp @@ -36,6 +36,7 @@ static const char settingsGroupC[] = "CDB2"; static const char symbolPathsKeyC[] = "SymbolPaths"; static const char sourcePathsKeyC[] = "SourcePaths"; static const char breakEventKeyC[] = "BreakEvent"; +static const char breakFunctionsKeyC[] = "BreakFunctions"; static const char additionalArgumentsKeyC[] = "AdditionalArguments"; static const char cdbConsoleKeyC[] = "CDB_Console"; static const char breakpointCorrectionKeyC[] = "BreakpointCorrection"; @@ -43,6 +44,8 @@ static const char breakpointCorrectionKeyC[] = "BreakpointCorrection"; namespace Debugger { namespace Internal { +const char *CdbOptions::crtDbgReport = "CrtDbgReport"; + CdbOptions::CdbOptions() : cdbConsole(false), breakpointCorrection(true) { } @@ -57,6 +60,8 @@ void CdbOptions::clear() symbolPaths.clear(); sourcePaths.clear(); cdbConsole = false; + breakEvents.clear(); + breakFunctions.clear(); } QStringList CdbOptions::oldEngineSymbolPaths(const QSettings *s) @@ -72,6 +77,7 @@ void CdbOptions::fromSettings(QSettings *s) symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList(); sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList(); breakEvents = s->value(keyRoot + QLatin1String(breakEventKeyC), QStringList()).toStringList(); + breakFunctions = s->value(keyRoot + QLatin1String(breakFunctionsKeyC), QStringList()).toStringList(); cdbConsole = s->value(keyRoot + QLatin1String(cdbConsoleKeyC), QVariant(false)).toBool(); breakpointCorrection = s->value(keyRoot + QLatin1String(breakpointCorrectionKeyC), QVariant(true)).toBool(); } @@ -82,6 +88,7 @@ void CdbOptions::toSettings(QSettings *s) const s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths); s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths); s->setValue(QLatin1String(breakEventKeyC), breakEvents); + s->setValue(QLatin1String(breakFunctionsKeyC), breakFunctions); s->setValue(QLatin1String(additionalArgumentsKeyC), additionalArguments); s->setValue(QLatin1String(cdbConsoleKeyC), QVariant(cdbConsole)); s->setValue(QLatin1String(breakpointCorrectionKeyC), QVariant(breakpointCorrection)); @@ -95,7 +102,8 @@ bool CdbOptions::equals(const CdbOptions &rhs) const && additionalArguments == rhs.additionalArguments && symbolPaths == rhs.symbolPaths && sourcePaths == rhs.sourcePaths - && breakEvents == rhs.breakEvents; + && breakEvents == rhs.breakEvents + && breakFunctions == rhs.breakFunctions; } } // namespace Internal diff --git a/src/plugins/debugger/cdb/cdboptions.h b/src/plugins/debugger/cdb/cdboptions.h index 7e29a3eb05..f681c5e9f0 100644 --- a/src/plugins/debugger/cdb/cdboptions.h +++ b/src/plugins/debugger/cdb/cdboptions.h @@ -62,10 +62,13 @@ public: QStringList sourcePaths; // Events to break on (Command 'sxe' with abbreviation and optional parameter) QStringList breakEvents; + QStringList breakFunctions; // Launch CDB's own console instead of Qt Creator's bool cdbConsole; // Perform code-model based correction of breakpoint location. bool breakpointCorrection; + + static const char *crtDbgReport; }; inline bool operator==(const CdbOptions &s1, const CdbOptions &s2) diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index a8b09f35fc..2ee23b4c11 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -30,6 +30,7 @@ #include "cdboptionspage.h" #include "cdboptions.h" +#include "commonoptionspage.h" #include "debuggerinternalconstants.h" #include "cdbengine.h" @@ -176,6 +177,11 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) : eventLayout->setContentsMargins(margins); eventLayout->addWidget(m_breakEventWidget); m_ui.eventGroupBox->setLayout(eventLayout); + m_ui.breakCrtDbgReportCheckBox + ->setText(CommonOptionsPage::msgSetBreakpointAtFunction(CdbOptions::crtDbgReport)); + const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert()."); + m_ui.breakCrtDbgReportCheckBox + ->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptions::crtDbgReport, hint)); } void CdbOptionsPageWidget::setOptions(CdbOptions &o) @@ -186,6 +192,7 @@ void CdbOptionsPageWidget::setOptions(CdbOptions &o) m_breakEventWidget->setBreakEvents(o.breakEvents); m_ui.consoleCheckBox->setChecked(o.cdbConsole); m_ui.breakpointCorrectionCheckBox->setChecked(o.breakpointCorrection); + m_ui.breakCrtDbgReportCheckBox->setChecked(o.breakFunctions.contains(QLatin1String(CdbOptions::crtDbgReport))); } CdbOptions CdbOptionsPageWidget::options() const @@ -197,6 +204,8 @@ CdbOptions CdbOptionsPageWidget::options() const rc.breakEvents = m_breakEventWidget->breakEvents(); rc.cdbConsole = m_ui.consoleCheckBox->isChecked(); rc.breakpointCorrection = m_ui.breakpointCorrectionCheckBox->isChecked(); + if (m_ui.breakCrtDbgReportCheckBox->isChecked()) + rc.breakFunctions.push_back(QLatin1String(CdbOptions::crtDbgReport)); return rc; } diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index 8160cd74db..41b3d6a1ff 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -121,6 +121,18 @@ </widget> </item> <item> + <widget class="QGroupBox" name="breakFunctionGroupBox"> + <property name="title"> + <string>Break on functions:</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="breakCrtDbgReportCheckBox"/> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 1b94f7c22f..b207f56a1e 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -200,6 +200,24 @@ bool CommonOptionsPage::matches(const QString &s) const return m_searchKeywords.contains(s, Qt::CaseInsensitive); } +QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function) +{ + return tr("Stop when %1() is called").arg(QLatin1String(function)); +} + +QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function, + const QString &hint) +{ + QString result = QLatin1String("<html><head/><body>"); + result += tr("Always add a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function)); + if (!hint.isEmpty()) { + result += QLatin1String("<br>"); + result += hint; + } + result += QLatin1String("</body></html>"); + return result; +} + /////////////////////////////////////////////////////////////////////// // // LocalsAndExpressionsOptionsPage diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index b5eaf9392a..4f5b76ab2c 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -79,6 +79,10 @@ public: void finish(); bool matches(const QString &s) const; + static QString msgSetBreakpointAtFunction(const char *function); + static QString msgSetBreakpointAtFunctionToolTip(const char *function, + const QString &hint = QString()); + private: const QSharedPointer<GlobalDebuggerOptions> m_options; QSharedPointer<Utils::SavedActionSet> m_group; diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index b0d9094436..cd1300f276 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -273,15 +273,6 @@ QtcPlugin { } Group { - prefix: "../../shared/json/" - files: [ - "json_global.h", - "json.cpp", - "json.h" - ] - } - - Group { condition: qbs.targetOS == "windows" files: [ "registerpostmortemaction.cpp", diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index 7ca14e05a8..883fb7f5e4 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -52,6 +52,10 @@ namespace Utils { class SavedAction; } +namespace ProjectExplorer { +class RunControl; +} + namespace Debugger { class DebuggerEngine; @@ -122,6 +126,9 @@ public: virtual DebuggerToolTipManager *toolTipManager() const = 0; virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const = 0; + +public slots: + virtual void attachExternalApplication(ProjectExplorer::RunControl *rc) = 0; }; // This is the only way to access the global object. diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index d8e8d7f3c1..f27b8c00e4 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -244,7 +244,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) d->debuginfoPathChooser = new PathChooser(this); d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information")); d->debuginfoPathChooser->setToolTip(tr( - "Base path for external debug information and debug sources." + "Base path for external debug information and debug sources. " "If empty, $SYSROOT/usr/lib/debug will be chosen.")); QFrame *line = new QFrame(this); diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 450c6394a4..8e7bf33ee9 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -369,8 +369,8 @@ void DebuggerMainWindowPrivate::activateQmlCppLayout() Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage); qmlCppContext.add(m_contextsForLanguage.value(CppLanguage)); if (m_toolBars.value(QmlLanguage)) { - m_toolBars.value(QmlLanguage)->show(); m_debugToolBarLayout->insertWidget(1, m_toolBars.value(QmlLanguage)); + m_toolBars.value(QmlLanguage)->show(); } if (m_previousDebugLanguages & QmlLanguage) { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 0e820d241a..08698596f0 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -889,6 +889,7 @@ public slots: void attachToRemoteServer(); void attachToProcess(bool startServerOnly); void attachToRunningApplication(); + void attachExternalApplication(ProjectExplorer::RunControl *rc); void attachToQmlPort(); void startRemoteEngine(); void runScheduled(); @@ -1685,6 +1686,18 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly) } } +void DebuggerPluginPrivate::attachExternalApplication(ProjectExplorer::RunControl *rc) +{ + DebuggerStartParameters sp; + fillParameters(&sp); + sp.attachPID = rc->applicationProcessHandle().pid(); + sp.displayName = tr("Process %1").arg(sp.attachPID); + sp.startMode = AttachExternal; + sp.closeMode = DetachAtClose; + sp.toolChainAbi = rc->abi(); + DebuggerRunControlFactory::createAndScheduleRun(sp); +} + void DebuggerPluginPrivate::attachToQmlPort() { DebuggerStartParameters sp; diff --git a/src/plugins/debugger/debuggerprofileconfigwidget.cpp b/src/plugins/debugger/debuggerprofileconfigwidget.cpp index cc8fa70ee4..81789acfb1 100644 --- a/src/plugins/debugger/debuggerprofileconfigwidget.cpp +++ b/src/plugins/debugger/debuggerprofileconfigwidget.cpp @@ -106,7 +106,7 @@ DebuggerProfileConfigWidget::DebuggerProfileConfigWidget(ProjectExplorer::Profil QString DebuggerProfileConfigWidget::displayName() const { - return tr("Debugger command:"); + return tr("Debugger:"); } void DebuggerProfileConfigWidget::makeReadOnly() diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2ad658598a..5169dda276 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -259,7 +259,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) m_stackNeeded = false; m_preparedForQmlBreak = false; m_disassembleUsesComma = false; - m_actingOnExpectedStop = false; + m_terminalTrap = startParameters.useTerminal; m_fullStartDone = false; m_forceAsyncModel = false; @@ -467,9 +467,10 @@ void GdbEngine::handleResponse(const QByteArray &buff) m_pendingLogStreamOutput.clear(); m_pendingConsoleStreamOutput.clear(); } else if (asyncClass == "running") { - if (state() == InferiorRunOk) { - // We get multiple *running after thread creation. - showMessage(_("NOTE: INFERIOR STILL RUNNING.")); + if (state() == InferiorRunOk || state() == InferiorSetupRequested) { + // We get multiple *running after thread creation and in Windows terminals. + showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1."). + arg(QLatin1String(DebuggerEngine::stateName(state())))); } else { notifyInferiorRunOk(); } @@ -1376,9 +1377,15 @@ void GdbEngine::handleAqcuiredInferior() void GdbEngine::handleStopResponse(const GdbMi &data) { + // Ignore trap on Windows terminals, which results in + // spurious "* stopped" message. + if (!data.isValid() && m_terminalTrap && Abi::hostAbi().os() == Abi::WindowsOS) { + m_terminalTrap = false; + showMessage(_("IGNORING TERMINAL SIGTRAP"), LogMisc); + return; + } // This is gdb 7+'s initial *stopped in response to attach. // For consistency, we just discard it. - m_actingOnExpectedStop = false; if (state() == InferiorSetupRequested) return; @@ -1421,11 +1428,19 @@ void GdbEngine::handleStopResponse(const GdbMi &data) BreakpointResponseId rid(data.findChild("bkptno").data()); const GdbMi frame = data.findChild("frame"); - const int lineNumber = frame.findChild("line").data().toInt(); - QString fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data())); - - if (fullName.isEmpty()) - fullName = QString::fromLocal8Bit(frame.findChild("file").data()); + int lineNumber = 0; + QString fullName; + if (frame.isValid()) { + const GdbMi lineNumberG = frame.findChild("line"); + if (lineNumberG.isValid()) { + lineNumber = lineNumberG.data().toInt(); + fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data())); + if (fullName.isEmpty()) + fullName = QString::fromLocal8Bit(frame.findChild("file").data()); + } // found line number + } else { + showMessage(_("INVALID STOPPED REASON"), LogWarning); + } if (rid.isValid() && frame.isValid() && !isQmlStepBreakpoint(rid) @@ -1456,7 +1471,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) if (!m_commandsToRunOnTemporaryBreak.isEmpty()) { QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state()); - m_actingOnExpectedStop = true; notifyInferiorStopOk(); flushQueuedCommands(); if (state() == InferiorStopOk) { @@ -1489,7 +1503,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) // That's expected. } else { QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state()); - m_actingOnExpectedStop = true; notifyInferiorStopOk(); } @@ -1656,12 +1669,6 @@ void GdbEngine::handleStop2(const GdbMi &data) && reason == "signal-received" && data.findChild("signal-name").data() == "SIGTRAP") { - if (!m_actingOnExpectedStop) { - // Ignore signals from command line start up traps. - showMessage(_("INTERNAL CONTINUE AFTER SIGTRAP"), LogMisc); - continueInferiorInternal(); - return; - } // This is the stopper thread. That also means that the // reported thread is not the one we'd like to expose // to the user. @@ -3771,9 +3778,23 @@ void GdbEngine::handleRegisterListNames(const GdbResponse &response) } Registers registers; - foreach (const GdbMi &item, response.data.findChild("register-names").children()) - if (!item.data().isEmpty()) + int gdbRegisterNumber = 0, internalIndex = 0; + + // This both handles explicitly having space for all the registers and + // initializes all indices to 0, giving missing registers a sane default + // in the event of something wacky. + GdbMi names = response.data.findChild("register-names"); + m_registerNumbers.resize(names.childCount()); + foreach (const GdbMi &item, names.children()) { + // Since we throw away missing registers to eliminate empty rows + // we need to maintain a mapping of GDB register numbers to their + // respective indices in the register list. + if (!item.data().isEmpty()) { + m_registerNumbers[gdbRegisterNumber] = internalIndex++; registers.append(Register(item.data())); + } + gdbRegisterNumber++; + } registerHandler()->setRegisters(registers); } @@ -3785,14 +3806,15 @@ void GdbEngine::handleRegisterListValues(const GdbResponse &response) Registers registers = registerHandler()->registers(); const int registerCount = registers.size(); + const int gdbRegisterCount = m_registerNumbers.size(); // 24^done,register-values=[{number="0",value="0xf423f"},...] const GdbMi values = response.data.findChild("register-values"); QTC_ASSERT(registerCount == values.children().size(), return); foreach (const GdbMi &item, values.children()) { const int number = item.findChild("number").data().toInt(); - if (number >= 0 && number < registerCount) - registers[number].value = item.findChild("value").data(); + if (number >= 0 && number < gdbRegisterCount) + registers[m_registerNumbers[number]].value = item.findChild("value").data(); } registerHandler()->setAndMarkRegisters(registers); } @@ -5217,7 +5239,9 @@ bool GdbEngine::attemptQuickStart() const void GdbEngine::checkForReleaseBuild() { - QString binary = startParameters().executable; + const QString binary = startParameters().executable; + if (binary.isEmpty()) + return; ElfReader reader(binary); ElfData elfData = reader.readHeaders(); QString error = reader.errorString(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 18adc7fc17..246eb552f7 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -495,6 +495,7 @@ private: ////////// View & Data Stuff ////////// void setRegisterValue(int nr, const QString &value); void handleRegisterListNames(const GdbResponse &response); void handleRegisterListValues(const GdbResponse &response); + QVector<int> m_registerNumbers; // Map GDB register numbers to indices // // Disassembler specific stuff @@ -685,7 +686,7 @@ protected: QString m_lastWinException; QString m_lastMissingDebugInfo; BreakpointResponseId m_qFatalBreakpointResponseId; - bool m_actingOnExpectedStop; + bool m_terminalTrap; bool usesExecInterrupt() const; diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 5f3bc80efa..4535f5cdc4 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -29,6 +29,7 @@ **************************************************************************/ #include "gdboptionspage.h" +#include "commonoptionspage.h" #include "debuggeractions.h" #include "debuggercore.h" #include "debuggerinternalconstants.h" @@ -181,22 +182,16 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent) "when starting GDB.</body></html>")); checkBoxBreakOnWarning = new QCheckBox(groupBoxGeneral); - checkBoxBreakOnWarning->setText(GdbOptionsPage::tr("Stop when qWarning() is called")); - checkBoxBreakOnWarning->setToolTip(GdbOptionsPage::tr( - "<html><head/><body>Always add a breakpoint on the <i>qWarning()</i> function." - "</body></html>")); + checkBoxBreakOnWarning->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning")); + checkBoxBreakOnWarning->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning")); checkBoxBreakOnFatal = new QCheckBox(groupBoxGeneral); - checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when qFatal() is called")); - checkBoxBreakOnFatal->setToolTip(GdbOptionsPage::tr( - "<html><head/><body>Always add a breakpoint on the <i>qFatal()</i> function." - "</body></html>")); + checkBoxBreakOnFatal->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal")); + checkBoxBreakOnFatal->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal")); checkBoxBreakOnAbort = new QCheckBox(groupBoxGeneral); - checkBoxBreakOnAbort->setText(GdbOptionsPage::tr("Stop when abort() is called")); - checkBoxBreakOnAbort->setToolTip(GdbOptionsPage::tr( - "<html><head/><body><p>Always add a breakpoint on the <i>abort()</i> function." - "</p></body></html>")); + checkBoxBreakOnAbort->setText(CommonOptionsPage::msgSetBreakpointAtFunction("abort")); + checkBoxBreakOnAbort->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort")); checkBoxEnableReverseDebugging = new QCheckBox(groupBoxGeneral); checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging")); diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index 2e2fb33457..c5f142d6ea 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -280,16 +280,59 @@ bool hasSideEffects(const QString &exp) bool isKeyWord(const QString &exp) { // FIXME: incomplete - return exp == QLatin1String("class") - || exp == QLatin1String("const") - || exp == QLatin1String("do") - || exp == QLatin1String("if") - || exp == QLatin1String("return") - || exp == QLatin1String("struct") - || exp == QLatin1String("template") - || exp == QLatin1String("void") - || exp == QLatin1String("volatile") - || exp == QLatin1String("while"); + QTC_ASSERT(!exp.isEmpty(), return false); + switch (exp.at(0).toAscii()) { + case 'a': + return exp == QLatin1String("auto"); + case 'b': + return exp == QLatin1String("break"); + case 'c': + return exp == QLatin1String("case") || exp == QLatin1String("class") + || exp == QLatin1String("const") || exp == QLatin1String("constexpr") + || exp == QLatin1String("catch") || exp == QLatin1String("continue") + || exp == QLatin1String("const_cast"); + case 'd': + return exp == QLatin1String("do") || exp == QLatin1String("default") + || exp == QLatin1String("delete") || exp == QLatin1String("decltype") + || exp == QLatin1String("dynamic_cast"); + case 'e': + return exp == QLatin1String("else") || exp == QLatin1String("extern") + || exp == QLatin1String("enum") || exp == QLatin1String("explicit"); + case 'f': + return exp == QLatin1String("for") || exp == QLatin1String("friend"); // 'final'? + case 'g': + return exp == QLatin1String("goto"); + case 'i': + return exp == QLatin1String("if") || exp == QLatin1String("inline"); + case 'n': + return exp == QLatin1String("new") || exp == QLatin1String("namespace") + || exp == QLatin1String("noexcept"); + case 'm': + return exp == QLatin1String("mutable"); + case 'o': + return exp == QLatin1String("operator"); // 'override'? + case 'p': + return exp == QLatin1String("public") || exp == QLatin1String("protected") + || exp == QLatin1String("private"); + case 'r': + return exp == QLatin1String("return") || exp == QLatin1String("register") + || exp == QLatin1String("reinterpret_cast"); + case 's': + return exp == QLatin1String("struct") || exp == QLatin1String("switch") + || exp == QLatin1String("static_cast"); + case 't': + return exp == QLatin1String("template") || exp == QLatin1String("typename") + || exp == QLatin1String("try") || exp == QLatin1String("throw") + || exp == QLatin1String("typedef"); + case 'u': + return exp == QLatin1String("union") || exp == QLatin1String("using"); + case 'v': + return exp == QLatin1String("void") || exp == QLatin1String("volatile") + || exp == QLatin1String("virtual"); + case 'w': + return exp == QLatin1String("while"); + } + return false; } bool startsWithDigit(const QString &str) diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index 73b6195c46..0ea7307bae 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -279,10 +279,15 @@ bool FindToolBar::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); if (ke->key() == Qt::Key_Down) { - if (obj == m_ui.findEdit) + if (obj == m_ui.findEdit) { + if (m_ui.findEdit->text().isEmpty()) + m_findCompleter->setCompletionPrefix(QString()); m_findCompleter->complete(); - else if (obj == m_ui.replaceEdit) + } else if (obj == m_ui.replaceEdit) { + if (m_ui.replaceEdit->text().isEmpty()) + m_replaceCompleter->setCompletionPrefix(QString()); m_replaceCompleter->complete(); + } } } diff --git a/src/plugins/find/searchresultwidget.cpp b/src/plugins/find/searchresultwidget.cpp index 4c6bfe1880..384f263dcf 100644 --- a/src/plugins/find/searchresultwidget.cpp +++ b/src/plugins/find/searchresultwidget.cpp @@ -242,8 +242,8 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search m_sizeWarningActive = true; emit paused(true); Core::InfoBarEntry info(QLatin1String(SIZE_WARNING_ID), - tr("The search resulted in more than %1 items, do you still want to continue?") - .arg(SEARCHRESULT_WARNING_LIMIT)); + tr("The search resulted in more than %n items, do you still want to continue?", + 0, SEARCHRESULT_WARNING_LIMIT)); info.setCancelButtonInfo(tr("Cancel"), this, SLOT(cancelAfterSizeWarning())); info.setCustomButtonInfo(tr("Continue"), this, SLOT(continueAfterSizeWarning())); m_infoBar.addInfo(info); diff --git a/src/plugins/madde/debianmanager.cpp b/src/plugins/madde/debianmanager.cpp index cffc444c97..d3273589ac 100644 --- a/src/plugins/madde/debianmanager.cpp +++ b/src/plugins/madde/debianmanager.cpp @@ -507,7 +507,8 @@ bool DebianManager::setPackageManagerName(const Utils::FileName &debianDir, Core QIcon DebianManager::packageManagerIcon(const Utils::FileName &debianDir, QString *error) { - const QByteArray &base64Icon = controlFileFieldValue(debianDir, IconFieldName, true); + const QByteArray &base64Icon + = controlFileFieldValue(controlFilePath(debianDir), IconFieldName, true); if (base64Icon.isEmpty()) return QIcon(); QPixmap pixmap; @@ -695,7 +696,7 @@ void DebianManager::controlWasChanged() WatchableFile *file = qobject_cast<WatchableFile *>(sender()); if (!file) return; - emit controlChanged(Utils::FileName::fromString(file->fileName())); + emit controlChanged(Utils::FileName::fromString(file->fileName()).parentDir()); } void DebianManager::changelogWasChanged() @@ -703,7 +704,7 @@ void DebianManager::changelogWasChanged() WatchableFile *file = qobject_cast<WatchableFile *>(sender()); if (!file) return; - emit changelogChanged(Utils::FileName::fromString(file->fileName())); + emit changelogChanged(Utils::FileName::fromString(file->fileName()).parentDir()); } Utils::FileName DebianManager::changelogFilePath(const Utils::FileName &debianDir) diff --git a/src/plugins/madde/madde.pro b/src/plugins/madde/madde.pro index 35205d52c5..7bf61f30c0 100644 --- a/src/plugins/madde/madde.pro +++ b/src/plugins/madde/madde.pro @@ -48,7 +48,8 @@ HEADERS += \ maddedevicetester.h \ maddedeviceconfigurationfactory.h \ maddedevice.h \ - maemoapplicationrunnerhelperactions.h + maemoapplicationrunnerhelperactions.h \ + maddeqemustartstep.h SOURCES += \ maddeplugin.cpp \ @@ -90,7 +91,8 @@ SOURCES += \ maddedevicetester.cpp \ maemorunconfiguration.cpp \ maddedevice.cpp \ - maemoapplicationrunnerhelperactions.cpp + maemoapplicationrunnerhelperactions.cpp \ + maddeqemustartstep.cpp FORMS += \ maemopackagecreationwidget.ui \ diff --git a/src/plugins/madde/madde.qbs b/src/plugins/madde/madde.qbs index a74597f127..723c5d5e07 100644 --- a/src/plugins/madde/madde.qbs +++ b/src/plugins/madde/madde.qbs @@ -30,6 +30,8 @@ QtcPlugin { "maddeplugin.h", "maddeuploadandinstallpackagesteps.cpp", "maddeuploadandinstallpackagesteps.h", + "maddeqemustartstep.cpp", + "maddeqemustartstep.h", "maemoconstants.h", "maemodeploybymountsteps.cpp", "maemodeploybymountsteps.h", diff --git a/src/plugins/madde/maddeqemustartstep.cpp b/src/plugins/madde/maddeqemustartstep.cpp new file mode 100644 index 0000000000..a2748712d5 --- /dev/null +++ b/src/plugins/madde/maddeqemustartstep.cpp @@ -0,0 +1,128 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: http://www.qt-project.org/ +** +** +** 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. +** +** 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. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +**************************************************************************/ +#include "maddeqemustartstep.h" + +#include "maemoqemumanager.h" + +#include <qtsupport/baseqtversion.h> +#include <qtsupport/qtprofileinformation.h> +#include <remotelinux/abstractremotelinuxdeployservice.h> +#include <utils/qtcassert.h> + +using namespace ProjectExplorer; +using namespace RemoteLinux; + +namespace Madde { +namespace Internal { +class MaddeQemuStartService : public AbstractRemoteLinuxDeployService +{ + Q_OBJECT +public: + MaddeQemuStartService(QObject *parent = 0) : AbstractRemoteLinuxDeployService(parent) {} + +private: + bool isDeploymentNecessary() const { return true; } + + void doDeviceSetup() + { + emit progressMessage(tr("Checking whether to start Qemu...")); + if (deviceConfiguration()->machineType() == IDevice::Hardware) { + emit progressMessage(tr("Target device is not an emulator. Nothing to do.")); + handleDeviceSetupDone(true); + return; + } + + if (MaemoQemuManager::instance().qemuIsRunning()) { + emit progressMessage(tr("Qemu is already running. Nothing to do.")); + handleDeviceSetupDone(true); + return; + } + + MaemoQemuRuntime rt; + const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile()); + if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { + MaemoQemuManager::instance().startRuntime(); + emit errorMessage(tr("Cannot deploy: Qemu was not running. " + "It has now been started up for you, but it will take " + "a bit of time until it is ready. Please try again then.")); + } else { + emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled " + "for this Qt version.")); + } + handleDeviceSetupDone(false); + } + + void stopDeviceSetup() { handleDeviceSetupDone(false); } + void doDeploy() { handleDeploymentDone(); } + void stopDeployment() { handleDeploymentDone(); } +}; + +MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl) + : AbstractRemoteLinuxDeployStep(bsl, stepId()) +{ + ctor(); + setDefaultDisplayName(stepDisplayName()); +} + +MaddeQemuStartStep::MaddeQemuStartStep(BuildStepList *bsl, MaddeQemuStartStep *other) + : AbstractRemoteLinuxDeployStep(bsl, other) +{ + ctor(); +} + +AbstractRemoteLinuxDeployService *MaddeQemuStartStep::deployService() const +{ + return m_service; +} + +bool MaddeQemuStartStep::initInternal(QString *error) +{ + return deployService()->isDeploymentPossible(error); +} + +void MaddeQemuStartStep::ctor() +{ + m_service = new MaddeQemuStartService(this); +} + +Core::Id MaddeQemuStartStep::stepId() +{ + return Core::Id("Madde.MaddeQemuCheckStep"); +} + +QString MaddeQemuStartStep::stepDisplayName() +{ + return tr("Start Qemu, if necessary"); +} + +} // namespace Internal +} // namespace Madde + +#include "maddeqemustartstep.moc" diff --git a/src/plugins/madde/maddeqemustartstep.h b/src/plugins/madde/maddeqemustartstep.h new file mode 100644 index 0000000000..384faeddf8 --- /dev/null +++ b/src/plugins/madde/maddeqemustartstep.h @@ -0,0 +1,61 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: http://www.qt-project.org/ +** +** +** 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. +** +** 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. +** +** Other Usage +** +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +**************************************************************************/ +#ifndef MAEMOQEMUCHECKSTEP_H +#define MAEMOQEMUCHECKSTEP_H + +#include <remotelinux/abstractremotelinuxdeploystep.h> + +namespace Madde { +namespace Internal { +class MaddeQemuStartService; + +class MaddeQemuStartStep : public RemoteLinux::AbstractRemoteLinuxDeployStep +{ + Q_OBJECT +public: + MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl); + MaddeQemuStartStep(ProjectExplorer::BuildStepList *bsl, MaddeQemuStartStep *other); + + static Core::Id stepId(); + static QString stepDisplayName(); + +private: + void ctor(); + + RemoteLinux::AbstractRemoteLinuxDeployService *deployService() const; + bool initInternal(QString *error = 0); + + MaddeQemuStartService *m_service; +}; + +} // namespace Internal +} // namespace Madde + +#endif // MAEMOQEMUCHECKSTEP_H diff --git a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp index 6818171b44..9a5c918f45 100644 --- a/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp +++ b/src/plugins/madde/maddeuploadandinstallpackagesteps.cpp @@ -35,7 +35,6 @@ #include "maemoqemumanager.h" #include <projectexplorer/target.h> -#include <qtsupport/baseqtversion.h> #include <qtsupport/qtprofileinformation.h> #include <remotelinux/abstractuploadandinstallpackageservice.h> #include <remotelinux/remotelinuxdeployconfiguration.h> @@ -57,32 +56,6 @@ protected: { } - void doDeviceSetup() - { - if (deviceConfiguration()->machineType() == IDevice::Hardware) { - handleDeviceSetupDone(true); - return; - } - - if (MaemoQemuManager::instance().qemuIsRunning()) { - handleDeviceSetupDone(true); - return; - } - - MaemoQemuRuntime rt; - const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile()); - if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { - MaemoQemuManager::instance().startRuntime(); - emit errorMessage(tr("Cannot deploy: Qemu was not running. " - "It has now been started up for you, but it will take " - "a bit of time until it is ready. Please try again then.")); - } else { - emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled " - "for this Qt version.")); - } - handleDeviceSetupDone(false); - } - private: QString uploadDir() const { diff --git a/src/plugins/madde/maemodeploybymountsteps.cpp b/src/plugins/madde/maemodeploybymountsteps.cpp index 70b460ca9d..4045ae583d 100644 --- a/src/plugins/madde/maemodeploybymountsteps.cpp +++ b/src/plugins/madde/maemodeploybymountsteps.cpp @@ -41,8 +41,6 @@ #include <projectexplorer/project.h> #include <projectexplorer/target.h> #include <qt4projectmanager/qt4buildconfiguration.h> -#include <qtsupport/baseqtversion.h> -#include <qtsupport/qtprofileinformation.h> #include <remotelinux/abstractremotelinuxdeployservice.h> #include <remotelinux/linuxdevice.h> #include <utils/hostosinfo.h> @@ -156,28 +154,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup() { QTC_ASSERT(m_state == Inactive, return); - if (deviceConfiguration()->machineType() == IDevice::Hardware) { - handleDeviceSetupDone(true); - return; - } - - if (MaemoQemuManager::instance().qemuIsRunning()) { - handleDeviceSetupDone(true); - return; - } - - MaemoQemuRuntime rt; - const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile()); - if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { - MaemoQemuManager::instance().startRuntime(); - emit errorMessage(tr("Cannot deploy: Qemu was not running. " - "It has now been started up for you, but it will take " - "a bit of time until it is ready. Please try again then.")); - } else { - emit errorMessage(tr("Cannot deploy: You want to deploy to Qemu, but it is not enabled " - "for this Qt version.")); - } - handleDeviceSetupDone(false); + handleDeviceSetupDone(true); } void AbstractMaemoDeployByMountService::stopDeviceSetup() diff --git a/src/plugins/madde/maemodeploystepfactory.cpp b/src/plugins/madde/maemodeploystepfactory.cpp index b1ea5655e4..475bd7b8f1 100644 --- a/src/plugins/madde/maemodeploystepfactory.cpp +++ b/src/plugins/madde/maemodeploystepfactory.cpp @@ -31,6 +31,7 @@ #include "maemodeploystepfactory.h" #include "maemoconstants.h" +#include "maddeqemustartstep.h" #include "maddeuploadandinstallpackagesteps.h" #include "maemodeploybymountsteps.h" #include "maemoinstalltosysrootstep.h" @@ -73,16 +74,18 @@ QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *pare platform = version->platformName(); if (platform == QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM) { - ids << Core::Id(MaemoMakeInstallToSysrootStep::Id) - << Core::Id(MaemoInstallDebianPackageToSysrootStep::Id) - << Core::Id(MaemoUploadAndInstallPackageStep::stepId()) - << Core::Id(MaemoInstallPackageViaMountStep::stepId()) - << Core::Id(MaemoCopyFilesViaMountStep::stepId()); + ids << MaemoMakeInstallToSysrootStep::Id + << MaemoInstallDebianPackageToSysrootStep::Id + << MaemoUploadAndInstallPackageStep::stepId() + << MaemoInstallPackageViaMountStep::stepId() + << MaemoCopyFilesViaMountStep::stepId() + << MaddeQemuStartStep::stepId(); } else if (platform == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM) { - ids << Core::Id(MaemoMakeInstallToSysrootStep::Id) - << Core::Id(MaemoInstallDebianPackageToSysrootStep::Id) - << Core::Id(MaemoUploadAndInstallPackageStep::stepId()) - << Core::Id(GenericDirectUploadStep::stepId()); + ids << MaemoMakeInstallToSysrootStep::Id + << MaemoInstallDebianPackageToSysrootStep::Id + << MaemoUploadAndInstallPackageStep::stepId() + << GenericDirectUploadStep::stepId() + << MaddeQemuStartStep::stepId(); } return ids; @@ -106,6 +109,8 @@ QString MaemoDeployStepFactory::displayNameForId(const Core::Id id) const return GenericDirectUploadStep::displayName(); if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) return RemoteLinuxCheckForFreeDiskSpaceStep::stepDisplayName(); + if (id == MaddeQemuStartStep::stepId()) + return MaddeQemuStartStep::stepDisplayName(); return QString(); } @@ -136,7 +141,8 @@ BuildStep *MaemoDeployStepFactory::create(BuildStepList *parent, const Core::Id return new GenericDirectUploadStep(parent, id); if (id == RemoteLinuxCheckForFreeDiskSpaceStep::stepId()) return new RemoteLinuxCheckForFreeDiskSpaceStep(parent); - + if (id == MaddeQemuStartStep::stepId()) + return new MaddeQemuStartStep(parent); return 0; } @@ -187,6 +193,8 @@ BuildStep *MaemoDeployStepFactory::clone(BuildStepList *parent, BuildStep *produ qobject_cast<GenericDirectUploadStep *>(product)); } else if (RemoteLinuxCheckForFreeDiskSpaceStep * const other = qobject_cast<RemoteLinuxCheckForFreeDiskSpaceStep *>(product)) { return new RemoteLinuxCheckForFreeDiskSpaceStep(parent, other); + } else if (MaddeQemuStartStep * const other = qobject_cast<MaddeQemuStartStep *>(product)) { + return new MaddeQemuStartStep(parent, other); } return 0; diff --git a/src/plugins/madde/qt4maemodeployconfiguration.cpp b/src/plugins/madde/qt4maemodeployconfiguration.cpp index 27bd59d576..79e89d0027 100644 --- a/src/plugins/madde/qt4maemodeployconfiguration.cpp +++ b/src/plugins/madde/qt4maemodeployconfiguration.cpp @@ -30,6 +30,7 @@ #include "qt4maemodeployconfiguration.h" #include "debianmanager.h" +#include "maddeqemustartstep.h" #include "maddeuploadandinstallpackagesteps.h" #include "maemoconstants.h" #include "maemodeploybymountsteps.h" @@ -123,12 +124,18 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging() Utils::FileName debianDir = DebianManager::debianDirectory(target()); DebianManager::ActionStatus status = DebianManager::createTemplate(bc, debianDir); - if (status == DebianManager::NoActionRequired || - status == DebianManager::ActionFailed) + if (status == DebianManager::ActionFailed) + return; + + DebianManager * const dm = DebianManager::instance(); + dm->monitor(debianDir); + connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), this, + SLOT(debianDirChanged(Utils::FileName))); + + if (status == DebianManager::NoActionRequired) return; Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile()); - DebianManager *dm = DebianManager::instance(); QString projectName = target()->project()->displayName(); if (!DebianManager::hasPackageManagerIcon(debianDir)) { @@ -139,11 +146,6 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging() dm->setPackageManagerIcon(debianDir, deviceType, iconPath); } - - - dm->monitor(debianDir); - connect(dm, SIGNAL(debianDirectoryChanged(Utils::FileName)), this, SLOT(debianDirChanged(Utils::FileName))); - // Set up aegis manifest on harmattan: if (deviceType == HarmattanOsType) { Utils::FileName manifest = debianDir; @@ -254,18 +256,21 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent, if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) { dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(1, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(2, new MaemoCopyFilesViaMountStep(dc->stepList())); + dc->stepList()->insertStep(1, new MaddeQemuStartStep(dc->stepList())); + dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); + dc->stepList()->insertStep(3, new MaemoCopyFilesViaMountStep(dc->stepList())); } else if (id == Qt4MaemoDeployConfiguration::fremantleWithPackagingId()) { dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(3, new MaemoInstallPackageViaMountStep(dc->stepList())); + dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList())); + dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); + dc->stepList()->insertStep(4, new MaemoInstallPackageViaMountStep(dc->stepList())); } else if (id == Qt4MaemoDeployConfiguration::harmattanId()) { dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList())); dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList())); - dc->stepList()->insertStep(2, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); - dc->stepList()->insertStep(3, new MaemoUploadAndInstallPackageStep(dc->stepList())); + dc->stepList()->insertStep(2, new MaddeQemuStartStep(dc->stepList())); + dc->stepList()->insertStep(3, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); + dc->stepList()->insertStep(4, new MaemoUploadAndInstallPackageStep(dc->stepList())); } return dc; } diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 6ac1e47f56..d91fabb87e 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -40,7 +40,6 @@ SUBDIRS = plugin_coreplugin \ plugin_qmljstools \ plugin_macros \ debugger/dumper.pro \ - plugin_qmlprofiler \ plugin_remotelinux \ plugin_android \ plugin_madde \ @@ -63,24 +62,19 @@ include(../../qtcreator.pri) contains(QT_CONFIG, declarative)|contains(QT_CONFIG, quick1) { SUBDIRS += \ - plugin_qmlprojectmanager + plugin_qmlprojectmanager \ + plugin_qmlprofiler include(../private_headers.pri) exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) { - - minQtVersion(4, 7, 1) { SUBDIRS += plugin_qmldesigner - } else { - warning() - warning("QmlDesigner plugin has been disabled.") - warning("QmlDesigner requires Qt 4.7.1 or later.") - } } else { - warning() warning("QmlDesigner plugin has been disabled.") warning("The plugin depends on private headers from QtDeclarative module.") warning("To enable it, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.") } +} else { + warning("QmlProjectManager, QmlProfiler and QmlDesigner plugins have been disabled: The plugins require QtDeclarative (Qt 4.x) or QtQuick1 (Qt 5.x)"); } include (debugger/lldb/guest/qtcreator-lldb.pri) diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index cb50d71a60..9c9177482f 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -625,10 +625,10 @@ void MiniProjectTargetSelector::setActiveRunConfiguration(ProjectExplorer::Proje void MiniProjectTargetSelector::projectAdded(ProjectExplorer::Project *project) { connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), - this, SLOT(addedTarget(ProjectExplorer::Target*))); + this, SLOT(slotAddedTarget(ProjectExplorer::Target*))); connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), - this, SLOT(removedTarget(ProjectExplorer::Target*))); + this, SLOT(slotRemovedTarget(ProjectExplorer::Target*))); foreach (Target *t, project->targets()) addedTarget(t); @@ -643,10 +643,10 @@ void MiniProjectTargetSelector::projectAdded(ProjectExplorer::Project *project) void MiniProjectTargetSelector::projectRemoved(ProjectExplorer::Project *project) { disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), - this, SLOT(addedTarget(ProjectExplorer::Target*))); + this, SLOT(slotAddedTarget(ProjectExplorer::Target*))); disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), - this, SLOT(removedTarget(ProjectExplorer::Target*))); + this, SLOT(slotRemovedTarget(ProjectExplorer::Target*))); foreach (Target *t, project->targets()) removedTarget(t); @@ -661,19 +661,19 @@ void MiniProjectTargetSelector::projectRemoved(ProjectExplorer::Project *project void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target) { connect(target, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), - this, SLOT(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + this, SLOT(slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); connect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), - this, SLOT(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + this, SLOT(slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); connect(target, SIGNAL(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)), - this, SLOT(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); + this, SLOT(slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); connect(target, SIGNAL(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)), - this, SLOT(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); + this, SLOT(slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); connect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)), - this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration*))); + this, SLOT(slotAddedRunConfiguration(ProjectExplorer::RunConfiguration*))); connect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)), - this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration*))); + this, SLOT(slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration*))); if (target->project() == m_project) m_listWidgets[TARGET]->addProjectConfiguration(target); @@ -684,7 +684,11 @@ void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target) addedDeployConfiguration(dc); foreach (RunConfiguration *rc, target->runConfigurations()) addedRunConfiguration(rc); +} +void MiniProjectTargetSelector::slotAddedTarget(ProjectExplorer::Target *target) +{ + addedTarget(target); updateTargetListVisible(); updateBuildListVisible(); updateDeployListVisible(); @@ -694,19 +698,19 @@ void MiniProjectTargetSelector::addedTarget(ProjectExplorer::Target *target) void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target) { disconnect(target, SIGNAL(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), - this, SLOT(addedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + this, SLOT(slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); disconnect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)), - this, SLOT(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); + this, SLOT(slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration*))); disconnect(target, SIGNAL(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*)), - this, SLOT(addedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); + this, SLOT(slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); disconnect(target, SIGNAL(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*)), - this, SLOT(removedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); + this, SLOT(slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration*))); disconnect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)), - this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration*))); + this, SLOT(slotAddedRunConfiguration(ProjectExplorer::RunConfiguration*))); disconnect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)), - this, SLOT(removedRunConfiguration(ProjectExplorer::RunConfiguration*))); + this, SLOT(slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration*))); if (target->project() == m_project) m_listWidgets[TARGET]->removeProjectConfiguration(target); @@ -717,6 +721,11 @@ void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target) removedDeployConfiguration(dc); foreach (RunConfiguration *rc, target->runConfigurations()) removedRunConfiguration(rc); +} + +void MiniProjectTargetSelector::slotRemovedTarget(ProjectExplorer::Target *target) +{ + removedTarget(target); updateTargetListVisible(); updateBuildListVisible(); @@ -724,10 +733,17 @@ void MiniProjectTargetSelector::removedTarget(ProjectExplorer::Target *target) updateRunListVisible(); } + void MiniProjectTargetSelector::addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) { if (bc->target() == m_target) m_listWidgets[BUILD]->addProjectConfiguration(bc); +} + +void MiniProjectTargetSelector::slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) +{ + if (bc->target() == m_target) + m_listWidgets[BUILD]->addProjectConfiguration(bc); updateBuildListVisible(); } @@ -735,6 +751,12 @@ void MiniProjectTargetSelector::removedBuildConfiguration(ProjectExplorer::Build { if (bc->target() == m_target) m_listWidgets[BUILD]->removeProjectConfiguration(bc); +} + +void MiniProjectTargetSelector::slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) +{ + if (bc->target() == m_target) + m_listWidgets[BUILD]->removeProjectConfiguration(bc); updateBuildListVisible(); } @@ -742,6 +764,12 @@ void MiniProjectTargetSelector::addedDeployConfiguration(ProjectExplorer::Deploy { if (dc->target() == m_target) m_listWidgets[DEPLOY]->addProjectConfiguration(dc); +} + +void MiniProjectTargetSelector::slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc) +{ + if (dc->target() == m_target) + m_listWidgets[DEPLOY]->addProjectConfiguration(dc); updateDeployListVisible(); } @@ -749,6 +777,12 @@ void MiniProjectTargetSelector::removedDeployConfiguration(ProjectExplorer::Depl { if (dc->target() == m_target) m_listWidgets[DEPLOY]->removeProjectConfiguration(dc); +} + +void MiniProjectTargetSelector::slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc) +{ + if (dc->target() == m_target) + m_listWidgets[DEPLOY]->removeProjectConfiguration(dc); updateDeployListVisible(); } @@ -756,6 +790,12 @@ void MiniProjectTargetSelector::addedRunConfiguration(ProjectExplorer::RunConfig { if (rc->target() == m_target) m_listWidgets[RUN]->addProjectConfiguration(rc); +} + +void MiniProjectTargetSelector::slotAddedRunConfiguration(ProjectExplorer::RunConfiguration *rc) +{ + if (rc->target() == m_target) + m_listWidgets[RUN]->addProjectConfiguration(rc); updateRunListVisible(); } @@ -763,6 +803,12 @@ void MiniProjectTargetSelector::removedRunConfiguration(ProjectExplorer::RunConf { if (rc->target() == m_target) m_listWidgets[RUN]->removeProjectConfiguration(rc); +} + +void MiniProjectTargetSelector::slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration *rc) +{ + if (rc->target() == m_target) + m_listWidgets[RUN]->removeProjectConfiguration(rc); updateRunListVisible(); } diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.h b/src/plugins/projectexplorer/miniprojecttargetselector.h index c2dbca46d2..c7cda42574 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.h +++ b/src/plugins/projectexplorer/miniprojecttargetselector.h @@ -62,6 +62,7 @@ public: void keyPressEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event); void setMaxCount(int maxCount); + private: int m_maxCount; }; @@ -122,14 +123,14 @@ public slots: private slots: void projectAdded(ProjectExplorer::Project *project); void projectRemoved(ProjectExplorer::Project *project); - void addedTarget(ProjectExplorer::Target *target); - void removedTarget(ProjectExplorer::Target *target); - void addedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc); - void removedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc); - void addedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); - void removedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); - void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc); - void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc); + void slotAddedTarget(ProjectExplorer::Target *target); + void slotRemovedTarget(ProjectExplorer::Target *target); + void slotAddedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); + void slotRemovedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); + void slotAddedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); + void slotRemovedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); + void slotAddedRunConfiguration(ProjectExplorer::RunConfiguration *rc); + void slotRemovedRunConfiguration(ProjectExplorer::RunConfiguration *rc); void changeStartupProject(ProjectExplorer::Project *project); void activeTargetChanged(ProjectExplorer::Target *target); @@ -147,6 +148,15 @@ private slots: void updateActionAndSummary(); void switchToProjectsMode(); private: + void addedTarget(ProjectExplorer::Target *target); + void removedTarget(ProjectExplorer::Target *target); + void addedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc); + void removedBuildConfiguration(ProjectExplorer::BuildConfiguration* bc); + void addedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); + void removedDeployConfiguration(ProjectExplorer::DeployConfiguration *dc); + void addedRunConfiguration(ProjectExplorer::RunConfiguration *rc); + void removedRunConfiguration(ProjectExplorer::RunConfiguration *rc); + void updateProjectListVisible(); void updateTargetListVisible(); void updateBuildListVisible(); diff --git a/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp b/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp index 5fe8c0d46c..abf9dfb35d 100644 --- a/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp @@ -76,15 +76,12 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare iconLayout->addWidget(m_iconButton); iconLayout->addStretch(); - QHBoxLayout *spacer = new QHBoxLayout; - spacer->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding)); - QGridLayout *masterLayout = new QGridLayout(widget); masterLayout->setMargin(0); masterLayout->setContentsMargins(6, 0, 6, 0); masterLayout->addLayout(iconLayout, 0, 0); masterLayout->addLayout(m_layout, 0, 1); - masterLayout->addLayout(spacer, 1, 0); + masterLayout->setRowStretch(1, 1); discard(); diff --git a/src/plugins/projectexplorer/profileoptionspage.cpp b/src/plugins/projectexplorer/profileoptionspage.cpp index 2742bd9db5..6feffdfb55 100644 --- a/src/plugins/projectexplorer/profileoptionspage.cpp +++ b/src/plugins/projectexplorer/profileoptionspage.cpp @@ -80,6 +80,7 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent) m_makeDefaultButton = new QPushButton(tr("Make Default"), m_configWidget); QVBoxLayout *buttonLayout = new QVBoxLayout(); + buttonLayout->setSpacing(6); buttonLayout->setContentsMargins(0, 0, 0, 0); buttonLayout->addWidget(m_addButton); buttonLayout->addWidget(m_cloneButton); diff --git a/src/plugins/qnx/blackberryrunconfiguration.cpp b/src/plugins/qnx/blackberryrunconfiguration.cpp index 45cc0fbb39..7393525f3b 100644 --- a/src/plugins/qnx/blackberryrunconfiguration.cpp +++ b/src/plugins/qnx/blackberryrunconfiguration.cpp @@ -64,6 +64,9 @@ BlackBerryRunConfiguration::BlackBerryRunConfiguration(ProjectExplorer::Target * void BlackBerryRunConfiguration::init() { updateDisplayName(); + + connect(deployConfiguration()->deploymentInfo(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(targetInformationChanged())); + connect(deployConfiguration()->deploymentInfo(), SIGNAL(modelReset()), this, SIGNAL(targetInformationChanged())); } void BlackBerryRunConfiguration::updateDisplayName() diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index 5c187f0c2b..ff26061205 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -65,7 +65,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : m_ignoreUpdates(false), m_firstWidget(0), m_ui(new Internal::Ui::TargetSetupPage), - m_importWidget(new Internal::ImportWidget), + m_importWidget(new Internal::ImportWidget(this)), m_spacer(new QSpacerItem(0,0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)) { setObjectName(QLatin1String("TargetSetupPage")); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 966f02bc66..cfcc57e919 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -757,10 +757,7 @@ void BaseQtVersion::ensureMkSpecParsed() const ProFileCacheManager::instance()->incRefCount(); QMakeParser parser(ProFileCacheManager::instance()->cache(), &msgHandler); ProFileEvaluator evaluator(&option, &parser, &msgHandler); - if (ProFile *pro = parser.parsedProFile(mkspecPath().toString() + QLatin1String("/qmake.conf"))) { - evaluator.accept(pro, QMakeEvaluator::LoadProOnly); - pro->deref(); - } + evaluator.loadNamedSpec(mkspecPath().toString(), false); parseMkSpec(&evaluator); diff --git a/src/plugins/qtsupport/qtversionfactory.cpp b/src/plugins/qtsupport/qtversionfactory.cpp index 8335c0e7d0..05cd57e87a 100644 --- a/src/plugins/qtsupport/qtversionfactory.cpp +++ b/src/plugins/qtsupport/qtversionfactory.cpp @@ -69,10 +69,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileN ProFileCacheManager::instance()->incRefCount(); QMakeParser parser(ProFileCacheManager::instance()->cache(), &msgHandler); ProFileEvaluator evaluator(&globals, &parser, &msgHandler); - if (ProFile *pro = parser.parsedProFile(mkspec.toString() + QLatin1String("/qmake.conf"))) { - evaluator.accept(pro, QMakeEvaluator::LoadProOnly); - pro->deref(); - } + evaluator.loadNamedSpec(mkspec.toString(), false); QList<QtVersionFactory *> factories = ExtensionSystem::PluginManager::getObjects<QtVersionFactory>(); qSort(factories.begin(), factories.end(), &sortByPriority); diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp index 7877db87ef..c03b58f95e 100644 --- a/src/plugins/texteditor/colorschemeedit.cpp +++ b/src/plugins/texteditor/colorschemeedit.cpp @@ -115,6 +115,9 @@ public: font.setItalic(m_scheme->formatFor(description.id()).italic()); return font; } + case Qt::ToolTipRole: { + return description.tooltipText(); + } } return QVariant(); } diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 2f7da13819..d3ae74d931 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -228,17 +228,19 @@ FontSettingsPagePrivate::~FontSettingsPagePrivate() // ------- FormatDescription -FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QColor &color) : +FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const QColor &foreground) : m_id(id), - m_displayName(displayName) + m_displayName(displayName), + m_tooltipText(tooltipText) { - m_format.setForeground(color); + m_format.setForeground(foreground); } -FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const Format &format) : +FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const Format &format) : m_id(id), m_displayName(displayName), - m_format(format) + m_format(format), + m_tooltipText(tooltipText) { } diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index 915d73d0d3..d6c3de92ed 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -56,9 +56,9 @@ class FontSettingsPagePrivate; class TEXTEDITOR_EXPORT FormatDescription { public: - FormatDescription(TextStyle id, const QString &displayName, + FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const QColor &foreground = Qt::black); - FormatDescription(TextStyle id, const QString &displayName, + FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const Format &format); TextStyle id() const { return m_id; } @@ -72,10 +72,14 @@ public: const Format &format() const { return m_format; } Format &format() { return m_format; } + QString tooltipText() const + { return m_tooltipText; } + private: TextStyle m_id; // Name of the category QString m_displayName; // Displayed name of the category Format m_format; // Default format + QString m_tooltipText; // Description text for category }; typedef QList<FormatDescription> FormatDescriptions; diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index 0cb6300e6c..22ed20b8f1 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -57,7 +57,9 @@ const char *nameForStyle(TextStyle style) case C_TYPE: return "Type"; case C_LOCAL: return "Local"; case C_FIELD: return "Field"; - case C_STATIC: return "Static"; + // TODO: Rename "Static" to "Enumeration" in next major update, + // because renaming here would break styles defined by the user. + case C_ENUMERATION: return "Static"; case C_VIRTUAL_METHOD: return "VirtualMethod"; case C_FUNCTION: return "Function"; case C_KEYWORD: return "Keyword"; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index e11e0a442d..c5956be707 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -56,7 +56,7 @@ enum TextStyle { C_TYPE, C_LOCAL, C_FIELD, - C_STATIC, + C_ENUMERATION, C_VIRTUAL_METHOD, C_FUNCTION, C_KEYWORD, diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 5114e6e06f..02afdf4906 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -112,84 +112,151 @@ TextEditorSettings::TextEditorSettings(QObject *parent) // Note: default background colors are coming from FormatDescription::background() // Add font preference page - FormatDescriptions formatDescriptions; - formatDescriptions.append(FormatDescription(C_TEXT, tr("Text"))); + FormatDescriptions formatDescr; + formatDescr.append(FormatDescription(C_TEXT, tr("Text"), tr("Generic text.\nApplied for " + "text, if no other " + "rules matching."))); // Special categories const QPalette p = QApplication::palette(); - formatDescriptions.append(FormatDescription(C_LINK, tr("Link"), Qt::blue)); - formatDescriptions.append(FormatDescription(C_SELECTION, tr("Selection"), p.color(QPalette::HighlightedText))); - formatDescriptions.append(FormatDescription(C_LINE_NUMBER, tr("Line Number"))); - formatDescriptions.append(FormatDescription(C_SEARCH_RESULT, tr("Search Result"))); - formatDescriptions.append(FormatDescription(C_SEARCH_SCOPE, tr("Search Scope"))); - formatDescriptions.append(FormatDescription(C_PARENTHESES, tr("Parentheses"))); - formatDescriptions.append(FormatDescription(C_CURRENT_LINE, tr("Current Line"))); - - FormatDescription currentLineNumber = FormatDescription(C_CURRENT_LINE_NUMBER, tr("Current Line Number"), Qt::darkGray); + formatDescr.append(FormatDescription(C_LINK, tr("Link"), + tr("Links that follow symbol under cursor."), Qt::blue)); + formatDescr.append(FormatDescription(C_SELECTION, tr("Selection"), tr("Selected text."), + p.color(QPalette::HighlightedText))); + formatDescr.append(FormatDescription(C_LINE_NUMBER, tr("Line Number"), + tr("Line numbers located on the " + "left side of the editor."))); + formatDescr.append(FormatDescription(C_SEARCH_RESULT, tr("Search Result"), + tr("Highlighted search results inside the editor."))); + formatDescr.append(FormatDescription(C_SEARCH_SCOPE, tr("Search Scope"), + tr("Section where the pattern is searched in."))); + formatDescr.append(FormatDescription(C_PARENTHESES, tr("Parentheses"), + tr("Displayed when matching parantheses, square brackets " + "or curly brackets are found."))); + formatDescr.append(FormatDescription(C_CURRENT_LINE, tr("Current Line"), + tr("Line where the cursor is placed in."))); + + FormatDescription currentLineNumber = + FormatDescription(C_CURRENT_LINE_NUMBER, tr("Current Line Number"), + tr("Line number located on the left side of the " + "editor where the cursor is placed in."), Qt::darkGray); currentLineNumber.format().setBold(true); - formatDescriptions.append(currentLineNumber); + formatDescr.append(currentLineNumber); - formatDescriptions.append(FormatDescription(C_OCCURRENCES, tr("Occurrences"))); - formatDescriptions.append(FormatDescription(C_OCCURRENCES_UNUSED, tr("Unused Occurrence"))); - formatDescriptions.append(FormatDescription(C_OCCURRENCES_RENAME, tr("Renaming Occurrence"))); + + formatDescr.append(FormatDescription(C_OCCURRENCES, tr("Occurrences"), + tr("Occurences of the symbol under the cursor.\n" + "(Only the backgroud will be applied.)"))); + formatDescr.append(FormatDescription(C_OCCURRENCES_UNUSED, tr("Unused Occurrence"), + tr("Occurences of unused variables."))); + formatDescr.append(FormatDescription(C_OCCURRENCES_RENAME, tr("Renaming Occurrence"), + tr("Occurences of a symbol that will be renamed."))); // Standard categories - formatDescriptions.append(FormatDescription(C_NUMBER, tr("Number"), Qt::darkBlue)); - formatDescriptions.append(FormatDescription(C_STRING, tr("String"), Qt::darkGreen)); - formatDescriptions.append(FormatDescription(C_TYPE, tr("Type"), Qt::darkMagenta)); - formatDescriptions.append(FormatDescription(C_LOCAL, tr("Local"))); - formatDescriptions.append(FormatDescription(C_FIELD, tr("Field"), Qt::darkRed)); - formatDescriptions.append(FormatDescription(C_STATIC, tr("Static"), Qt::darkMagenta)); + formatDescr.append(FormatDescription(C_NUMBER, tr("Number"), tr("Number literal."), + Qt::darkBlue)); + formatDescr.append(FormatDescription(C_STRING, tr("String"), + tr("Character and string literals."), Qt::darkGreen)); + formatDescr.append(FormatDescription(C_TYPE, tr("Type"), tr("Name of a type."), + Qt::darkMagenta)); + formatDescr.append(FormatDescription(C_LOCAL, tr("Local"), tr("Local variables."))); + formatDescr.append(FormatDescription(C_FIELD, tr("Field"), + tr("Class' data members."), Qt::darkRed)); + formatDescr.append(FormatDescription(C_ENUMERATION, tr("Enumeration"), + tr("Applied for Enumeration Items."), Qt::darkMagenta)); Format functionFormat; - formatDescriptions.append(FormatDescription(C_FUNCTION, tr("Function"), functionFormat)); + formatDescr.append(FormatDescription(C_FUNCTION, tr("Function"), tr("Name of a function."), + functionFormat)); functionFormat.setItalic(true); - formatDescriptions.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Method"), functionFormat)); + formatDescr.append(FormatDescription(C_VIRTUAL_METHOD, tr("Virtual Method"), + tr("Name of method declared as virtual."), + functionFormat)); - formatDescriptions.append(FormatDescription(C_BINDING, tr("QML Binding"), Qt::darkRed)); + formatDescr.append(FormatDescription(C_BINDING, tr("QML Binding"), + tr("QML item property, that allows a " + "binding to another property."), + Qt::darkRed)); Format qmlLocalNameFormat; qmlLocalNameFormat.setItalic(true); - formatDescriptions.append(FormatDescription(C_QML_LOCAL_ID, tr("QML Local Id"), qmlLocalNameFormat)); - formatDescriptions.append(FormatDescription(C_QML_ROOT_OBJECT_PROPERTY, tr("QML Root Object Property"), qmlLocalNameFormat)); - formatDescriptions.append(FormatDescription(C_QML_SCOPE_OBJECT_PROPERTY, tr("QML Scope Object Property"), qmlLocalNameFormat)); - formatDescriptions.append(FormatDescription(C_QML_STATE_NAME, tr("QML State Name"), qmlLocalNameFormat)); - - formatDescriptions.append(FormatDescription(C_QML_TYPE_ID, tr("QML Type Name"), Qt::darkMagenta)); + formatDescr.append(FormatDescription(C_QML_LOCAL_ID, tr("QML Local Id"), + tr("QML item id within a QML file."), qmlLocalNameFormat)); + formatDescr.append(FormatDescription(C_QML_ROOT_OBJECT_PROPERTY, + tr("QML root Object Property"), + tr("QML property of a parent item."), qmlLocalNameFormat)); + formatDescr.append(FormatDescription(C_QML_SCOPE_OBJECT_PROPERTY, + tr("QML scope Object Property"), + tr("Property of the same QML item."), qmlLocalNameFormat)); + formatDescr.append(FormatDescription(C_QML_STATE_NAME, tr("QML State Name"), + tr("Name of a QML state."), qmlLocalNameFormat)); + + formatDescr.append(FormatDescription(C_QML_TYPE_ID, tr("QML Type Name"), + tr("Name of a QML type."), Qt::darkMagenta)); Format qmlExternalNameFormat = qmlLocalNameFormat; qmlExternalNameFormat.setForeground(Qt::darkBlue); - formatDescriptions.append(FormatDescription(C_QML_EXTERNAL_ID, tr("QML External Id"), qmlExternalNameFormat)); - formatDescriptions.append(FormatDescription(C_QML_EXTERNAL_OBJECT_PROPERTY, tr("QML External Object Property"), qmlExternalNameFormat)); + formatDescr.append(FormatDescription(C_QML_EXTERNAL_ID, tr("QML External Id"), + tr("QML id defined in another QML file."), + qmlExternalNameFormat)); + formatDescr.append(FormatDescription(C_QML_EXTERNAL_OBJECT_PROPERTY, + tr("QML External Object Property"), + tr("QML property defined in another QML file."), + qmlExternalNameFormat)); Format jsLocalFormat; jsLocalFormat.setForeground(QColor(41, 133, 199)); // very light blue jsLocalFormat.setItalic(true); - formatDescriptions.append(FormatDescription(C_JS_SCOPE_VAR, tr("JavaScript Scope Var"), jsLocalFormat)); + formatDescr.append(FormatDescription(C_JS_SCOPE_VAR, tr("JavaScript Scope Var"), + tr("Variables defined inside the JavaScript file."), + jsLocalFormat)); Format jsGlobalFormat; jsGlobalFormat.setForeground(QColor(0, 85, 175)); // light blue jsGlobalFormat.setItalic(true); - formatDescriptions.append(FormatDescription(C_JS_IMPORT_VAR, tr("JavaScript Import"), jsGlobalFormat)); - formatDescriptions.append(FormatDescription(C_JS_GLOBAL_VAR, tr("JavaScript Global Variable"), jsGlobalFormat)); - - formatDescriptions.append(FormatDescription(C_KEYWORD, tr("Keyword"), Qt::darkYellow)); - formatDescriptions.append(FormatDescription(C_OPERATOR, tr("Operator"))); - formatDescriptions.append(FormatDescription(C_PREPROCESSOR, tr("Preprocessor"), Qt::darkBlue)); - formatDescriptions.append(FormatDescription(C_LABEL, tr("Label"), Qt::darkRed)); - formatDescriptions.append(FormatDescription(C_COMMENT, tr("Comment"), Qt::darkGreen)); - formatDescriptions.append(FormatDescription(C_DOXYGEN_COMMENT, tr("Doxygen Comment"), Qt::darkBlue)); - formatDescriptions.append(FormatDescription(C_DOXYGEN_TAG, tr("Doxygen Tag"), Qt::blue)); - formatDescriptions.append(FormatDescription(C_VISUAL_WHITESPACE, tr("Visual Whitespace"), Qt::lightGray)); - formatDescriptions.append(FormatDescription(C_DISABLED_CODE, tr("Disabled Code"))); + formatDescr.append(FormatDescription(C_JS_IMPORT_VAR, tr("JavaScript Import"), + tr("Name of a JavaScript import inside a QML file."), + jsGlobalFormat)); + formatDescr.append(FormatDescription(C_JS_GLOBAL_VAR, tr("JavaScript Global Variable"), + tr("Variables defined outside the script."), + jsGlobalFormat)); + + formatDescr.append(FormatDescription(C_KEYWORD, tr("Keyword"), + tr("Reserved keywords of the programming language."), + Qt::darkYellow)); + formatDescr.append(FormatDescription(C_OPERATOR, tr("Operator"), + tr("Operators. (for example operator++ operator-=)"))); + formatDescr.append(FormatDescription(C_PREPROCESSOR, tr("Preprocessor"), + tr("Preprocessor directives."), Qt::darkBlue)); + formatDescr.append(FormatDescription(C_LABEL, tr("Label"), tr("Labels for goto steatments."), + Qt::darkRed)); + formatDescr.append(FormatDescription(C_COMMENT, tr("Comment"), + tr("All style of comments except Doxygen comments."), + Qt::darkGreen)); + formatDescr.append(FormatDescription(C_DOXYGEN_COMMENT, tr("Doxygen Comment"), + tr("Doxygen comments."), Qt::darkBlue)); + formatDescr.append(FormatDescription(C_DOXYGEN_TAG, tr("Doxygen Tag"), tr("Doxygen tags"), + Qt::blue)); + formatDescr.append(FormatDescription(C_VISUAL_WHITESPACE, tr("Visual Whitespace"), + tr("Whitespace\nWill not be applied for whitespace " + "in comments and strings."), Qt::lightGray)); + formatDescr.append(FormatDescription(C_DISABLED_CODE, tr("Disabled Code"), + tr("Code disabled by preprocessor directives."))); // Diff categories - formatDescriptions.append(FormatDescription(C_ADDED_LINE, tr("Added Line"), QColor(0, 170, 0))); - formatDescriptions.append(FormatDescription(C_REMOVED_LINE, tr("Removed Line"), Qt::red)); - formatDescriptions.append(FormatDescription(C_DIFF_FILE, tr("Diff File"), Qt::darkBlue)); - formatDescriptions.append(FormatDescription(C_DIFF_LOCATION, tr("Diff Location"), Qt::blue)); - - m_d->m_fontSettingsPage = new FontSettingsPage(formatDescriptions, + formatDescr.append(FormatDescription(C_ADDED_LINE, tr("Added Line"), + tr("Applied for added lines in differences " + "(in diff editor)."), QColor(0, 170, 0))); + formatDescr.append(FormatDescription(C_REMOVED_LINE, tr("Removed Line"), + tr("Applied for removed lines " + "in differences (in diff editor)."), Qt::red)); + formatDescr.append(FormatDescription(C_DIFF_FILE, tr("Diff File"), + tr("Compared files (in diff editor)."), Qt::darkBlue)); + formatDescr.append(FormatDescription(C_DIFF_LOCATION, tr("Diff Location"), + tr("Location in the files where the difference is " + "(in diff editor)."), Qt::blue)); + + m_d->m_fontSettingsPage = new FontSettingsPage(formatDescr, QLatin1String(Constants::TEXT_EDITOR_FONT_SETTINGS), this); ExtensionSystem::PluginManager::addObject(m_d->m_fontSettingsPage); |