forked from qt-creator/qt-creator
Merge branch '1.2' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -427,7 +427,7 @@
|
|||||||
\contentspage {Address Book Tutorial}{Contents}
|
\contentspage {Address Book Tutorial}{Contents}
|
||||||
\nextpage {examples/addressbook-sdk/part4}{Chapter 4}
|
\nextpage {examples/addressbook-sdk/part4}{Chapter 4}
|
||||||
\example examples/addressbook-sdk/part3
|
\example examples/addressbook-sdk/part3
|
||||||
\title Address Book 3 - Navigating between Entries}
|
\title Address Book 3 - Navigating between Entries
|
||||||
|
|
||||||
The address book application is now half complete. We need to add some
|
The address book application is now half complete. We need to add some
|
||||||
functions to navigate between contacts. But first, we have to decide what
|
functions to navigate between contacts. But first, we have to decide what
|
||||||
@@ -549,7 +549,7 @@
|
|||||||
\contentspage {Address Book Tutorial}{Contents}
|
\contentspage {Address Book Tutorial}{Contents}
|
||||||
\nextpage {examples/addressbook-sdk/part5}{Chapter 5}
|
\nextpage {examples/addressbook-sdk/part5}{Chapter 5}
|
||||||
\example examples/addressbook-sdk/part4
|
\example examples/addressbook-sdk/part4
|
||||||
\title Address Book 4 - Editing and Removing Addresses}
|
\title Address Book 4 - Editing and Removing Addresses
|
||||||
|
|
||||||
In this chapter, we look at ways to modify the contents of contacts stored
|
In this chapter, we look at ways to modify the contents of contacts stored
|
||||||
in the address book application.
|
in the address book application.
|
||||||
@@ -710,7 +710,7 @@
|
|||||||
\contentspage {Address Book Tutorial}{Contents}
|
\contentspage {Address Book Tutorial}{Contents}
|
||||||
\nextpage {examples/addressbook-sdk/part6}{Chapter 6}
|
\nextpage {examples/addressbook-sdk/part6}{Chapter 6}
|
||||||
\example examples/addressbook-sdk/part5
|
\example examples/addressbook-sdk/part5
|
||||||
\title Address Book 5 - Adding a Find Function}
|
\title Address Book 5 - Adding a Find Function
|
||||||
|
|
||||||
In this chapter, we look at ways to locate contacts and addresses in the
|
In this chapter, we look at ways to locate contacts and addresses in the
|
||||||
address book application.
|
address book application.
|
||||||
@@ -751,7 +751,7 @@
|
|||||||
\contentspage {Address Book Tutorial}{Contents}
|
\contentspage {Address Book Tutorial}{Contents}
|
||||||
\nextpage {examples/addressbook-sdk/part7}{Chapter 7}
|
\nextpage {examples/addressbook-sdk/part7}{Chapter 7}
|
||||||
\example examples/addressbook-sdk/part6
|
\example examples/addressbook-sdk/part6
|
||||||
\title Address Book 6 - Loading and Saving}
|
\title Address Book 6 - Loading and Saving
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -760,6 +760,6 @@
|
|||||||
\previouspage Address Book 6 - Loading and Saving
|
\previouspage Address Book 6 - Loading and Saving
|
||||||
\contentspage {Address Book Tutorial}{Contents}
|
\contentspage {Address Book Tutorial}{Contents}
|
||||||
\example examples/addressbook-sdk/part7
|
\example examples/addressbook-sdk/part7
|
||||||
\title Address Book 7 - Additional Features}
|
\title Address Book 7 - Additional Features
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
22
doc/examples/addressbook-sdk/part5/finddialog.cpp
Normal file
22
doc/examples/addressbook-sdk/part5/finddialog.cpp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#include "finddialog.h"
|
||||||
|
#include "ui_finddialog.h"
|
||||||
|
|
||||||
|
FindDialog::FindDialog(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
m_ui(new Ui::FindDialog)
|
||||||
|
{
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
FindDialog::~FindDialog()
|
||||||
|
{
|
||||||
|
delete m_ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FindDialog::findClicked()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QString FindDialog::getFindText()
|
||||||
|
{
|
||||||
|
}
|
||||||
29
doc/examples/addressbook-sdk/part5/finddialog.h
Normal file
29
doc/examples/addressbook-sdk/part5/finddialog.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef FINDDIALOG_H
|
||||||
|
#define FINDDIALOG_H
|
||||||
|
|
||||||
|
#include <QtGui/QDialog>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class FindDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class FindDialog : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
FindDialog(QWidget *parent = 0);
|
||||||
|
~FindDialog();
|
||||||
|
QString getFindText();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void findClicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::FindDialog *m_ui;
|
||||||
|
QPushButton *findButton;
|
||||||
|
QLineEdit *lineEdit;
|
||||||
|
QString findText;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FINDDIALOG_H
|
||||||
@@ -1,18 +1,59 @@
|
|||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
<class>FindDialog</class>
|
<class>FindDialog</class>
|
||||||
<widget class="QDialog" name="FindDialog" >
|
<widget class="QDialog" name="FindDialog">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>486</width>
|
||||||
<height>300</height>
|
<height>65</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enter the name of a contact:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="findButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Find</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>findButton</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>FindDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>415</x>
|
||||||
|
<y>42</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>385</x>
|
||||||
|
<y>50</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -1536,8 +1536,9 @@
|
|||||||
\bold{Display Low Level Data}
|
\bold{Display Low Level Data}
|
||||||
|
|
||||||
If special debugging of Qt objects fails due to data corruption within the
|
If special debugging of Qt objects fails due to data corruption within the
|
||||||
debugged objects, you can switch the special debugging off in the
|
debugged objects, you can switch the debugging helpers off in the
|
||||||
\gui{Debug} menu. This will make the low-level structures visible again.
|
\gui{Debugger -> Debugging Helper} options dialog.
|
||||||
|
This will make the low-level structures visible again.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -1640,7 +1641,7 @@
|
|||||||
\row
|
\row
|
||||||
\o
|
\o
|
||||||
\raw HTML
|
\raw HTML
|
||||||
System Qt
|
Auto-detected Qt
|
||||||
\endraw
|
\endraw
|
||||||
\target glossary-system-qt
|
\target glossary-system-qt
|
||||||
\o The version of Qt installed on your system. This is the Qt
|
\o The version of Qt installed on your system. This is the Qt
|
||||||
@@ -1654,7 +1655,7 @@
|
|||||||
\target glossary-default-qt
|
\target glossary-default-qt
|
||||||
\o The version of Qt configured in \gui{Tools -> Options -> Qt 4
|
\o The version of Qt configured in \gui{Tools -> Options -> Qt 4
|
||||||
-> Default Qt Version}. This is the Qt version used by your
|
-> Default Qt Version}. This is the Qt version used by your
|
||||||
new projects. It defaults to System Qt.
|
new projects. It defaults to the Auto-detected Qt.
|
||||||
|
|
||||||
\row
|
\row
|
||||||
\o
|
\o
|
||||||
|
|||||||
@@ -1359,7 +1359,7 @@ Sollen sie überschrieben werden?</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+11"/>
|
<location line="+11"/>
|
||||||
<source>&Tools</source>
|
<source>&Tools</source>
|
||||||
<translation>&Werkzeuge</translation>
|
<translation>E&xtras</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+5"/>
|
<location line="+5"/>
|
||||||
@@ -10283,7 +10283,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<font color="#ff0000"><b>No valid Qt version set. Set one in Tools/Options </b></font>
|
<font color="#ff0000"><b>No valid Qt version set. Set one in Tools/Options </b></font>
|
||||||
</source>
|
</source>
|
||||||
<translation>
|
<translation>
|
||||||
<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Werkzeuge/Einstellungen</b></font>
|
<font color="#ff0000"><b>Es ist keine gültige Qt-Version gesetzt. Setzen Sie sie unter Extras/Einstellungen</b></font>
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@@ -11709,7 +11709,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich
|
|||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
<source>Never</source>
|
<source>Never</source>
|
||||||
<translation>NiemalsZahl</translation>
|
<translation>Niemals</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
|
|||||||
@@ -217,11 +217,13 @@ int main(int argc, char **argv)
|
|||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
QTranslator qtTranslator;
|
QTranslator qtTranslator;
|
||||||
const QString &locale = QLocale::system().name();
|
const QString &locale = QLocale::system().name();
|
||||||
if (translator.load(QLatin1String("qtcreator_") + locale,
|
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
|
||||||
QCoreApplication::applicationDirPath()
|
+ QLatin1String(SHARE_PATH "/translations");
|
||||||
+ QLatin1String(SHARE_PATH "/translations"))) {
|
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
|
||||||
if (qtTranslator.load(QLatin1String("qt_") + locale,
|
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
const QString &qtTrFile = QLatin1String("qt_") + locale;
|
||||||
|
// Binary installer puts Qt tr files into creatorTrPath
|
||||||
|
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
app.installTranslator(&qtTranslator);
|
app.installTranslator(&qtTranslator);
|
||||||
app.setProperty("qtc_locale", locale);
|
app.setProperty("qtc_locale", locale);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
|||||||
|
|
||||||
setStartId(startid);
|
setStartId(startid);
|
||||||
setOption(QWizard::NoCancelButton);
|
setOption(QWizard::NoCancelButton);
|
||||||
setOption(QWizard::NoBackButtonOnStartPage);
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
||||||
@@ -93,7 +93,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
|||||||
else
|
else
|
||||||
addPage(new CMakeRunPage(this, CMakeRunPage::Update, buildDirectory));
|
addPage(new CMakeRunPage(this, CMakeRunPage::Update, buildDirectory));
|
||||||
setOption(QWizard::NoCancelButton);
|
setOption(QWizard::NoCancelButton);
|
||||||
setOption(QWizard::NoBackButtonOnStartPage);
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const QString &sourceDirectory,
|
||||||
@@ -107,7 +107,13 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, const
|
|||||||
m_buildDirectory = oldBuildDirectory;
|
m_buildDirectory = oldBuildDirectory;
|
||||||
addPage(new ShadowBuildPage(this, true));
|
addPage(new ShadowBuildPage(this, true));
|
||||||
addPage(new CMakeRunPage(this, CMakeRunPage::Change));
|
addPage(new CMakeRunPage(this, CMakeRunPage::Change));
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMakeOpenProjectWizard::init()
|
||||||
|
{
|
||||||
setOption(QWizard::NoBackButtonOnStartPage);
|
setOption(QWizard::NoBackButtonOnStartPage);
|
||||||
|
setWindowTitle(tr("CMake Wizard"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CMakeManager *CMakeOpenProjectWizard::cmakeManager() const
|
CMakeManager *CMakeOpenProjectWizard::cmakeManager() const
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public:
|
|||||||
void setArguments(const QStringList &args);
|
void setArguments(const QStringList &args);
|
||||||
ProjectExplorer::Environment environment() const;
|
ProjectExplorer::Environment environment() const;
|
||||||
private:
|
private:
|
||||||
|
void init();
|
||||||
bool existsUpToDateXmlFile() const;
|
bool existsUpToDateXmlFile() const;
|
||||||
bool hasInSourceBuild() const;
|
bool hasInSourceBuild() const;
|
||||||
CMakeManager *m_cmakeManager;
|
CMakeManager *m_cmakeManager;
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ int EditorModel::findEditor(IEditor *editor) const
|
|||||||
|
|
||||||
int EditorModel::findFileName(const QString &filename) const
|
int EditorModel::findFileName(const QString &filename) const
|
||||||
{
|
{
|
||||||
|
if (filename.isEmpty())
|
||||||
|
return -1;
|
||||||
for (int i = 0; i < m_editors.count(); ++i) {
|
for (int i = 0; i < m_editors.count(); ++i) {
|
||||||
if (m_editors.at(i).fileName() == filename)
|
if (m_editors.at(i).fileName() == filename)
|
||||||
return i;
|
return i;
|
||||||
@@ -300,21 +302,10 @@ QVariant EditorModel::data(const QModelIndex &index, int role) const
|
|||||||
|
|
||||||
QModelIndex EditorModel::indexOf(IEditor *editor) const
|
QModelIndex EditorModel::indexOf(IEditor *editor) const
|
||||||
{
|
{
|
||||||
int idx = findEditor(editor);
|
int idx = findEditor(originalForDuplicate(editor));
|
||||||
if (idx < 0)
|
|
||||||
return indexOf(editor->file()->fileName());
|
|
||||||
return createIndex(idx, 0);
|
return createIndex(idx, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex EditorModel::indexOf(const QString &fileName) const
|
|
||||||
{
|
|
||||||
int idx = findFileName(fileName);
|
|
||||||
if (idx >= 0)
|
|
||||||
return createIndex(idx, 0);
|
|
||||||
return QModelIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void EditorModel::itemChanged()
|
void EditorModel::itemChanged()
|
||||||
{
|
{
|
||||||
emitDataChanged(qobject_cast<IEditor*>(sender()));
|
emitDataChanged(qobject_cast<IEditor*>(sender()));
|
||||||
@@ -588,7 +579,7 @@ void EditorView::setCurrentEditor(IEditor *editor)
|
|||||||
const int idx = m_container->indexOf(editor->widget());
|
const int idx = m_container->indexOf(editor->widget());
|
||||||
QTC_ASSERT(idx >= 0, return);
|
QTC_ASSERT(idx >= 0, return);
|
||||||
m_container->setCurrentIndex(idx);
|
m_container->setCurrentIndex(idx);
|
||||||
m_editorList->setCurrentIndex(m_model->indexOf(editor->file()->fileName()).row());
|
m_editorList->setCurrentIndex(m_model->indexOf(editor).row());
|
||||||
updateEditorStatus(editor);
|
updateEditorStatus(editor);
|
||||||
updateToolBar(editor);
|
updateToolBar(editor);
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,6 @@ public:
|
|||||||
IEditor *originalForDuplicate(IEditor *duplicate) const;
|
IEditor *originalForDuplicate(IEditor *duplicate) const;
|
||||||
void makeOriginal(IEditor *duplicate);
|
void makeOriginal(IEditor *duplicate);
|
||||||
QModelIndex indexOf(IEditor *editor) const;
|
QModelIndex indexOf(IEditor *editor) const;
|
||||||
QModelIndex indexOf(const QString &filename) const;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void itemChanged();
|
void itemChanged();
|
||||||
|
|
||||||
|
|||||||
@@ -427,6 +427,9 @@ QStringList WelcomeMode::tipsOfTheDay()
|
|||||||
tips.append(tr("If you add <a href=\"qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html\""
|
tips.append(tr("If you add <a href=\"qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html\""
|
||||||
">external libraries</a>, Qt Creator will automatically offer syntax highlighting "
|
">external libraries</a>, Qt Creator will automatically offer syntax highlighting "
|
||||||
"and code completion."));
|
"and code completion."));
|
||||||
|
tips.append(tr("The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> "
|
||||||
|
"you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>."));
|
||||||
|
tips.append(tr("You can force code completion at any time using <tt>Ctrl+Space</tt>."));
|
||||||
}
|
}
|
||||||
return tips;
|
return tips;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -976,7 +976,7 @@ QToolButton:pressed {
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>360</width>
|
<width>340</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -1264,17 +1264,12 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
|
|||||||
if (c.isUpper() && !first) {
|
if (c.isUpper() && !first) {
|
||||||
keyRegExp += QLatin1String("[a-z0-9_]*");
|
keyRegExp += QLatin1String("[a-z0-9_]*");
|
||||||
keyRegExp += c;
|
keyRegExp += c;
|
||||||
} else if (m_caseSensitivity == Qt::CaseInsensitive && c.isLower()) {
|
|
||||||
keyRegExp += QLatin1Char('[');
|
|
||||||
keyRegExp += c;
|
|
||||||
keyRegExp += c.toUpper();
|
|
||||||
keyRegExp += QLatin1Char(']');
|
|
||||||
} else {
|
} else {
|
||||||
keyRegExp += QRegExp::escape(c);
|
keyRegExp += QRegExp::escape(c);
|
||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
const QRegExp regExp(keyRegExp, Qt::CaseSensitive);
|
const QRegExp regExp(keyRegExp, m_caseSensitivity);
|
||||||
|
|
||||||
foreach (TextEditor::CompletionItem item, m_completions) {
|
foreach (TextEditor::CompletionItem item, m_completions) {
|
||||||
if (regExp.indexIn(item.m_text) == 0) {
|
if (regExp.indexIn(item.m_text) == 0) {
|
||||||
|
|||||||
@@ -928,8 +928,8 @@ void GdbEngine::handleAqcuiredInferior()
|
|||||||
reloadSourceFiles();
|
reloadSourceFiles();
|
||||||
|
|
||||||
// Reverse debugging. FIXME: Should only be used when available.
|
// Reverse debugging. FIXME: Should only be used when available.
|
||||||
if (theDebuggerBoolSetting(EnableReverseDebugging))
|
//if (theDebuggerBoolSetting(EnableReverseDebugging))
|
||||||
postCommand(_("target record"));
|
// postCommand(_("target record"));
|
||||||
|
|
||||||
tryLoadDebuggingHelpers();
|
tryLoadDebuggingHelpers();
|
||||||
|
|
||||||
|
|||||||
@@ -121,8 +121,11 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
QString locale = qApp->property("qtc_locale").toString();
|
QString locale = qApp->property("qtc_locale").toString();
|
||||||
if (!locale.isEmpty()) {
|
if (!locale.isEmpty()) {
|
||||||
QTranslator *qtr = new QTranslator(this);
|
QTranslator *qtr = new QTranslator(this);
|
||||||
qtr->load(QLatin1String("designer_") + locale,
|
const QString &creatorTrPath =
|
||||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
|
||||||
|
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
|
const QString &trFile = QLatin1String("designer_") + locale;
|
||||||
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
qApp->installTranslator(qtr);
|
qApp->installTranslator(qtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -783,7 +783,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
|||||||
const GitSubmitEditorPanelData &data,
|
const GitSubmitEditorPanelData &data,
|
||||||
const QString &messageFile,
|
const QString &messageFile,
|
||||||
const QStringList &checkedFiles,
|
const QStringList &checkedFiles,
|
||||||
const QStringList &origCommitFiles)
|
const QStringList &origCommitFiles,
|
||||||
|
const QStringList &origDeletedFiles)
|
||||||
{
|
{
|
||||||
if (Git::Constants::debug)
|
if (Git::Constants::debug)
|
||||||
qDebug() << "GitClient::addAndCommit:" << repositoryDirectory << checkedFiles << origCommitFiles;
|
qDebug() << "GitClient::addAndCommit:" << repositoryDirectory << checkedFiles << origCommitFiles;
|
||||||
@@ -795,8 +796,11 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
|||||||
if (!synchronousReset(repositoryDirectory, resetFiles.toList()))
|
if (!synchronousReset(repositoryDirectory, resetFiles.toList()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Re-add all to make sure we have the latest changes
|
// Re-add all to make sure we have the latest changes, but only add those that aren't marked
|
||||||
if (!synchronousAdd(repositoryDirectory, checkedFiles))
|
// for deletion
|
||||||
|
QStringList addFiles = checkedFiles.toSet().subtract(origDeletedFiles.toSet()).toList();
|
||||||
|
if (!addFiles.isEmpty())
|
||||||
|
if (!synchronousAdd(repositoryDirectory, addFiles))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Do the final commit
|
// Do the final commit
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ public:
|
|||||||
const GitSubmitEditorPanelData &data,
|
const GitSubmitEditorPanelData &data,
|
||||||
const QString &messageFile,
|
const QString &messageFile,
|
||||||
const QStringList &checkedFiles,
|
const QStringList &checkedFiles,
|
||||||
const QStringList &origCommitFiles);
|
const QStringList &origCommitFiles,
|
||||||
|
const QStringList &origDeletedFiles);
|
||||||
|
|
||||||
enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed };
|
enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed };
|
||||||
StatusResult gitStatus(const QString &workingDirectory,
|
StatusResult gitStatus(const QString &workingDirectory,
|
||||||
|
|||||||
@@ -614,6 +614,7 @@ void GitPlugin::startCommit()
|
|||||||
// files to be able to unstage files the user unchecks
|
// files to be able to unstage files the user unchecks
|
||||||
m_submitRepository = data.panelInfo.repository;
|
m_submitRepository = data.panelInfo.repository;
|
||||||
m_submitOrigCommitFiles = data.stagedFileNames();
|
m_submitOrigCommitFiles = data.stagedFileNames();
|
||||||
|
m_submitOrigDeleteFiles = data.stagedFileNames("deleted");
|
||||||
|
|
||||||
if (Git::Constants::debug)
|
if (Git::Constants::debug)
|
||||||
qDebug() << Q_FUNC_INFO << data << commitTemplate;
|
qDebug() << Q_FUNC_INFO << data << commitTemplate;
|
||||||
@@ -709,7 +710,8 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
|
|||||||
editor->panelData(),
|
editor->panelData(),
|
||||||
m_changeTmpFile->fileName(),
|
m_changeTmpFile->fileName(),
|
||||||
fileList,
|
fileList,
|
||||||
m_submitOrigCommitFiles);
|
m_submitOrigCommitFiles,
|
||||||
|
m_submitOrigDeleteFiles);
|
||||||
}
|
}
|
||||||
if (closeEditor)
|
if (closeEditor)
|
||||||
cleanChangeTmpFile();
|
cleanChangeTmpFile();
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ private:
|
|||||||
Core::IVersionControl *m_versionControl;
|
Core::IVersionControl *m_versionControl;
|
||||||
QString m_submitRepository;
|
QString m_submitRepository;
|
||||||
QStringList m_submitOrigCommitFiles;
|
QStringList m_submitOrigCommitFiles;
|
||||||
|
QStringList m_submitOrigDeleteFiles;
|
||||||
QTemporaryFile *m_changeTmpFile;
|
QTemporaryFile *m_changeTmpFile;
|
||||||
bool m_submitActionTriggered;
|
bool m_submitActionTriggered;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ static void addStateFileListToModel(const QList<CommitData::StateFilePair> &l,
|
|||||||
bool checked, FileType ft,
|
bool checked, FileType ft,
|
||||||
VCSBase::SubmitFileModel *model)
|
VCSBase::SubmitFileModel *model)
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef QList<CommitData::StateFilePair>::const_iterator ConstIterator;
|
typedef QList<CommitData::StateFilePair>::const_iterator ConstIterator;
|
||||||
if (!l.empty()) {
|
if (!l.empty()) {
|
||||||
const ConstIterator cend = l.constEnd();
|
const ConstIterator cend = l.constEnd();
|
||||||
|
|||||||
@@ -141,9 +141,16 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
QString locale = qApp->property("qtc_locale").toString();
|
QString locale = qApp->property("qtc_locale").toString();
|
||||||
if (!locale.isEmpty()) {
|
if (!locale.isEmpty()) {
|
||||||
QTranslator *qtr = new QTranslator(this);
|
QTranslator *qtr = new QTranslator(this);
|
||||||
qtr->load(QLatin1String("assistant_") + locale,
|
QTranslator *qhelptr = new QTranslator(this);
|
||||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
const QString &creatorTrPath =
|
||||||
|
Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
|
||||||
|
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
|
const QString &trFile = QLatin1String("assistant_") + locale;
|
||||||
|
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
||||||
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
qApp->installTranslator(qtr);
|
qApp->installTranslator(qtr);
|
||||||
|
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
||||||
|
qApp->installTranslator(qhelptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_WEBKIT
|
#ifndef QT_NO_WEBKIT
|
||||||
@@ -762,12 +769,19 @@ void HelpPlugin::openHelpPage(const QUrl& url)
|
|||||||
|
|
||||||
void HelpPlugin::openHelpPage(const QString& url)
|
void HelpPlugin::openHelpPage(const QString& url)
|
||||||
{
|
{
|
||||||
|
if (m_helpEngine->findFile(url).isValid()) {
|
||||||
activateHelpMode();
|
activateHelpMode();
|
||||||
if (m_helpEngine->findFile(url).isValid())
|
|
||||||
m_centralWidget->setSource(url);
|
m_centralWidget->setSource(url);
|
||||||
else {
|
} else {
|
||||||
QDesktopServices::openUrl(QLatin1String("http://doc.trolltech.com/latest/")
|
// local help not installed, resort to external web help
|
||||||
+ url.mid(url.lastIndexOf('/') + 1));
|
QString urlPrefix;
|
||||||
|
if (url.startsWith("qthelp://com.nokia.qtcreator")) {
|
||||||
|
urlPrefix = QString::fromLatin1("http://doc.trolltech.com/qtcreator-%1.%2/")
|
||||||
|
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR);
|
||||||
|
} else {
|
||||||
|
urlPrefix = QLatin1String("http://doc.trolltech.com/latest/");
|
||||||
|
}
|
||||||
|
QDesktopServices::openUrl(urlPrefix + url.mid(url.lastIndexOf('/') + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user