Merge commit 'origin/master'

This commit is contained in:
dt
2009-05-18 12:23:27 +02:00
35 changed files with 2796 additions and 3532 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2301,6 +2301,11 @@ p {
</context>
<context>
<name>CppFileSettingsPage</name>
<message>
<location filename="../../../src/plugins/cpptools/cpptoolsconstants.h" line="+52"/>
<source>File naming conventions</source>
<translation>Convenzioni sul nome dei file</translation>
</message>
<message>
<location filename="../../../src/plugins/cpptools/cppfilesettingspage.ui"/>
<source>Header suffix:</source>
@@ -4053,6 +4058,11 @@ L&apos;utilizzo di gdb 6.7 o successivi è fortemente consigliato.</translation>
</context>
<context>
<name>DebuggingHelperOptionPage</name>
<message>
<location filename="../../../src/plugins/debugger/debuggerplugin.cpp" line="-596"/>
<source>Debugging Helper</source>
<translation>Helper del Debug</translation>
</message>
<message>
<location filename="../../../src/plugins/debugger/dumperoptionpage.ui"/>
<source>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</source>
@@ -4438,8 +4448,8 @@ La ricompilazione del progetto potrebbe aiutare.</translation>
<name>DocSettingsPage</name>
<message>
<location filename="../../../src/plugins/help/docsettingspage.ui"/>
<source>Registered Documentation:</source>
<translation>Documentazione Registrata:</translation>
<source>Registered Documentation</source>
<translation>Documentazione Registrata</translation>
</message>
<message>
<location/>
@@ -10218,337 +10228,119 @@ Per eseguire la ricerca, scrivi questo prefisso, uno spazio e poi il termine da
</message>
</context>
<context>
<name>SimpleProEditor</name>
<name>QtModulesInfo</name>
<message>
<location filename="../../../src/plugins/qt4projectmanager/speinfo.cpp" line="+59"/>
<source>Debug and Release</source>
<translation>Debug e Release</translation>
</message>
<message>
<location line="+7"/>
<source>Debug specific</source>
<translation>Specifico del Debug</translation>
</message>
<message>
<location line="+7"/>
<source>Release specific</source>
<translation>Specifico del Release</translation>
</message>
<message>
<location line="+9"/>
<source>All platforms</source>
<translation>Tutte le piattaforme</translation>
</message>
<message>
<location line="+7"/>
<source>MS Windows specific</source>
<translation>Specifico di MS Windows</translation>
</message>
<message>
<location line="+7"/>
<source>Linux/Unix specific</source>
<translation>Specifico di Linux/Unix</translation>
</message>
<message>
<location line="+7"/>
<source>Mac OSX specific</source>
<translation>Specifico di Max OSX</translation>
</message>
<message>
<location line="+13"/>
<source>Target Options</source>
<translation>Opzioni Destinazione</translation>
</message>
<message>
<location line="+3"/>
<source>Type and name of the target.</source>
<translation>Tipo e nome della destinazione.</translation>
</message>
<message>
<location line="+13"/>
<source>Preprocessor Definitions</source>
<translation>Definizioni del Preprocessore</translation>
</message>
<message>
<location line="+3"/>
<source>Setting of the preprocessor definitions.</source>
<translation>Impostazione delle definizioni del preprocessore.</translation>
</message>
<message>
<location line="+14"/>
<source>Include path</source>
<translation>Percorso degli Include</translation>
</message>
<message>
<location line="+3"/>
<source>Setting of the pathes where the header files are located.</source>
<translation>Impostazione dei percorsi dove si trovano i file header.</translation>
</message>
<message>
<location line="+13"/>
<source>Libraries</source>
<translation>Librerie</translation>
</message>
<message>
<location line="+3"/>
<source>Defining the libraries to link the target against and the pathes where these are located.</source>
<translation>Definizione delle librerie con cui linkare la destinazione a dei percorsi che le contengono.</translation>
</message>
<message>
<location line="+14"/>
<source>Source Files</source>
<translation>File Sorgenti</translation>
</message>
<message>
<location line="+17"/>
<source>Header Files</source>
<translation>File Header</translation>
</message>
<message>
<location line="+17"/>
<source>Forms</source>
<translation>Form</translation>
</message>
<message>
<location line="+16"/>
<source>Qt Modules</source>
<translation>Moduli Qt</translation>
</message>
<message>
<location line="+3"/>
<source>Setting up which of the Qt modules will be used in the target application.</source>
<translation>Imposta quali moduli Qt saranno usati nell&apos;applicazione di destinazione.</translation>
</message>
<message>
<location line="+14"/>
<source>Resource files</source>
<translation>File delle Risorse</translation>
</message>
<message>
<location line="+12"/>
<source>Target name</source>
<translation>Nome Destinazione</translation>
</message>
<message>
<location line="+3"/>
<source>The name of the resulting target.</source>
<translation>Il nome della destinazione.</translation>
</message>
<message>
<location line="+9"/>
<source>Configuration</source>
<translation>Configurazione</translation>
</message>
<message>
<location line="+3"/>
<source>Configuration.</source>
<translation>Configurazione.</translation>
</message>
<message>
<location line="+9"/>
<source>Destination directory</source>
<translation>Cartella di Destinazione</translation>
</message>
<message>
<location line="+3"/>
<source>Where the resulting target will be created.</source>
<translation>La destinazione sarà creata qui dentro.</translation>
</message>
<message>
<location line="+15"/>
<source>QtCore Module</source>
<translation>Modulo QtCore</translation>
</message>
<message>
<location line="+3"/>
<source>Core non-GUI classes used by other modules</source>
<translation>Classi di Core, non-GUI, usate dagli altri moduli</translation>
</message>
<message>
<location line="+13"/>
<source>QtGui Module</source>
<translation>Modulo QtGui</translation>
</message>
<message>
<location line="+3"/>
<source>Graphical user interface components</source>
<translation>Componenti dell&apos;interfaccia grafica</translation>
</message>
<message>
<location line="+13"/>
<source>QtNetwork Module</source>
<translation>Modulo QtNetwork</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for network programming</source>
<translation>Classi per la programmazione della rete</translation>
</message>
<message>
<location line="+13"/>
<source>QtOpenGL Module</source>
<translation>Modulo QtOpenGL</translation>
</message>
<message>
<location line="+3"/>
<source>OpenGL support classes</source>
<translation>Classi per il supporto OpenGL</translation>
</message>
<message>
<location line="+13"/>
<source>QtSql Module</source>
<translation>Modulo QtSql</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for database integration using SQL</source>
<translation>Classi per l&apos;integrazione con database SQL</translation>
</message>
<message>
<location line="+13"/>
<source>QtScript Module</source>
<translation>Modulo QtScript</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for evaluating Qt Scripts</source>
<translation>Classi per l&apos;esecuzione di Qt Script</translation>
</message>
<message>
<location line="+13"/>
<source>QtSvg Module</source>
<translation>Modulo QtSvg</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for displaying the contents of SVG files</source>
<translation>Classi per la visualizzazione del contenuto di file SVG</translation>
</message>
<message>
<location line="+13"/>
<source>QtWebKit Module</source>
<translation>Modulo QtWebKit</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for displaying and editing Web content</source>
<translation>Classi per la visualizzazione e modifica del contenuto Web</translation>
</message>
<message>
<location line="+13"/>
<source>QtXml Module</source>
<translation>Modulo QtXml</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for handling XML</source>
<translation>Classi per la gestione di XML</translation>
</message>
<message>
<location line="+13"/>
<source>QtXmlPatterns Module</source>
<translation>Modulo QtXmlPatterns</translation>
</message>
<message>
<location line="+3"/>
<source>An XQuery/XPath engine for XML and custom data models</source>
<translation>Un motore XQuery/XPath per XML e modelli di dati speciali</translation>
</message>
<message>
<location line="+13"/>
<source>Phonon Module</source>
<translation>Modulo Phonon</translation>
</message>
<message>
<location line="+3"/>
<source>Multimedia framework classes</source>
<translation>Classi del framework multimediale</translation>
</message>
<message>
<location line="+13"/>
<source>Qt3Support Module</source>
<translation>Modulo Qt3Support</translation>
</message>
<message>
<location line="+3"/>
<source>Classes that ease porting from Qt 3 to Qt 4</source>
<translation>Classi che facilitano il porting da Qt 3 a Qt 4</translation>
</message>
<message>
<location line="+13"/>
<source>QtTest Module</source>
<translation>Modulo QtTest</translation>
</message>
<message>
<location line="+3"/>
<source>Tool classes for unit testing</source>
<translation>Classi di ausilio per lo unit testing</translation>
</message>
<message>
<location line="+13"/>
<source>QtDBus module</source>
<translation>Modulo QtDBus</translation>
</message>
<message>
<location line="+3"/>
<source>Classes for Inter-Process Communication using the D-Bus</source>
<translation>Classi per la comunicazione-intra-processo usando il D-Bus</translation>
</message>
<message>
<location line="+15"/>
<source>Application</source>
<translation>Applicazione</translation>
</message>
<message>
<location line="+3"/>
<source>Create a standalone application</source>
<translation>Crea un&apos;applicazione</translation>
</message>
<message>
<location line="+13"/>
<source>Dynamic Library</source>
<translation>Libreria Condivisa</translation>
</message>
<message>
<location line="+3"/>
<source>Create a dynamic library for usage in other applications</source>
<translation>Crea una libreria condivisa per l&apos;uso in altre applicazioni</translation>
</message>
<message>
<location line="+13"/>
<source>Static Library</source>
<translation>Libreria Statica</translation>
</message>
<message>
<location line="+3"/>
<source>Create a static library for usage in other applications</source>
<translation>Crea una libreria statica per l&apos;uso in altre applicazioni</translation>
</message>
<message>
<location line="+10"/>
<source>Add Operator</source>
<translation>Operatore di Aggiunta</translation>
</message>
<message>
<location line="+7"/>
<source>Remove Operator</source>
<translation>Operatore di Rimozione</translation>
</message>
<message>
<location line="+7"/>
<source>Replace Operator</source>
<translation>Operatore di Sostituzione</translation>
</message>
<message>
<location line="+7"/>
<source>Set Operator</source>
<translation>Operatore di Assegnazione</translation>
</message>
<message>
<location line="+7"/>
<source>Unique Add Operator</source>
<translation>Operatore di Aggiunta Unica</translation>
</message>
</context>
<context>
<name>Snippets::Internal::SnippetsPlugin</name>
@@ -11749,6 +11541,11 @@ Queste codifiche dovrebbero andare bene:</translation>
<source>Prompt to submit</source>
<translation>Prompt del submit</translation>
</message>
<message>
<location/>
<source>Common</source>
<translation>Comune</translation>
</message>
<message>
<location/>
<source>Wrap submit message at:</source>

View File

@@ -2224,6 +2224,11 @@ background-image: url(:/core/images/welcomemode/feedback-bar-background.png);
</context>
<context>
<name>CppFileSettingsPage</name>
<message>
<location filename="../../../src/plugins/cpptools/cpptoolsconstants.h" line="+51"/>
<source>File naming conventions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/cpptools/cppfilesettingspage.ui"/>
<source>Form</source>
@@ -3713,6 +3718,11 @@ Using gdb 6.7 or later is strongly recommended.</source>
</context>
<context>
<name>DebuggingHelperOptionPage</name>
<message>
<location filename="../../../src/plugins/debugger/debuggerplugin.cpp" line="-596"/>
<source>Debugging Helper</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../src/plugins/debugger/dumperoptionpage.ui"/>
<source>Form</source>
@@ -4112,7 +4122,7 @@ Rebuilding the project might help.</source>
</message>
<message>
<location/>
<source>Registered Documentation:</source>
<source>Registered Documentation</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -10000,337 +10010,119 @@ To do this you type this shortcut and a space in the QuickOpen entry field, and
</message>
</context>
<context>
<name>SimpleProEditor</name>
<name>QtModulesInfo</name>
<message>
<location filename="../../../src/plugins/qt4projectmanager/speinfo.cpp" line="+59"/>
<source>Debug and Release</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Debug specific</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Release specific</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>All platforms</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>MS Windows specific</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Linux/Unix specific</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Mac OSX specific</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Target Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Type and name of the target.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Preprocessor Definitions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Setting of the preprocessor definitions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Include path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Setting of the pathes where the header files are located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Libraries</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Defining the libraries to link the target against and the pathes where these are located.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Source Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Header Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Forms</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Qt Modules</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Setting up which of the Qt modules will be used in the target application.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Resource files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Target name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>The name of the resulting target.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Configuration.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Destination directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Where the resulting target will be created.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>QtCore Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Core non-GUI classes used by other modules</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtGui Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Graphical user interface components</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtNetwork Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for network programming</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtOpenGL Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>OpenGL support classes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtSql Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for database integration using SQL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtScript Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for evaluating Qt Scripts</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtSvg Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for displaying the contents of SVG files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtWebKit Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for displaying and editing Web content</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtXml Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for handling XML</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtXmlPatterns Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>An XQuery/XPath engine for XML and custom data models</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Phonon Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Multimedia framework classes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Qt3Support Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes that ease porting from Qt 3 to Qt 4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtTest Module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Tool classes for unit testing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>QtDBus module</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Classes for Inter-Process Communication using the D-Bus</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Create a standalone application</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Dynamic Library</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Create a dynamic library for usage in other applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Static Library</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Create a static library for usage in other applications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Add Operator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Remove Operator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Replace Operator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Set Operator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Unique Add Operator</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Snippets::Internal::SnippetsPlugin</name>
@@ -11505,6 +11297,11 @@ The following encodings are likely to fit:</source>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location/>
<source>Common</source>
<translation type="unfinished"></translation>
</message>
<message>
<location/>
<source>Prompt to submit</source>

View File

@@ -47,6 +47,7 @@
*/
#include "pp.h"
#include "pp-cctype.h"
#include <Lexer.h>
#include <Token.h>
@@ -702,7 +703,7 @@ bool Preprocessor::markGeneratedTokens(bool markGeneratedTokens,
++it;
for (; it != end; ++it) {
if (! std::isspace(*it))
if (! pp_isspace(*it))
out(' ');
else
@@ -773,7 +774,7 @@ void Preprocessor::preprocess(const QByteArray &fileName, const QByteArray &sour
++it;
for (; it != end; ++it) {
if (std::isspace(*it))
if (pp_isspace(*it))
out(*it);
else

View File

@@ -0,0 +1,61 @@
#include "parameteraction.h"
namespace Core {
namespace Utils {
ParameterAction::ParameterAction(const QString &emptyText,
const QString &parameterText,
EnablingMode mode,
QObject* parent) :
QAction(emptyText, parent),
m_emptyText(emptyText),
m_parameterText(parameterText),
m_enablingMode(mode)
{
}
QString ParameterAction::emptyText() const
{
return m_emptyText;
}
void ParameterAction::setEmptyText(const QString &t)
{
m_emptyText = t;
}
QString ParameterAction::parameterText() const
{
return m_parameterText;
}
void ParameterAction::setParameterText(const QString &t)
{
m_parameterText = t;
}
ParameterAction::EnablingMode ParameterAction::enablingMode() const
{
return m_enablingMode;
}
void ParameterAction::setEnablingMode(EnablingMode m)
{
m_enablingMode = m;
}
void ParameterAction::setParameter(const QString &p)
{
const bool enabled = !p.isEmpty();
if (enabled) {
setText(m_parameterText.arg(p));
} else {
setText(m_emptyText);
}
if (m_enablingMode == EnabledWithParameter)
setEnabled(enabled);
}
}
}

View File

@@ -0,0 +1,85 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef PARAMETERACTION_H
#define PARAMETERACTION_H
#include "utils_global.h"
#include <QtGui/QAction>
namespace Core {
namespace Utils {
/* ParameterAction: Intended for actions that act on a 'current',
* string-type parameter (typically file name) and have 2 states:
* 1) <no current parameter> displaying "Do XX" (empty text)
* 2) <parameter present> displaying "Do XX with %1".
* Provides a slot to set the parameter, changing display
* and enabled state accordingly.
* The text passed in should already be translated; parameterText
* should contain a %1 where the parameter is to be inserted. */
class QTCREATOR_UTILS_EXPORT ParameterAction : public QAction
{
Q_ENUMS(EnablingMode)
Q_PROPERTY(QString emptyText READ emptyText WRITE setEmptyText)
Q_PROPERTY(QString parameterText READ parameterText WRITE setParameterText)
Q_PROPERTY(EnablingMode enablingMode READ enablingMode WRITE setEnablingMode)
Q_OBJECT
public:
enum EnablingMode { AlwaysEnabled, EnabledWithParameter };
explicit ParameterAction(const QString &emptyText,
const QString &parameterText,
EnablingMode em = AlwaysEnabled,
QObject* parent = 0);
QString emptyText() const;
void setEmptyText(const QString &);
QString parameterText() const;
void setParameterText(const QString &);
EnablingMode enablingMode() const;
void setEnablingMode(EnablingMode m);
public slots:
void setParameter(const QString &);
private:
QString m_emptyText;
QString m_parameterText;
EnablingMode m_enablingMode;
};
}
}
#endif // PARAMETERACTION_H

View File

@@ -29,7 +29,8 @@ SOURCES += \
synchronousprocess.cpp \
submitfieldwidget.cpp \
consoleprocess.cpp \
uncommentselection.cpp
uncommentselection.cpp \
parameteraction.cpp
win32 {
SOURCES += abstractprocess_win.cpp \
@@ -66,7 +67,8 @@ HEADERS += \
consoleprocess.h \
synchronousprocess.h \
submitfieldwidget.h \
uncommentselection.h
uncommentselection.h \
parameteraction.h
FORMS += filewizardpage.ui \
projectintropage.ui \

View File

@@ -163,7 +163,7 @@ WelcomeMode::WelcomeMode() :
m_d->ui.sitesTreeWidget->addItem(tr("Qt Labs"), QLatin1String("http://labs.qtsoftware.com"));
m_d->ui.sitesTreeWidget->addItem(tr("Qt Git Hosting"), QLatin1String("http://qt.gitorious.org"));
m_d->ui.sitesTreeWidget->addItem(tr("Qt Centre"), QLatin1String("http://www.qtcentre.org"));
m_d->ui.sitesTreeWidget->addItem(tr("Qt/S60 at Forum Nokia"), QLatin1String("http://discussion.forum.nokia.com/forum/forumdisplay.php?f=196"));
m_d->ui.sitesTreeWidget->addItem(tr("Qt for S60 at Forum Nokia"), QLatin1String("http://discussion.forum.nokia.com/forum/forumdisplay.php?f=196"));
m_d->ui.tutorialTreeWidget->addItem(tr("Qt Creator - A quick tour"),
QString("qthelp://com.nokia.qtcreator.%1%2/doc/index.html").arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
@@ -314,13 +314,15 @@ void WelcomeMode::slotFeedback()
void WelcomeMode::slotNextTip()
{
QStringList tips = tipsOfTheDay();
m_d->ui.didYouKnowTextBrowser->setText(tips.at((++m_d->currentTip)%tips.count()));
m_d->currentTip = ((m_d->currentTip+1)%tips.count());
m_d->ui.didYouKnowTextBrowser->setText(tips.at(m_d->currentTip));
}
void WelcomeMode::slotPrevTip()
{
QStringList tips = tipsOfTheDay();
m_d->ui.didYouKnowTextBrowser->setText(tips.at((--m_d->currentTip)%tips.count()));
m_d->currentTip = ((m_d->currentTip-1)+tips.count())%tips.count();
m_d->ui.didYouKnowTextBrowser->setText(tips.at(m_d->currentTip));
}
QStringList WelcomeMode::tipsOfTheDay()

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<ui version="4.0" >
<class>CodePaster::SettingsPage</class>
<widget class="QWidget" name="CodePaster::SettingsPage">
<property name="geometry">
<widget class="QWidget" name="CodePaster::SettingsPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
@@ -10,73 +10,62 @@
<height>258</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>CodePaster Server:</string>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>General</string>
</property>
<layout class="QFormLayout" name="formLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>CodePaster Server:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="serverEdit" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Username:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="userEdit" />
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="clipboardBox" >
<property name="text" >
<string>Copy Paste URL to clipboard</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="displayBox" >
<property name="text" >
<string>Display Output Pane after sending a post</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="serverEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="userEdit"/>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="clipboardBox">
<property name="text">
<string>Copy Paste URL to clipboard</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="displayBox">
<property name="text">
<string>Display Output Pane after sending a post</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint" stdset="0" >
<size>
<width>223</width>
<height>100</height>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<ui version="4.0" >
<class>CppFileSettingsPage</class>
<widget class="QWidget" name="CppFileSettingsPage">
<property name="geometry">
<widget class="QWidget" name="CppFileSettingsPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
@@ -10,70 +10,58 @@
<height>503</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="headerSuffixLabel">
<property name="text">
<string>Header suffix:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="headerSuffixComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lowerCaseFileNamesLabel">
<property name="toolTip">
<string>This determines how the file names of the class wizards are generated (&quot;MyClass.h&quot; versus &quot;myclass.h&quot;).</string>
</property>
<property name="text">
<string>Lower case file names:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="lowerCaseFileNamesCheckBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="sourceSuffixLabel">
<property name="text">
<string>Source suffix:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sourceSuffixComboBox"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QGroupBox" name="groupBox" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>File naming conventions</string>
</property>
<layout class="QFormLayout" name="formLayout" >
<property name="fieldGrowthPolicy" >
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="headerSuffixLabel" >
<property name="text" >
<string>Header suffix:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="headerSuffixComboBox" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="sourceSuffixLabel" >
<property name="text" >
<string>Source suffix:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="sourceSuffixComboBox" />
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="lowerCaseFileNamesCheckBox" >
<property name="text" >
<string>Lower case file names</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>430</height>

View File

@@ -430,6 +430,14 @@ void DebuggerManager::init()
m_threadsDock = createDockForWidget(m_threadsWindow);
QSplitter *localsAndWatchers = new QSplitter(Qt::Vertical, 0);
localsAndWatchers->setWindowTitle(m_localsWindow->windowTitle());
localsAndWatchers->addWidget(m_localsWindow);
localsAndWatchers->addWidget(m_watchersWindow);
localsAndWatchers->setStretchFactor(0, 3);
localsAndWatchers->setStretchFactor(1, 1);
m_watchDock = createDockForWidget(localsAndWatchers);
setStatus(DebuggerProcessNotReady);
}
@@ -457,17 +465,6 @@ IDebuggerManagerAccessForEngines *DebuggerManager::engineInterface()
return dynamic_cast<IDebuggerManagerAccessForEngines *>(this);
}
void DebuggerManager::createDockWidgets()
{
QSplitter *localsAndWatchers = new QSplitter(Qt::Vertical, 0);
localsAndWatchers->setWindowTitle(m_localsWindow->windowTitle());
localsAndWatchers->addWidget(m_localsWindow);
localsAndWatchers->addWidget(m_watchersWindow);
localsAndWatchers->setStretchFactor(0, 3);
localsAndWatchers->setStretchFactor(1, 1);
m_watchDock = createDockForWidget(localsAndWatchers);
}
void DebuggerManager::createNewDock(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
@@ -482,12 +479,13 @@ QDockWidget *DebuggerManager::createDockForWidget(QWidget *widget)
{
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
dockWidget->setObjectName(widget->windowTitle());
dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
dockWidget->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable);
dockWidget->setTitleBarWidget(new QWidget(dockWidget));
dockWidget->setWidget(widget);
connect(dockWidget->toggleViewAction(), SIGNAL(toggled(bool)),
this, SLOT(dockToggled(bool)), Qt::QueuedConnection);
connect(dockWidget->toggleViewAction(), SIGNAL(triggered()),
this, SLOT(dockActionTriggered()), Qt::QueuedConnection);
m_dockWidgets.append(dockWidget);
m_dockWidgetActiveState.append(false);
return dockWidget;
}
@@ -518,11 +516,30 @@ void DebuggerManager::setSimpleDockWidgetArrangement()
m_outputDock->hide();
}
void DebuggerManager::updateDockWidgetActiveStates()
{
for (int i = 0; i < m_dockWidgets.size(); ++i) {
m_dockWidgetActiveState[i] = m_dockWidgets.at(i)->isVisible();
}
}
void DebuggerManager::setFloatingDockWidgetsVisible(bool visible)
{
for (int i = 0; i < m_dockWidgets.size(); ++i) {
QDockWidget *dockWidget = m_dockWidgets.at(i);
if (dockWidget->isFloating() && m_dockWidgetActiveState.at(i)) {
dockWidget->setVisible(visible);
}
}
if (visible)
updateDockWidgetActiveStates(); // we can't do that earlier, because the dock widgets are not visible at startup
}
void DebuggerManager::setLocked(bool locked)
{
const QDockWidget::DockWidgetFeatures features =
(locked) ? QDockWidget::DockWidgetClosable :
QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable;
(locked) ? QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable :
QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable;
foreach (QDockWidget *dockWidget, m_dockWidgets) {
QWidget *titleBarWidget = dockWidget->titleBarWidget();
@@ -537,11 +554,16 @@ void DebuggerManager::setLocked(bool locked)
}
}
void DebuggerManager::dockToggled(bool on)
void DebuggerManager::dockActionTriggered()
{
QDockWidget *dw = qobject_cast<QDockWidget *>(sender()->parent());
if (on && dw)
dw->raise();
if (dw) {
if (dw->isVisible())
dw->raise();
int index = m_dockWidgets.indexOf(dw);
if (index >= 0)
m_dockWidgetActiveState[index] = dw->isVisible();
}
}
QAbstractItemModel *DebuggerManager::threadsModel()

View File

@@ -217,7 +217,9 @@ public slots:
void setSimpleDockWidgetArrangement();
void setLocked(bool locked);
void dockToggled(bool on);
void setFloatingDockWidgetsVisible(bool visible);
void updateDockWidgetActiveStates();
void dockActionTriggered();
void setBusyCursor(bool on);
void queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **ed);
@@ -316,7 +318,6 @@ private:
//
QWidget *threadsWindow() const { return m_threadsWindow; }
QList<QDockWidget*> dockWidgets() const { return m_dockWidgets; }
void createDockWidgets();
virtual bool qtDumperLibraryEnabled() const;
virtual QString qtDumperLibraryName() const;
@@ -400,6 +401,7 @@ private:
QDockWidget *m_threadsDock;
QDockWidget *m_watchDock;
QList<QDockWidget*> m_dockWidgets;
QList<bool> m_dockWidgetActiveState;
BreakHandler *m_breakHandler;
DisassemblerHandler *m_disassemblerHandler;

View File

@@ -173,10 +173,6 @@ class DebugMode : public Core::BaseMode
public:
DebugMode(QObject *parent = 0);
~DebugMode();
// IMode
void activated() {}
void shutdown() {}
};
DebugMode::DebugMode(QObject *parent)
@@ -409,8 +405,6 @@ DebuggerPlugin::~DebuggerPlugin()
void DebuggerPlugin::shutdown()
{
if (m_debugMode)
m_debugMode->shutdown(); // saves state including manager information
QTC_ASSERT(m_manager, /**/);
if (m_manager)
m_manager->shutdown();
@@ -758,12 +752,11 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
toolBarAddingLayout->addWidget(rightPaneSplitter);
toolBarAddingLayout->addWidget(debugToolBar);
m_manager->createDockWidgets();
m_manager->setSimpleDockWidgetArrangement();
readSettings();
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
this, SLOT(focusCurrentEditor(Core::IMode*)));
this, SLOT(onModeChanged(Core::IMode*)));
m_debugMode->widget()->setFocusProxy(EditorManager::instance());
addObject(m_debugMode);
@@ -1047,10 +1040,13 @@ void DebuggerPlugin::readSettings()
m_manager->mainWindow()->restoreState(ba);
}
void DebuggerPlugin::focusCurrentEditor(IMode *mode)
void DebuggerPlugin::onModeChanged(IMode *mode)
{
if (mode != m_debugMode)
if (mode != m_debugMode) {
m_manager->setFloatingDockWidgetsVisible(false);
return;
}
m_manager->setFloatingDockWidgetsVisible(true);
EditorManager *editorManager = EditorManager::instance();

View File

@@ -96,7 +96,7 @@ private slots:
void breakpointSetRemoveMarginActionTriggered();
void breakpointEnableDisableMarginActionTriggered();
void focusCurrentEditor(Core::IMode *mode);
void onModeChanged(Core::IMode *mode);
void showSettingsDialog();
void startExternalApplication();

View File

@@ -10,85 +10,98 @@
<height>434</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBoxUseDebuggingHelpers">
<property name="toolTip">
<string>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
<property name="text">
<string>Use debugging helper</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCustomDebuggingHelperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
<property name="text">
<string>Use debugging helper from custom location</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="dumperLocationLabel">
<property name="text">
<string>Location: </string>
</property>
</widget>
</item>
<item>
<widget class="Core::Utils::PathChooser" name="dumperLocationChooser" native="true"/>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDebugDebuggingHelpers">
<property name="toolTip">
<string notr="true">This is an internal tool to make debugging the debugging helper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
</property>
<property name="text">
<string>Debug debugging helper</string>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Debugging helper</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxUseDebuggingHelpers">
<property name="toolTip">
<string>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
<property name="text">
<string>Use debugging helper</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCustomDebuggingHelperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
<property name="text">
<string>Use debugging helper from custom location</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="dumperLocationLabel">
<property name="text">
<string>Location: </string>
</property>
</widget>
</item>
<item>
<widget class="Core::Utils::PathChooser" name="dumperLocationChooser" native="true"/>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDebugDebuggingHelpers">
<property name="toolTip">
<string notr="true">This is an internal tool to make debugging the debugging helper code easier. Using this action is in general not needed unless you want do debug Qt Creator itself.</string>
</property>
<property name="text">
<string>Debug debugging helper</string>
</property>
</widget>
</item>
</layout>
<zorder></zorder>
<zorder>checkBoxDebugDebuggingHelpers</zorder>
<zorder>checkBoxUseDebuggingHelpers</zorder>
<zorder></zorder>
</widget>
</item>
<item>
@@ -105,8 +118,6 @@
</spacer>
</item>
</layout>
<zorder>checkBoxDebugDebuggingHelpers</zorder>
<zorder>checkBoxUseDebuggingHelpers</zorder>
</widget>
<customwidgets>
<customwidget>

View File

@@ -85,6 +85,14 @@ protected:
using Visitor::visit;
using Visitor::endVisit;
void addWords(AST::UiQualifiedId *id)
{
for (; id; id = id->next) {
if (id->name)
_words.insert(id->name->asString());
}
}
virtual bool visit(AST::UiPublicMember *node)
{
if (node->name)
@@ -93,14 +101,6 @@ protected:
return true;
}
virtual bool visit(AST::UiObjectDefinition *node)
{
if (node->name)
_words.insert(node->name->asString());
return true;
}
virtual bool visit(AST::UiQualifiedId *node)
{
if (node->name)
@@ -109,14 +109,6 @@ protected:
return true;
}
virtual bool visit(AST::UiObjectBinding *node)
{
if (node->name)
_words.insert(node->name->asString());
return true;
}
virtual bool visit(AST::IdentifierExpression *node)
{
if (node->name)
@@ -302,8 +294,8 @@ protected:
init(&decl, node);
decl.text.fill(QLatin1Char(' '), _depth);
if (node->name)
decl.text.append(node->name->asString());
if (node->qualifiedObjectNameId)
decl.text.append(asString(node->qualifiedObjectNameId));
else
decl.text.append(QLatin1Char('?'));
@@ -329,8 +321,8 @@ protected:
decl.text.append(asString(node->qualifiedId));
decl.text.append(QLatin1String(": "));
if (node->name)
decl.text.append(node->name->asString());
if (node->qualifiedObjectNameId)
decl.text.append(asString(node->qualifiedObjectNameId));
else
decl.text.append(QLatin1Char('?'));

View File

@@ -47,6 +47,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
#include <vcsbase/basevcseditorfactory.h>
#include <vcsbase/vcsbaseeditor.h>
@@ -275,7 +276,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
Core::Command *command;
m_diffAction = new QAction(tr("Diff Current File"), this);
m_diffAction = new Core::Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
#ifndef Q_OS_MAC
@@ -284,7 +285,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
gitContainer->addAction(command);
m_statusAction = new QAction(tr("File Status"), this);
m_statusAction = new Core::Utils::ParameterAction(tr("File Status"), tr("Status Related to \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
@@ -293,7 +294,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
gitContainer->addAction(command);
m_logAction = new QAction(tr("Log File"), this);
m_logAction = new Core::Utils::ParameterAction(tr("Log File"), tr("Log of \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
@@ -302,7 +303,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
gitContainer->addAction(command);
m_blameAction = new QAction(tr("Blame"), this);
m_blameAction = new Core::Utils::ParameterAction(tr("Blame"), tr("Blame for \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
@@ -311,7 +312,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
gitContainer->addAction(command);
m_undoFileAction = new QAction(tr("Undo Changes"), this);
m_undoFileAction = new Core::Utils::ParameterAction(tr("Undo Changes"), tr("Undo Changes for \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
@@ -320,7 +321,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
gitContainer->addAction(command);
m_stageAction = new QAction(tr("Stage File for Commit"), this);
m_stageAction = new Core::Utils::ParameterAction(tr("Stage File for Commit"), tr("Stage \"%1\" for Commit"), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
@@ -329,13 +330,13 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
gitContainer->addAction(command);
m_unstageAction = new QAction(tr("Unstage File from Commit"), this);
m_unstageAction = new Core::Utils::ParameterAction(tr("Unstage File from Commit"), tr("Unstage \"%1\" from Commit"), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile()));
gitContainer->addAction(command);
m_revertAction = new QAction(tr("Revert..."), this);
m_revertAction = new Core::Utils::ParameterAction(tr("Revert..."), tr("Revert \"%1\"..."), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile()));
@@ -343,7 +344,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Project"), this));
m_diffProjectAction = new QAction(tr("Diff Current Project"), this);
m_diffProjectAction = new Core::Utils::ParameterAction(tr("Diff Current Project"), tr("Diff Project \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
@@ -352,13 +353,13 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
gitContainer->addAction(command);
m_statusProjectAction = new QAction(tr("Project Status"), this);
m_statusProjectAction = new Core::Utils::ParameterAction(tr("Project Status"), tr("Status Project \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject()));
gitContainer->addAction(command);
m_logProjectAction = new QAction(tr("Log Project"), this);
m_logProjectAction = new Core::Utils::ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), Core::Utils::ParameterAction::AlwaysEnabled, this);
command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
#ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
@@ -785,15 +786,14 @@ void GitPlugin::updateActions()
const QString repository = m_gitClient->findRepositoryForFile(current.absoluteFilePath());
// First check for file commands and if the current file is inside
// a Git-repository
const QString file = fileName.isEmpty() ? tr("File") : "\"" + fileName + '"';
m_diffAction->setText(tr("Diff %1").arg(file));
m_statusAction->setText(tr("Status Related to %1").arg(file));
m_logAction->setText(tr("Log of %1").arg(file));
m_blameAction->setText(tr("Blame for %1").arg(file));
m_undoFileAction->setText(tr("Undo Changes for %1").arg(file));
m_stageAction->setText(tr("Stage %1 for Commit").arg(file));
m_unstageAction->setText(tr("Unstage %1 from Commit").arg(file));
m_revertAction->setText(tr("Revert %1...").arg(file));
m_diffAction->setParameter(fileName);
m_statusAction->setParameter(fileName);
m_logAction->setParameter(fileName);
m_blameAction->setParameter(fileName);
m_undoFileAction->setParameter(fileName);
m_stageAction->setParameter(fileName);
m_unstageAction->setParameter(fileName);
m_revertAction->setParameter(fileName);
bool enabled = !fileName.isEmpty() && !repository.isEmpty();
m_diffAction->setEnabled(enabled);
@@ -809,10 +809,10 @@ void GitPlugin::updateActions()
// If the file is not in a repository, the corresponding project will
// be neither and we can disable everything and return
m_diffProjectAction->setEnabled(false);
m_diffProjectAction->setText(tr("Diff Project"));
m_statusProjectAction->setText(tr("Status Project"));
m_diffProjectAction->setParameter(repository);
m_statusProjectAction->setParameter(repository);
m_statusProjectAction->setEnabled(false);
m_logProjectAction->setText(tr("Log Project"));
m_logProjectAction->setParameter(repository);
m_logProjectAction->setEnabled(false);
return;
}
@@ -822,18 +822,18 @@ void GitPlugin::updateActions()
using namespace ProjectExplorer;
QString project;
if (m_projectExplorer) {
if (Node *node = m_projectExplorer->currentNode())
if (Node *projectNode = node->projectNode())
project = '"' + QFileInfo(projectNode->path()).completeBaseName() + '"';
if (const Node *node = m_projectExplorer->currentNode())
if (const Node *projectNode = node->projectNode())
project = QFileInfo(projectNode->path()).completeBaseName();
}
enabled = !project.isEmpty();
m_diffProjectAction->setEnabled(enabled);
m_diffProjectAction->setText(tr("Diff Project %1").arg(project));
m_diffProjectAction->setParameter(project);
m_statusProjectAction->setEnabled(enabled);
m_statusProjectAction->setText(tr("Status Project %1").arg(project));
m_statusProjectAction->setParameter(project);
m_logProjectAction->setEnabled(enabled);
m_logProjectAction->setText(tr("Log Project %1").arg(project));
m_logProjectAction->setParameter(project);
}
void GitPlugin::showCommit()

View File

@@ -52,6 +52,9 @@ namespace Core {
class IEditorFactory;
class ICore;
class IVersionControl;
namespace Utils {
class ParameterAction;
}
} // namespace Core
namespace Git {
@@ -133,19 +136,19 @@ private:
static GitPlugin *m_instance;
Core::ICore *m_core;
QAction *m_diffAction;
QAction *m_diffProjectAction;
QAction *m_statusAction;
QAction *m_statusProjectAction;
QAction *m_logAction;
QAction *m_blameAction;
QAction *m_logProjectAction;
QAction *m_undoFileAction;
Core::Utils::ParameterAction *m_diffAction;
Core::Utils::ParameterAction *m_diffProjectAction;
Core::Utils::ParameterAction *m_statusAction;
Core::Utils::ParameterAction *m_statusProjectAction;
Core::Utils::ParameterAction *m_logAction;
Core::Utils::ParameterAction *m_blameAction;
Core::Utils::ParameterAction *m_logProjectAction;
Core::Utils::ParameterAction *m_undoFileAction;
QAction *m_undoProjectAction;
QAction *m_showAction;
QAction *m_stageAction;
QAction *m_unstageAction;
QAction *m_revertAction;
Core::Utils::ParameterAction *m_stageAction;
Core::Utils::ParameterAction *m_unstageAction;
Core::Utils::ParameterAction *m_revertAction;
QAction *m_commitAction;
QAction *m_pullAction;
QAction *m_pushAction;

View File

@@ -11,61 +11,53 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Registered Documentation:</string>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Registered Documentation</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="_3" >
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QListWidget" name="docsListWidget" />
</item>
<item>
</item>
<item>
<layout class="QVBoxLayout" name="_4" >
<property name="spacing" >
<number>6</number>
</property>
<number>6</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="addButton" >
<property name="text" >
<string>Add...</string>
</property>
</widget>
</item>
<item>
<string>Add...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
<item>
<spacer>
<string>Remove</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

View File

@@ -48,6 +48,7 @@
#include <coreplugin/uniqueidmanager.h>
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
#include <utils/parameteraction.h>
#include <vcsbase/basevcseditorfactory.h>
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <vcsbase/vcsbaseeditor.h>
@@ -263,7 +264,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
Core::Command *command;
QAction *tmpaction;
m_editAction = new QAction(tr("Edit"), this);
m_editAction = new Core::Utils::ParameterAction(tr("Edit"), tr("Edit \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E")));
@@ -271,7 +272,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
mperforce->addAction(command);
m_addAction = new QAction(tr("Add"), this);
m_addAction = new Core::Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A")));
@@ -279,14 +280,14 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
mperforce->addAction(command);
m_deleteAction = new QAction(tr("Delete"), this);
m_deleteAction = new Core::Utils::ParameterAction(tr("Delete"), tr("Delete \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Delete File"));
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
mperforce->addAction(command);
m_revertAction = new QAction(tr("Revert"), this);
m_revertAction = new Core::Utils::ParameterAction(tr("Revert"), tr("Revert \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R")));
@@ -299,14 +300,14 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
command = am->registerAction(tmpaction, QLatin1String("Perforce.Sep.Edit"), globalcontext);
mperforce->addAction(command);
m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
m_diffCurrentAction = new Core::Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Diff Current File"));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
mperforce->addAction(command);
m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this);
m_diffProjectAction = new Core::Utils::ParameterAction(tr("Diff Current Project/Session"), tr("Diff Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D")));
@@ -351,7 +352,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
connect(m_describeAction, SIGNAL(triggered()), this, SLOT(describeChange()));
mperforce->addAction(command);
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
m_annotateCurrentAction = new Core::Utils::ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Annotate Current File"));
@@ -363,7 +364,7 @@ bool PerforcePlugin::initialize(const QStringList &arguments, QString *errorMess
connect(m_annotateAction, SIGNAL(triggered()), this, SLOT(annotate()));
mperforce->addAction(command);
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
m_filelogCurrentAction = new Core::Utils::ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F")));
@@ -628,40 +629,22 @@ void PerforcePlugin::filelog(const QString &fileName)
void PerforcePlugin::updateActions()
{
QString fileName = currentFileName();
QString baseName = QFileInfo(fileName).fileName();
const bool hasFile = !currentFileName().isEmpty();
m_editAction->setEnabled(hasFile);
m_addAction->setEnabled(hasFile);
m_deleteAction->setEnabled(hasFile);
m_revertAction->setEnabled(hasFile);
m_diffCurrentAction->setEnabled(hasFile);
m_annotateCurrentAction->setEnabled(hasFile);
m_filelogCurrentAction->setEnabled(hasFile);
if (hasFile) {
m_editAction->setText(tr("Edit %1").arg(baseName));
m_addAction->setText(tr("Add %1").arg(baseName));
m_deleteAction->setText(tr("Delete %1").arg(baseName));
m_revertAction->setText(tr("Revert %1").arg(baseName));
m_diffCurrentAction->setText(tr("Diff %1").arg(baseName));
m_annotateCurrentAction->setText(tr("Annotate %1").arg(baseName));
m_filelogCurrentAction->setText(tr("Filelog %1").arg(baseName));
} else {
m_editAction->setText(tr("Edit"));
m_addAction->setText(tr("Add"));
m_deleteAction->setText(tr("Delete"));
m_revertAction->setText(tr("Revert"));
m_diffCurrentAction->setText(tr("Diff"));
m_annotateCurrentAction->setText(tr("Annotate Current File"));
m_filelogCurrentAction->setText(tr("Filelog Current File"));
}
const QString fileName = currentFileName();
const QString baseName = fileName.isEmpty() ? fileName : QFileInfo(fileName).fileName();
m_editAction->setParameter(baseName);
m_addAction->setParameter(baseName);
m_deleteAction->setParameter(baseName);
m_revertAction->setParameter(baseName);
m_diffCurrentAction->setParameter(baseName);
m_annotateCurrentAction->setParameter(baseName);
m_filelogCurrentAction->setParameter(baseName);
if (m_projectExplorer && m_projectExplorer->currentProject()) {
m_diffProjectAction->setEnabled(true);
m_diffProjectAction->setText(tr("Diff Project %1").arg(m_projectExplorer->currentProject()->name()));
m_diffProjectAction->setParameter(m_projectExplorer->currentProject()->name());
m_submitAction->setEnabled(true);
} else {
m_diffProjectAction->setEnabled(false);
m_diffProjectAction->setText(tr("Diff Current Project/Solution"));
m_diffProjectAction->setParameter(QString());
m_submitAction->setEnabled(false);
}
m_diffAllAction->setEnabled(true);

View File

@@ -51,6 +51,9 @@ QT_END_NAMESPACE
namespace Core {
class IEditorFactory;
namespace Utils {
class ParameterAction;
}
}
namespace Perforce {
@@ -170,21 +173,21 @@ private:
SettingsPage *m_settingsPage;
QList<Core::IEditorFactory*> m_editorFactories;
QAction *m_editAction;
QAction *m_addAction;
QAction *m_deleteAction;
Core::Utils::ParameterAction *m_editAction;
Core::Utils::ParameterAction *m_addAction;
Core::Utils::ParameterAction *m_deleteAction;
QAction *m_openedAction;
QAction *m_revertAction;
QAction *m_diffCurrentAction;
QAction *m_diffProjectAction;
Core::Utils::ParameterAction *m_revertAction;
Core::Utils::ParameterAction *m_diffCurrentAction;
Core::Utils::ParameterAction *m_diffProjectAction;
QAction *m_diffAllAction;
QAction *m_resolveAction;
QAction *m_submitAction;
QAction *m_pendingAction;
QAction *m_describeAction;
QAction *m_annotateCurrentAction;
Core::Utils::ParameterAction *m_annotateCurrentAction;
QAction *m_annotateAction;
QAction *m_filelogCurrentAction;
Core::Utils::ParameterAction *m_filelogCurrentAction;
QAction *m_filelogAction;
QAction *m_submitCurrentLogAction;
bool m_submitActionTriggered;

View File

@@ -79,6 +79,7 @@
#include <coreplugin/vcsmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
#include <QtCore/QtPlugin>
#include <QtCore/QDateTime>
@@ -438,7 +439,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
this, SLOT(updateRecentProjectMenu()));
// unload action
m_unloadAction = new QAction(tr("Close Project"), this);
m_unloadAction = new Core::Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_unloadAction->text());
@@ -1273,12 +1274,11 @@ void ProjectExplorerPlugin::updateActions()
if (debug)
qDebug()<<"BuildManager::isBuilding()"<<building;
m_unloadAction->setEnabled(m_currentProject != 0);
if (m_currentProject == 0) {
m_unloadAction->setText(tr("Close Project"));
m_unloadAction->setParameter(QString());
m_buildProjectOnlyMenu->setTitle(tr("Current Project"));
} else {
m_unloadAction->setText(tr("Close Project \"%1\"").arg(m_currentProject->name()));
m_unloadAction->setParameter(m_currentProject->name());
m_buildProjectOnlyMenu->setTitle(tr("Project \"%1\"").arg(m_currentProject->name()));
}

View File

@@ -54,6 +54,9 @@ class IFileFactory;
namespace Internal {
class WelcomeMode;
}
namespace Utils {
class ParameterAction;
}
}
namespace ProjectExplorer {
@@ -225,7 +228,7 @@ private:
#if 0
QAction *m_loadAction;
#endif
QAction *m_unloadAction;
Core::Utils::ParameterAction *m_unloadAction;
QAction *m_clearSession;
QAction *m_buildProjectOnlyAction;
QAction *m_buildAction;

View File

@@ -11,9 +11,6 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
@@ -43,22 +40,22 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>

View File

@@ -31,7 +31,7 @@ HEADERS = qt4projectmanagerplugin.h \
deployhelper.h \
embeddedpropertiespage.h \
qt4runconfiguration.h \
speinfo.h \
qtmodulesinfo.h \
qt4projectconfigwidget.h \
qt4buildenvironmentwidget.h \
projectloadwizard.h \
@@ -64,7 +64,7 @@ SOURCES = qt4projectmanagerplugin.cpp \
deployhelper.cpp \
embeddedpropertiespage.cpp \
qt4runconfiguration.cpp \
speinfo.cpp \
qtmodulesinfo.cpp \
qt4projectconfigwidget.cpp \
qt4buildenvironmentwidget.cpp \
projectloadwizard.cpp \

View File

@@ -0,0 +1,160 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#include "qtmodulesinfo.h"
#include "qglobal.h"
#include <QtCore/QtDebug>
#include <QtCore/QString>
#include <QtCore/QHash>
#include <QtCore/QCoreApplication>
using namespace Qt4ProjectManager::Internal;
struct item
{
const char * const config;
const QString name;
const QString description;
bool isDefault;
};
typedef QVector<const item*> itemVectorType;
typedef QHash<QString, const item*> itemHashType;
const itemVectorType itemVector()
{
static const struct item items[] = {
{"core",
QCoreApplication::translate("QtModulesInfo", "QtCore Module"),
QCoreApplication::translate("QtModulesInfo", "Core non-GUI classes used by other modules"),
true},
{"gui",
QCoreApplication::translate("QtModulesInfo", "QtGui Module"),
QCoreApplication::translate("QtModulesInfo", "Graphical user interface components"),
true},
{"network",
QCoreApplication::translate("QtModulesInfo", "QtNetwork Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for network programming"),
false},
{"opengl",
QCoreApplication::translate("QtModulesInfo", "QtOpenGL Module"),
QCoreApplication::translate("QtModulesInfo", "OpenGL support classes"),
false},
{"sql",
QCoreApplication::translate("QtModulesInfo", "QtSql Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for database integration using SQL"),
false},
{"script",
QCoreApplication::translate("QtModulesInfo", "QtScript Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for evaluating Qt Scripts"),
false},
{"svg",
QCoreApplication::translate("QtModulesInfo", "QtSvg Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for displaying the contents of SVG files"),
false},
{"webkit",
QCoreApplication::translate("QtModulesInfo", "QtWebKit Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for displaying and editing Web content"),
false},
{"xml",
QCoreApplication::translate("QtModulesInfo", "QtXml Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for handling XML"),
false},
{"xmlpatterns",
QCoreApplication::translate("QtModulesInfo", "QtXmlPatterns Module"),
QCoreApplication::translate("QtModulesInfo", "An XQuery/XPath engine for XML and custom data models"),
false},
{"phonon",
QCoreApplication::translate("QtModulesInfo", "Phonon Module"),
QCoreApplication::translate("QtModulesInfo", "Multimedia framework classes"),
false},
{"qt3support",
QCoreApplication::translate("QtModulesInfo", "Qt3Support Module"),
QCoreApplication::translate("QtModulesInfo", "Classes that ease porting from Qt 3 to Qt 4"),
false},
{"testlib",
QCoreApplication::translate("QtModulesInfo", "QtTest Module"),
QCoreApplication::translate("QtModulesInfo", "Tool classes for unit testing"),
false},
{"dbus",
QCoreApplication::translate("QtModulesInfo", "QtDBus Module"),
QCoreApplication::translate("QtModulesInfo", "Classes for Inter-Process Communication using the D-Bus",
false)}
};
const uint itemsCount = sizeof items / sizeof items[0];
itemVectorType result;
result.reserve(itemsCount);
for (int i = 0; i < itemsCount; i++)
result.append(items + i);
return result;
}
Q_GLOBAL_STATIC_WITH_INITIALIZER(itemVectorType, staticItemVector, {
*x = itemVector();
});
Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, staticModulesList, {
const itemVectorType * const itemVector = staticItemVector();
for (int i = 0; i < itemVector->count(); i++)
x->append(QString::fromLatin1(itemVector->at(i)->config));
});
Q_GLOBAL_STATIC_WITH_INITIALIZER(itemHashType, staticItemHash, {
const itemVectorType * const itemVector = staticItemVector();
for (int i = 0; i < itemVector->count(); i++)
x->insert(QString::fromLatin1(itemVector->at(i)->config), itemVector->at(i));
});
QStringList QtModulesInfo::modules()
{
return *staticModulesList();
}
static inline const item *itemForModule(const QString &module)
{
return staticItemHash()->value(module.toLatin1().data());
}
QString QtModulesInfo::moduleName(const QString &module)
{
const item * const i = itemForModule(module);
return i?i->name:QString();
}
QString QtModulesInfo::moduleDescription(const QString &module)
{
const item * const i = itemForModule(module);
return i?i->description:QString();
}
bool QtModulesInfo::moduleIsDefault(const QString &module)
{
const item * const i = itemForModule(module);
return i?i->isDefault:false;
}

View File

@@ -0,0 +1,49 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef QTMODULESINFO_H
#define QTMODULESINFO_H
#include <QtCore/QStringList>
namespace Qt4ProjectManager {
namespace Internal {
class QtModulesInfo
{
public:
static QStringList modules();
static QString moduleName(const QString &module);
static QString moduleDescription(const QString &module);
static bool moduleIsDefault(const QString &module);
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QTMODULESINFO_H

View File

@@ -1,803 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#include "speinfo.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QVariant>
using namespace Qt4ProjectManager::Internal;
bool SPEInfo::m_listsInitialized = false;
QList<SPEInfoItem*> SPEInfo::m_configurationList;
QList<SPEInfoItem*> SPEInfo::m_platformList;
QList<SPEInfoItem*> SPEInfo::m_variableList;
QList<SPEInfoItem*> SPEInfo::m_qtmoduleList;
QList<SPEInfoItem*> SPEInfo::m_templateList;
QList<SPEInfoItem*> SPEInfo::m_operatorList;
QHash<QPair<SPEInfoItem::InfoKind, QString> ,SPEInfoItem*> SPEInfo::m_itemHash;
const QString SPEInfoItem::keyType("valuetype");
const QString SPEInfoItem::valueFile("file");
const QString SPEInfoItem::valuePath("path");
const QString SPEInfoItem::keyIncludedByDefault("includedbydefault");
const QString SPEInfoItem::keyImageFileName("imagefilename");
// Configurations (Debug, Release, ...)
class InfoItemConfigurationCross : public SPEInfoItem
{
public:
InfoItemConfigurationCross(): SPEInfoItem("", Configuration) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Debug and Release"); }
};
class InfoItemConfigurationDebug : public SPEInfoItem
{
public:
InfoItemConfigurationDebug(): SPEInfoItem("debug", Configuration) {}
QString name() const {return QCoreApplication::translate("SimpleProEditor", "Debug specific");}
};
class InfoItemConfigurationRelease : public SPEInfoItem
{
public:
InfoItemConfigurationRelease(): SPEInfoItem("release", Configuration) {}
QString name() const {return QCoreApplication::translate("SimpleProEditor", "Release specific");}
};
// Platforms (Windows, Mac, ...)
class InfoItemPlatformCross : public SPEInfoItem
{
public:
InfoItemPlatformCross(): SPEInfoItem("", Platform) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "All platforms"); }
};
class InfoItemPlatformWindows : public SPEInfoItem
{
public:
InfoItemPlatformWindows(): SPEInfoItem("win32", Platform) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "MS Windows specific"); }
};
class InfoItemPlatformUnix : public SPEInfoItem
{
public:
InfoItemPlatformUnix(): SPEInfoItem("unix", Platform) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Linux/Unix specific"); }
};
class InfoItemPlatformOSX : public SPEInfoItem
{
public:
InfoItemPlatformOSX(): SPEInfoItem("macx", Platform) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Mac OSX specific"); }
};
// Variables (Target options, Libraries, Defines, ...)
class InfoItemVariableTargetOptions : public SPEInfoItem
{
public:
InfoItemVariableTargetOptions(): SPEInfoItem("TEMPLATE", Variable)
{
m_data.insert(keyImageFileName, ":/variableimages/images/target.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Target Options");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Type and name of the target.");
}
};
class InfoItemVariableDefines : public SPEInfoItem
{
public:
InfoItemVariableDefines(): SPEInfoItem("DEFINES", Variable)
{
m_data.insert(keyImageFileName, ":/variableimages/images/defines.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Preprocessor Definitions");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Setting of the preprocessor definitions.");
}
};
class InfoItemVariableIncludePath : public SPEInfoItem
{
public:
InfoItemVariableIncludePath(): SPEInfoItem("INCLUDEPATH", Variable)
{
m_data.insert(keyType, valuePath);
m_data.insert(keyImageFileName, ":/variableimages/images/includes.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Include path"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Setting of the pathes where the header files are located.");
}
};
class InfoItemVariableLibs : public SPEInfoItem
{
public:
InfoItemVariableLibs(): SPEInfoItem("LIBS", Variable)
{
m_data.insert(keyImageFileName, ":/variableimages/images/libs.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Libraries");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Defining the libraries to link the target against and the pathes where these are located.");
}
};
class InfoItemVariableSources : public SPEInfoItem
{
public:
InfoItemVariableSources(): SPEInfoItem("SOURCES", Variable)
{
m_data.insert(keyType, valueFile);
m_data.insert(keyImageFileName, ":/variableimages/images/sources.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Source Files");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"");
}
};
class InfoItemVariableHeaders : public SPEInfoItem
{
public:
InfoItemVariableHeaders(): SPEInfoItem("HEADERS", Variable)
{
m_data.insert(keyType, valueFile);
m_data.insert(keyImageFileName, ":/variableimages/images/headers.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Header Files");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"");
}
};
class InfoItemVariableForms : public SPEInfoItem
{
public:
InfoItemVariableForms(): SPEInfoItem("FORMS", Variable)
{
m_data.insert(keyType, valueFile);
m_data.insert(keyImageFileName, ":/variableimages/images/forms.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Forms");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"");
}
};
class InfoItemVariableQtModules : public SPEInfoItem
{
public:
InfoItemVariableQtModules(): SPEInfoItem("QT", Variable)
{
m_data.insert(keyImageFileName, ":/variableimages/images/qtmodules.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Qt Modules");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Setting up which of the Qt modules will be used in the target application.");
}
};
class InfoItemVariableResources : public SPEInfoItem
{
public:
InfoItemVariableResources(): SPEInfoItem("RESOURCES", Variable)
{
m_data.insert(keyType, valueFile);
m_data.insert(keyImageFileName, ":/variableimages/images/resources.png");
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Resource files");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"");
}
};
class InfoItemVariableTarget : public SPEInfoItem
{
public:
InfoItemVariableTarget(): SPEInfoItem("TARGET", Variable) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Target name");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"The name of the resulting target.");
}
};
class InfoItemVariableConfig : public SPEInfoItem
{
public:
InfoItemVariableConfig(): SPEInfoItem("CONFIG", Variable) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Configuration");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Configuration.");
}
};
class InfoItemVariableDestdir : public SPEInfoItem
{
public:
InfoItemVariableDestdir(): SPEInfoItem("DESTDIR", Variable) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Destination directory");}
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Where the resulting target will be created.");
}
};
// Qt modules
class InfoItemModulesCore : public SPEInfoItem
{
public:
InfoItemModulesCore(): SPEInfoItem("core", QtModule)
{
m_data.insert(keyIncludedByDefault, true);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtCore Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Core non-GUI classes used by other modules");
}
};
class InfoItemModulesGui : public SPEInfoItem
{
public:
InfoItemModulesGui(): SPEInfoItem("gui", QtModule)
{
m_data.insert(keyIncludedByDefault, true);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtGui Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Graphical user interface components");
}
};
class InfoItemModulesNetwork : public SPEInfoItem
{
public:
InfoItemModulesNetwork(): SPEInfoItem("network", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtNetwork Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for network programming");
}
};
class InfoItemModulesOpenGL : public SPEInfoItem
{
public:
InfoItemModulesOpenGL(): SPEInfoItem("opengl", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtOpenGL Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"OpenGL support classes");
}
};
class InfoItemModulesSql : public SPEInfoItem
{
public:
InfoItemModulesSql(): SPEInfoItem("sql", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSql Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for database integration using SQL");
}
};
class InfoItemModulesScript : public SPEInfoItem
{
public:
InfoItemModulesScript(): SPEInfoItem("script", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtScript Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for evaluating Qt Scripts");
}
};
class InfoItemModulesSvg : public SPEInfoItem
{
public:
InfoItemModulesSvg(): SPEInfoItem("svg", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSvg Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for displaying the contents of SVG files");
}
};
class InfoItemModulesWebKit : public SPEInfoItem
{
public:
InfoItemModulesWebKit(): SPEInfoItem("webkit", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtWebKit Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for displaying and editing Web content");
}
};
class InfoItemModulesXml : public SPEInfoItem
{
public:
InfoItemModulesXml(): SPEInfoItem("xml", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXml Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for handling XML");
}
};
class InfoItemModulesXmlPatterns : public SPEInfoItem
{
public:
InfoItemModulesXmlPatterns(): SPEInfoItem("xmlpatterns", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXmlPatterns Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"An XQuery/XPath engine for XML and custom data models");
}
};
class InfoItemModulesPhonon : public SPEInfoItem
{
public:
InfoItemModulesPhonon(): SPEInfoItem("phonon", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Phonon Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Multimedia framework classes");
}
};
class InfoItemModulesQt3Support : public SPEInfoItem
{
public:
InfoItemModulesQt3Support(): SPEInfoItem("qt3support", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Qt3Support Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes that ease porting from Qt 3 to Qt 4");
}
};
class InfoItemModulesTest : public SPEInfoItem
{
public:
InfoItemModulesTest(): SPEInfoItem("testlib", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtTest Module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Tool classes for unit testing");
}
};
class InfoItemModulesDBus : public SPEInfoItem
{
public:
InfoItemModulesDBus(): SPEInfoItem("dbus", QtModule)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtDBus module"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Classes for Inter-Process Communication using the D-Bus");
}
};
// Target templates
class InfoItemTemplatesApp : public SPEInfoItem
{
public:
InfoItemTemplatesApp(): SPEInfoItem("app", Template)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Application"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Create a standalone application");
}
};
class InfoItemTemplatesDynamicLib : public SPEInfoItem
{
public:
InfoItemTemplatesDynamicLib(): SPEInfoItem("lib", Template)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Dynamic Library"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Create a dynamic library for usage in other applications");
}
};
class InfoItemTemplatesStaticLib : public SPEInfoItem
{
public:
InfoItemTemplatesStaticLib(): SPEInfoItem("staticlib", Template)
{
m_data.insert(keyIncludedByDefault, false);
}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Static Library"); }
QString description() const
{
return QCoreApplication::translate("SimpleProEditor",
"Create a static library for usage in other applications");
}
};
// Variable operators
class InfoItemOperatorsAdd : public SPEInfoItem
{
public:
InfoItemOperatorsAdd(): SPEInfoItem("+=", Operator) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Add Operator"); }
};
class InfoItemOperatorsRemove : public SPEInfoItem
{
public:
InfoItemOperatorsRemove(): SPEInfoItem("-=", Operator) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Remove Operator"); }
};
class InfoItemOperatorsReplace : public SPEInfoItem
{
public:
InfoItemOperatorsReplace(): SPEInfoItem("~=", Operator) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Replace Operator"); }
};
class InfoItemOperatorsSet : public SPEInfoItem
{
public:
InfoItemOperatorsSet(): SPEInfoItem("=", Operator) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Set Operator"); }
};
class InfoItemOperatorsUniqueAdd : public SPEInfoItem
{
public:
InfoItemOperatorsUniqueAdd(): SPEInfoItem("*=", Operator) {}
QString name() const { return QCoreApplication::translate("SimpleProEditor", "Unique Add Operator"); }
};
SPEInfoItem::SPEInfoItem(const QString &id, InfoKind kind)
: m_id(id)
, m_infoKind(kind)
, m_parentItem(0)
{
}
QString SPEInfoItem::name() const
{
return "";
}
QString SPEInfoItem::description() const
{
return "";
}
QVariant SPEInfoItem::data(const QString &key) const
{
return m_data.value(key);
}
const SPEInfoItem *SPEInfoItem::parentItem() const
{
return m_parentItem;
}
void SPEInfoItem::setParentItem(const SPEInfoItem *parentItem)
{
m_parentItem = parentItem;
}
bool SPEInfoItem::isAncestorOf(const SPEInfoItem *successor) const
{
const SPEInfoItem *ancestorCursor = successor;
while ((ancestorCursor = ancestorCursor->parentItem()) != NULL)
if (ancestorCursor == this)
return true;
return false;
}
QString SPEInfoItem::id() const
{
return m_id;
}
SPEInfoItem::InfoKind SPEInfoItem::infoKind() const
{
return m_infoKind;
}
SPEInfo::~SPEInfo()
{
deleteLists();
}
const QList<SPEInfoItem*> *SPEInfo::list(SPEInfoItem::InfoKind kind)
{
if (!m_listsInitialized)
initializeLists();
return
kind == SPEInfoItem::Configuration?&m_configurationList
:kind == SPEInfoItem::Platform?&m_platformList
:kind == SPEInfoItem::Variable?&m_variableList
:kind == SPEInfoItem::QtModule?&m_qtmoduleList
:kind == SPEInfoItem::Template?&m_templateList
:/*kind == SPEInfoItem::Operator?*/&m_operatorList
;
}
const SPEInfoItem *SPEInfo::defaultInfoOfKind(SPEInfoItem::InfoKind kind)
{
return list(kind)->at(0);
}
void SPEInfo::addListToHash(const QList<SPEInfoItem*> &list)
{
foreach (SPEInfoItem *item, list)
m_itemHash.insert(qMakePair(item->infoKind(), item->id()), item);
}
void SPEInfo::initializeLists()
{
InfoItemConfigurationCross *infoItemConfigurationCross = new InfoItemConfigurationCross;
InfoItemConfigurationDebug *infoItemConfigurationDebug = new InfoItemConfigurationDebug;
infoItemConfigurationDebug->setParentItem(infoItemConfigurationCross);
InfoItemConfigurationRelease *infoItemConfigurationRelease = new InfoItemConfigurationRelease;
infoItemConfigurationRelease->setParentItem(infoItemConfigurationCross);
m_configurationList
<< infoItemConfigurationCross
<< infoItemConfigurationDebug
<< infoItemConfigurationRelease;
addListToHash(m_configurationList);
InfoItemPlatformCross *infoItemPlatformCross = new InfoItemPlatformCross;
InfoItemPlatformWindows *infoItemPlatformWindows = new InfoItemPlatformWindows;
infoItemPlatformWindows->setParentItem(infoItemPlatformCross);
InfoItemPlatformUnix *infoItemPlatformUnix = new InfoItemPlatformUnix;
infoItemPlatformUnix->setParentItem(infoItemPlatformCross);
InfoItemPlatformOSX *infoItemPlatformOSX = new InfoItemPlatformOSX;
infoItemPlatformOSX->setParentItem(infoItemPlatformUnix);
m_platformList
<< infoItemPlatformCross
<< infoItemPlatformWindows
<< infoItemPlatformUnix
<< infoItemPlatformOSX;
addListToHash(m_platformList);
m_variableList
<< new InfoItemVariableTargetOptions
<< new InfoItemVariableDefines
<< new InfoItemVariableLibs
<< new InfoItemVariableIncludePath
<< new InfoItemVariableSources
<< new InfoItemVariableHeaders
<< new InfoItemVariableForms
<< new InfoItemVariableQtModules
<< new InfoItemVariableResources
<< new InfoItemVariableTarget
<< new InfoItemVariableConfig
<< new InfoItemVariableDestdir;
addListToHash(m_variableList);
m_qtmoduleList
<< new InfoItemModulesCore
<< new InfoItemModulesGui
<< new InfoItemModulesNetwork
<< new InfoItemModulesOpenGL
<< new InfoItemModulesScript
<< new InfoItemModulesSql
<< new InfoItemModulesSvg
<< new InfoItemModulesWebKit
<< new InfoItemModulesXml
<< new InfoItemModulesXmlPatterns
<< new InfoItemModulesPhonon
<< new InfoItemModulesQt3Support
<< new InfoItemModulesTest
<< new InfoItemModulesDBus;
addListToHash(m_qtmoduleList);
m_templateList
<< new InfoItemTemplatesApp
<< new InfoItemTemplatesDynamicLib
<< new InfoItemTemplatesStaticLib;
addListToHash(m_templateList);
m_operatorList
<< new InfoItemOperatorsAdd
<< new InfoItemOperatorsRemove
<< new InfoItemOperatorsReplace
<< new InfoItemOperatorsSet
<< new InfoItemOperatorsUniqueAdd;
addListToHash(m_operatorList);
m_listsInitialized = true;
}
void SPEInfo::deleteLists()
{
m_itemHash.clear();
static QList<SPEInfoItem*> *lists[] = {
&m_configurationList,
&m_platformList,
&m_variableList,
&m_qtmoduleList,
&m_templateList,
&m_operatorList
};
for (size_t i = 0; i < sizeof(lists)/sizeof(lists[0]); i++) {
qDeleteAll(*lists[i]);
lists[i]->clear();
}
m_listsInitialized = false;
}
const SPEInfoItem *SPEInfo::infoOfKindForId(SPEInfoItem::InfoKind kind,
const QString &id, const SPEInfoItem *defaultInfoItem)
{
QPair<SPEInfoItem::InfoKind, QString > keyPair = qMakePair(kind, id);
return m_itemHash.contains(keyPair)?m_itemHash.value(keyPair):defaultInfoItem;
}
const SPEInfoItem *SPEInfo::platformInfoForId(const QString &id)
{
return infoOfKindForId(SPEInfoItem::Platform, id, SPEInfo::defaultInfoOfKind(SPEInfoItem::Platform));
}
const SPEInfoItem *SPEInfo::configurationInfoForId(const QString &id)
{
return infoOfKindForId(SPEInfoItem::Configuration, id, SPEInfo::defaultInfoOfKind(SPEInfoItem::Configuration));
}
static SPEInfo speInfoInstance; // it's destructor will call deleteLists()

View File

@@ -1,113 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef SIMPLEPROEDITORINFO_H
#define SIMPLEPROEDITORINFO_H
#include <QtCore/QHash>
#include <QtCore/QVariant>
#include <QtGui/QPixmap>
namespace Qt4ProjectManager {
namespace Internal {
class SPEInfoItem
{
public:
enum InfoKind {
Configuration,
Platform,
Variable,
QtModule,
Template,
Operator
};
SPEInfoItem(const QString &id, InfoKind kind);
virtual ~SPEInfoItem() {}
QString id() const;
InfoKind infoKind() const;
virtual QString name() const;
virtual QString description() const;
QVariant data(const QString &key) const;
const SPEInfoItem *parentItem() const;
void setParentItem(const SPEInfoItem *parentItem);
bool isAncestorOf(const SPEInfoItem *ancestor) const;
static const QString keyType;
static const QString valueFile;
static const QString valuePath;
static const QString keyIncludedByDefault;
static const QString keyImageFileName;
protected:
QHash<QString, QVariant> m_data;
private:
QString m_id;
InfoKind m_infoKind;
QPixmap m_image;
const class SPEInfoItem *m_parentItem;
};
class SPEInfo
{
public:
~SPEInfo();
static const QList<SPEInfoItem*> *list(SPEInfoItem::InfoKind kind);
static const SPEInfoItem *defaultInfoOfKind(SPEInfoItem::InfoKind kind);
static const SPEInfoItem *platformInfoForId(const QString &id);
static const SPEInfoItem *configurationInfoForId(const QString &id);
static const SPEInfoItem *infoOfKindForId(SPEInfoItem::InfoKind kind,
const QString &id, const SPEInfoItem *defaultInfoItem = NULL);
private:
static void addListToHash(const QList<SPEInfoItem*> &list);
static void initializeLists();
static void deleteLists();
static QList<SPEInfoItem*> m_configurationList;
static QList<SPEInfoItem*> m_platformList;
static QList<SPEInfoItem*> m_variableList;
static QList<SPEInfoItem*> m_qtmoduleList;
static QList<SPEInfoItem*> m_templateList;
static QList<SPEInfoItem*> m_operatorList;
static QHash<QPair<SPEInfoItem::InfoKind, QString> ,SPEInfoItem* > m_itemHash;
static bool m_listsInitialized;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // SIMPLEPROEDITORINFO_H

View File

@@ -29,11 +29,12 @@
#include "modulespage.h"
#include "speinfo.h"
#include "qtmodulesinfo.h"
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtCore/QVariant>
#include <QtGui/QCheckBox>
#include <QtGui/QLabel>
@@ -58,19 +59,19 @@ ModulesPage::ModulesPage(QWidget *parent)
QGridLayout *layout = new QGridLayout;
const QList<SPEInfoItem*> infoItemsList = *SPEInfo::list(SPEInfoItem::QtModule);
int itemId = 0;
int rowsCount = (infoItemsList.count() + 1) / 2;
foreach (const SPEInfoItem *infoItem, infoItemsList) {
QCheckBox *moduleCheckBox = new QCheckBox(infoItem->name());
moduleCheckBox->setToolTip(infoItem->description());
moduleCheckBox->setWhatsThis(infoItem->description());
registerField(infoItem->id(), moduleCheckBox);
int row = itemId % rowsCount;
int column = itemId / rowsCount;
const QStringList &modulesList = QtModulesInfo::modules();
int moduleId = 0;
int rowsCount = (modulesList.count() + 1) / 2;
foreach (const QString &module, modulesList) {
QCheckBox *moduleCheckBox = new QCheckBox(QtModulesInfo::moduleName(module));
moduleCheckBox->setToolTip(QtModulesInfo::moduleDescription(module));
moduleCheckBox->setWhatsThis(QtModulesInfo::moduleDescription(module));
registerField(module, moduleCheckBox);
int row = moduleId % rowsCount;
int column = moduleId / rowsCount;
layout->addWidget(moduleCheckBox, row, column);
m_moduleCheckBoxMap[infoItem->id()] = moduleCheckBox;
itemId++;
m_moduleCheckBoxMap[module] = moduleCheckBox;
moduleId++;
}
vlayout->addLayout(layout);
@@ -80,10 +81,10 @@ ModulesPage::ModulesPage(QWidget *parent)
// Return the key that goes into the Qt config line for a module
QString ModulesPage::idOfModule(const QString &module)
{
const QList<SPEInfoItem*> infoItemsList = *SPEInfo::list(SPEInfoItem::QtModule);
foreach (const SPEInfoItem *infoItem, infoItemsList)
if (infoItem->name().startsWith(module))
return infoItem->id();
const QStringList &moduleIdList = QtModulesInfo::modules();
foreach (const QString &id, moduleIdList)
if (QtModulesInfo::moduleName(id).startsWith(module))
return id;
return QString();
}
@@ -114,13 +115,10 @@ void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const
QString ModulesPage::modules(bool selected) const
{
QStringList modules;
const QList<SPEInfoItem*> infoItemsList = *SPEInfo::list(SPEInfoItem::QtModule);
foreach (const SPEInfoItem *infoItem, infoItemsList) {
if (selected != infoItem->data(SPEInfoItem::keyIncludedByDefault).toBool()
&& selected == field(infoItem->id()).toBool())
modules << infoItem->id();
foreach (const QString &module, QtModulesInfo::modules()) {
if (selected != QtModulesInfo::moduleIsDefault(module)
&& selected == field(module).toBool())
modules << module;
}
return modules.join(QString(QLatin1Char(' ')));
}

View File

@@ -13,59 +13,68 @@
<property name="windowTitle">
<string>Configure Filters</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="filterList">
<property name="font">
<font/>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Configure Filters</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QListWidget" name="filterList">
<property name="font">
<font/>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout">
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">

View File

@@ -41,6 +41,7 @@
#include <vcsbase/vcsbaseeditor.h>
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <utils/synchronousprocess.h>
#include <utils/parameteraction.h>
#include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h>
@@ -320,7 +321,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
globalcontext << core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
Core::Command *command;
m_addAction = new QAction(tr("Add"), this);
m_addAction = new Core::Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_addAction, SubversionPlugin::ADD,
globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -330,14 +331,14 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
subversionMenu->addAction(command);
m_deleteAction = new QAction(tr("Delete"), this);
m_deleteAction = new Core::Utils::ParameterAction(tr("Delete"), tr("Delete \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_deleteAction, SubversionPlugin::DELETE_FILE,
globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
subversionMenu->addAction(command);
m_revertAction = new QAction(tr("Revert"), this);
m_revertAction = new Core::Utils::ParameterAction(tr("Revert"), tr("Revert \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_revertAction, SubversionPlugin::REVERT,
globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -352,7 +353,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffProject()));
subversionMenu->addAction(command);
m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
m_diffCurrentAction = new Core::Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_diffCurrentAction,
SubversionPlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -370,7 +371,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
connect(m_commitAllAction, SIGNAL(triggered()), this, SLOT(startCommitAll()));
subversionMenu->addAction(command);
m_commitCurrentAction = new QAction(tr("Commit Current File"), this);
m_commitCurrentAction = new Core::Utils::ParameterAction(tr("Commit Current File"), tr("Commit \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_commitCurrentAction,
SubversionPlugin::COMMIT_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -382,7 +383,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
subversionMenu->addAction(createSeparator(this, ami, SubversionPlugin::SEPARATOR2, globalcontext));
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
m_filelogCurrentAction = new Core::Utils::ParameterAction(tr("Filelog Current File"), tr("Filelog \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_filelogCurrentAction,
SubversionPlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -390,7 +391,7 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
SLOT(filelogCurrentFile()));
subversionMenu->addAction(command);
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
m_annotateCurrentAction = new Core::Utils::ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this);
command = ami->registerAction(m_annotateCurrentAction,
SubversionPlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
@@ -549,32 +550,21 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri
void SubversionPlugin::updateActions()
{
const QString fileName = currentFileName();
const bool hasFile = !fileName.isEmpty();
m_addAction->setEnabled(hasFile);
m_deleteAction->setEnabled(hasFile);
m_revertAction->setEnabled(hasFile);
m_diffProjectAction->setEnabled(true);
m_diffCurrentAction->setEnabled(hasFile);
m_commitAllAction->setEnabled(true);
m_commitCurrentAction->setEnabled(hasFile);
m_filelogCurrentAction->setEnabled(hasFile);
m_annotateCurrentAction->setEnabled(hasFile);
m_statusAction->setEnabled(true);
m_describeAction->setEnabled(true);
QString baseName;
if (hasFile)
baseName = QFileInfo(fileName).fileName();
const QString fileName = currentFileName();
const QString baseName = fileName.isEmpty() ? fileName : QFileInfo(fileName).fileName();
m_addAction->setText(tr("Add %1").arg(baseName));
m_deleteAction->setText(tr("Delete %1").arg(baseName));
m_revertAction->setText(tr("Revert %1").arg(baseName));
m_diffCurrentAction->setText(tr("Diff %1").arg(baseName));
m_commitCurrentAction->setText(tr("Commit %1").arg(baseName));
m_filelogCurrentAction->setText(tr("Filelog %1").arg(baseName));
m_annotateCurrentAction->setText(tr("Annotate %1").arg(baseName));
m_addAction->setParameter(baseName);
m_deleteAction->setParameter(baseName);
m_revertAction->setParameter(baseName);
m_diffCurrentAction->setParameter(baseName);
m_commitCurrentAction->setParameter(baseName);
m_filelogCurrentAction->setParameter(baseName);
m_annotateCurrentAction->setParameter(baseName);
}
void SubversionPlugin::addCurrentFile()

View File

@@ -52,6 +52,9 @@ QT_END_NAMESPACE
namespace Core {
class IEditorFactory;
class IVersionControl;
namespace Utils {
class ParameterAction;
}
}
namespace ProjectExplorer {
@@ -151,15 +154,15 @@ private:
SubversionOutputWindow *m_subversionOutputWindow;
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
QAction *m_addAction;
QAction *m_deleteAction;
QAction *m_revertAction;
Core::Utils::ParameterAction *m_addAction;
Core::Utils::ParameterAction *m_deleteAction;
Core::Utils::ParameterAction *m_revertAction;
QAction *m_diffProjectAction;
QAction *m_diffCurrentAction;
Core::Utils::ParameterAction *m_diffCurrentAction;
QAction *m_commitAllAction;
QAction *m_commitCurrentAction;
QAction *m_filelogCurrentAction;
QAction *m_annotateCurrentAction;
Core::Utils::ParameterAction *m_commitCurrentAction;
Core::Utils::ParameterAction *m_filelogCurrentAction;
Core::Utils::ParameterAction *m_annotateCurrentAction;
QAction *m_statusAction;
QAction *m_updateProjectAction;
QAction *m_describeAction;

View File

@@ -135,11 +135,7 @@ bool BaseTextDocument::isReadOnly() const
return true;
if (m_fileName.isEmpty()) //have no corresponding file, so editing is ok
return false;
const QFileInfo fi(m_fileName);
return m_fileIsReadOnly;
}
bool BaseTextDocument::isModified() const

View File

@@ -12,120 +12,125 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="promptForSubmitCheckBox">
<property name="text">
<string>Prompt to submit</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="lineWrapCheckBox">
<property name="text">
<string>Wrap submit message at:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="lineWrapSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>40</number>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>72</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="submitMessageCheckScriptLabel">
<property name="toolTip">
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
</property>
<property name="text">
<string>Submit message check script:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Core::Utils::PathChooser" name="submitMessageCheckScriptChooser" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
<string>A file listing user names and email addresses in a 4-column mailmap format:
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Common</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="promptForSubmitCheckBox">
<property name="text">
<string>Prompt to submit</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="lineWrapCheckBox">
<property name="text">
<string>Wrap submit message at:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="lineWrapSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>40</number>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>72</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="submitMessageCheckScriptLabel">
<property name="toolTip">
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
</property>
<property name="text">
<string>Submit message check script:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Core::Utils::PathChooser" name="submitMessageCheckScriptChooser" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
<string>A file listing user names and email addresses in a 4-column mailmap format:
name &lt;email&gt; alias &lt;email&gt;</string>
</property>
<property name="text">
<string>User/alias configuration file:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Core::Utils::PathChooser" name="nickNameMailMapChooser" native="true"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="nickNameFieldsFileLabel">
<property name="toolTip">
<string>A simple file containing lines with field names like &quot;Reviewed-By:&quot; which will be added below the submit editor.</string>
</property>
<property name="text">
<string>User fields configuration file:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Core::Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</property>
<property name="text">
<string>User/alias configuration file:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Core::Utils::PathChooser" name="nickNameMailMapChooser" native="true"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="nickNameFieldsFileLabel">
<property name="toolTip">
<string>A simple file containing lines with field names like &quot;Reviewed-By:&quot; which will be added below the submit editor.</string>
</property>
<property name="text">
<string>User fields configuration file:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Core::Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">