summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <qtc-committer@nokia.com>2008-12-02 17:05:53 +0100
committerFriedemann Kleint <qtc-committer@nokia.com>2008-12-02 17:05:53 +0100
commit5d316a49195c02887673c06302c58d20c6b670b5 (patch)
treed6fbbbbf10add194e18beac5ea4288b940273a19 /src/plugins
parent5f01890ae5ae812470e878b5e7445410dd67d840 (diff)
downloadqt-creator-5d316a49195c02887673c06302c58d20c6b670b5.tar.gz
Fixes: Move icons into VCSBase, use buttons for submit
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/git/gitclient.cpp2
-rw-r--r--src/plugins/git/gitconstants.h4
-rw-r--r--src/plugins/git/gitplugin.cpp4
-rw-r--r--src/plugins/git/gitsubmiteditorwidget.cpp1
-rw-r--r--src/plugins/git/gitsubmitpanel.ui24
-rw-r--r--src/plugins/perforce/perforce.qrc2
-rw-r--r--src/plugins/perforce/perforceconstants.h4
-rw-r--r--src/plugins/perforce/perforceplugin.cpp4
-rw-r--r--src/plugins/subversion/images/diff.pngbin204 -> 0 bytes
-rw-r--r--src/plugins/subversion/images/submit.pngbin309 -> 0 bytes
-rw-r--r--src/plugins/subversion/subversion.qrc2
-rw-r--r--src/plugins/subversion/subversionconstants.h2
-rw-r--r--src/plugins/subversion/subversionplugin.cpp4
-rw-r--r--src/plugins/vcsbase/images/diff.png (renamed from src/plugins/perforce/images/diff.png)bin204 -> 204 bytes
-rw-r--r--src/plugins/vcsbase/images/submit.png (renamed from src/plugins/perforce/images/submit.png)bin309 -> 309 bytes
-rw-r--r--src/plugins/vcsbase/vcsbase.qrc4
-rw-r--r--src/plugins/vcsbase/vcsbaseplugin.cpp4
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp46
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.h8
19 files changed, 58 insertions, 57 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index f7bba28441..6b3eb20ad7 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -625,7 +625,7 @@ QString GitClient::readConfig(const QString &workingDirectory, const QStringList
QByteArray outputText;
if (synchronousGit(workingDirectory, arguments, &outputText))
- return outputText;
+ return QString::fromLocal8Bit(outputText);
return QString();
}
diff --git a/src/plugins/git/gitconstants.h b/src/plugins/git/gitconstants.h
index 935310f68e..9867624913 100644
--- a/src/plugins/git/gitconstants.h
+++ b/src/plugins/git/gitconstants.h
@@ -48,10 +48,6 @@ const char * const SUBMIT_CURRENT = "Nokia.Git.SubmitCurrentLog";
const char * const DIFF_SELECTED = "Nokia.Git.DiffSelectedFilesInLog";
const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.git.submit";
-// TODO: For the moment, trust p4 is loaded...
-const char * const ICON_SUBMIT = ":/trolltech.perforce/images/submit.png";
-const char * const ICON_DIFF = ":/trolltech.perforce/images/diff.png";
-
const char * const DIFF_FILE_INDICATOR = "--- ";
enum { debug = 0 };
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 6ee7bab39b..29bca45779 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -354,12 +354,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
// Submit editor
QList<int> submitContext;
submitContext.push_back(m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::C_GITSUBMITEDITOR)));
- m_submitCurrentAction = new QAction(QIcon(Constants::ICON_SUBMIT), tr("Commit"), this);
+ m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
// TODO
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
- m_diffSelectedFilesAction = new QAction(QIcon(Constants::ICON_DIFF), tr("Diff Selected Files"), this);
+ m_diffSelectedFilesAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff Selected Files"), this);
command = actionManager->registerAction(m_diffSelectedFilesAction, Constants::DIFF_SELECTED, submitContext);
m_undoAction = new QAction(tr("&Undo"), this);
diff --git a/src/plugins/git/gitsubmiteditorwidget.cpp b/src/plugins/git/gitsubmiteditorwidget.cpp
index 99400952f1..5d5cb0a2ef 100644
--- a/src/plugins/git/gitsubmiteditorwidget.cpp
+++ b/src/plugins/git/gitsubmiteditorwidget.cpp
@@ -48,7 +48,6 @@ GitSubmitEditorWidget::GitSubmitEditorWidget(QWidget *parent) :
void GitSubmitEditorWidget::setPanelInfo(const GitSubmitEditorPanelInfo &info)
{
m_gitSubmitPanelUi.repositoryLabel->setText(info.repository);
- m_gitSubmitPanelUi.descriptionLabel->setText(info.description);
m_gitSubmitPanelUi.branchLabel->setText(info.branch);
}
diff --git a/src/plugins/git/gitsubmitpanel.ui b/src/plugins/git/gitsubmitpanel.ui
index 8a42052a99..d408eeab11 100644
--- a/src/plugins/git/gitsubmitpanel.ui
+++ b/src/plugins/git/gitsubmitpanel.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>201</width>
- <height>210</height>
+ <height>189</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -17,6 +17,9 @@
<string>General Information</string>
</property>
<layout class="QFormLayout" name="infoFormLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="repositoryLabelLabel">
<property name="text">
@@ -32,30 +35,13 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLabel" name="descriptionLabelLabel">
- <property name="text">
- <string>Description:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="descriptionLabel">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>description</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
<widget class="QLabel" name="branchLabelLabel">
<property name="text">
<string>Branch:</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="1" column="1">
<widget class="QLabel" name="branchLabel">
<property name="text">
<string>branch</string>
diff --git a/src/plugins/perforce/perforce.qrc b/src/plugins/perforce/perforce.qrc
index de0db02a3d..3605faa03b 100644
--- a/src/plugins/perforce/perforce.qrc
+++ b/src/plugins/perforce/perforce.qrc
@@ -1,7 +1,5 @@
<RCC>
<qresource prefix="/trolltech.perforce" >
- <file>images/diff.png</file>
- <file>images/submit.png</file>
<file>Perforce.mimetypes.xml</file>
</qresource>
</RCC>
diff --git a/src/plugins/perforce/perforceconstants.h b/src/plugins/perforce/perforceconstants.h
index 87072a01ad..95c9f64ca6 100644
--- a/src/plugins/perforce/perforceconstants.h
+++ b/src/plugins/perforce/perforceconstants.h
@@ -42,14 +42,10 @@ const char * const C_PERFORCEEDITOR = "Perforce Editor";
const char * const PERFORCEEDITOR_KIND = "Perforce Editor";
const char * const C_PERFORCESUBMITEDITOR = "Perforce Submit Editor";
const char * const PERFORCESUBMITEDITOR_KIND = "Perforce Submit Editor";
-const char * const ICON_SUBMIT = ":/trolltech.perforce/images/submit.png";
-const char * const ICON_DIFF = ":/trolltech.perforce/images/diff.png";
const char * const SUBMIT_CURRENT = "Nokia.Perforce.SubmitCurrentLog";
const char * const DIFF_SELECTED = "Nokia.Perforce.DiffSelectedFilesInLog";
const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.p4.submit";
-
enum { debug = 0 };
-
} // Internal
} // Perforce
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 60ffa06e99..7f71282fbb 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -366,11 +366,11 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
connect(m_filelogAction, SIGNAL(triggered()), this, SLOT(filelog()));
mperforce->addAction(command);
- m_submitCurrentLogAction = new QAction(QIcon(Constants::ICON_SUBMIT), tr("Submit"), this);
+ m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Submit"), this);
command = am->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, perforcesubmitcontext);
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
- m_diffSelectedFiles = new QAction(QIcon(Constants::ICON_DIFF), tr("Diff Selected Files"), this);
+ m_diffSelectedFiles = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff Selected Files"), this);
command = am->registerAction(m_diffSelectedFiles, Constants::DIFF_SELECTED, perforcesubmitcontext);
m_undoAction = new QAction(tr("&Undo"), this);
diff --git a/src/plugins/subversion/images/diff.png b/src/plugins/subversion/images/diff.png
deleted file mode 100644
index b3597f9ff8..0000000000
--- a/src/plugins/subversion/images/diff.png
+++ /dev/null
Binary files differ
diff --git a/src/plugins/subversion/images/submit.png b/src/plugins/subversion/images/submit.png
deleted file mode 100644
index 4f302302b9..0000000000
--- a/src/plugins/subversion/images/submit.png
+++ /dev/null
Binary files differ
diff --git a/src/plugins/subversion/subversion.qrc b/src/plugins/subversion/subversion.qrc
index 7fa3a2a31e..51c899c701 100644
--- a/src/plugins/subversion/subversion.qrc
+++ b/src/plugins/subversion/subversion.qrc
@@ -1,7 +1,5 @@
<RCC>
<qresource prefix="/trolltech.subversion" >
- <file>images/diff.png</file>
- <file>images/submit.png</file>
<file>Subversion.mimetypes.xml</file>
</qresource>
</RCC>
diff --git a/src/plugins/subversion/subversionconstants.h b/src/plugins/subversion/subversionconstants.h
index 9445926d83..6b2e9d3416 100644
--- a/src/plugins/subversion/subversionconstants.h
+++ b/src/plugins/subversion/subversionconstants.h
@@ -42,8 +42,6 @@ const char * const SUBVERSIONEDITOR = "Subversion Editor";
const char * const SUBVERSIONEDITOR_KIND = "Subversion Editor";
const char * const SUBVERSIONCOMMITEDITOR = "Subversion Commit Editor";
const char * const SUBVERSIONCOMMITEDITOR_KIND = "Subversion Commit Editor";
-const char * const ICON_SUBMIT = ":/trolltech.subversion/images/submit.png";
-const char * const ICON_DIFF = ":/trolltech.subversion/images/diff.png";
const char * const SUBMIT_CURRENT = "Nokia.Subversion.SubmitCurrentLog";
const char * const DIFF_SELECTED = "Nokia.Subversion.DiffSelectedFilesInLog";
enum { debug = 0 };
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index 63c451f85c..6532a9d433 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -382,11 +382,11 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
QList<int> svncommitcontext;
svncommitcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
- m_submitCurrentLogAction = new QAction(QIcon(Constants::ICON_SUBMIT), tr("Commit"), this);
+ m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
- m_submitDiffAction = new QAction(QIcon(Constants::ICON_DIFF), tr("Diff Selected Files"), this);
+ m_submitDiffAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff Selected Files"), this);
command = ami->registerAction(m_submitDiffAction , Constants::DIFF_SELECTED, svncommitcontext);
m_submitUndoAction = new QAction(tr("&Undo"), this);
diff --git a/src/plugins/perforce/images/diff.png b/src/plugins/vcsbase/images/diff.png
index b3597f9ff8..b3597f9ff8 100644
--- a/src/plugins/perforce/images/diff.png
+++ b/src/plugins/vcsbase/images/diff.png
Binary files differ
diff --git a/src/plugins/perforce/images/submit.png b/src/plugins/vcsbase/images/submit.png
index 4f302302b9..4f302302b9 100644
--- a/src/plugins/perforce/images/submit.png
+++ b/src/plugins/vcsbase/images/submit.png
Binary files differ
diff --git a/src/plugins/vcsbase/vcsbase.qrc b/src/plugins/vcsbase/vcsbase.qrc
index 648425980a..f4fa641bf5 100644
--- a/src/plugins/vcsbase/vcsbase.qrc
+++ b/src/plugins/vcsbase/vcsbase.qrc
@@ -1,5 +1,7 @@
<RCC>
- <qresource prefix="/trolltech.vcsbase" >
+ <qresource prefix="/vcsbase" >
<file>VCSBase.mimetypes.xml</file>
+ <file>images/diff.png</file>
+ <file>images/submit.png</file>
</qresource>
</RCC>
diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp
index f8a89c1eca..f5a480126e 100644
--- a/src/plugins/vcsbase/vcsbaseplugin.cpp
+++ b/src/plugins/vcsbase/vcsbaseplugin.cpp
@@ -61,7 +61,7 @@ bool VCSBasePlugin::initialize(const QStringList & /*arguments*/, QString *error
{
Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>();
- if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.vcsbase/VCSBase.mimetypes.xml"), errorMessage))
+ if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/vcsbase/VCSBase.mimetypes.xml"), errorMessage))
return false;
return true;
@@ -70,7 +70,7 @@ bool VCSBasePlugin::initialize(const QStringList & /*arguments*/, QString *error
void VCSBasePlugin::extensionsInitialized()
{
}
-
+
VCSBasePlugin *VCSBasePlugin::instance()
{
return m_instance;
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 3960ca6c75..3ac864f9ab 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -51,6 +51,7 @@
#include <QtCore/QDebug>
enum { debug = 0 };
+enum { wantToolBar = 0 };
static inline QAction *actionFromId(const Core::ICore *core, const char *id)
{
@@ -187,8 +188,27 @@ const char *VCSBaseSubmitEditor::kind() const
return m_d->m_parameters->kind;
}
+static QToolBar *createToolBar(const QWidget *someWidget, QAction *submitAction, QAction *diffAction)
+{
+ // Create
+ QToolBar *toolBar = new QToolBar;
+ toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+ const int size = someWidget->style()->pixelMetric(QStyle::PM_SmallIconSize);
+ toolBar->setIconSize(QSize(size, size));
+ toolBar->addSeparator();
+
+ if (submitAction)
+ toolBar->addAction(submitAction);
+ if (diffAction)
+ toolBar->addAction(diffAction);
+ return toolBar;
+}
+
QToolBar *VCSBaseSubmitEditor::toolBar()
{
+ if (!wantToolBar)
+ return 0;
+
if (m_d->m_toolWidget)
return m_d->m_toolWidget;
@@ -196,18 +216,8 @@ QToolBar *VCSBaseSubmitEditor::toolBar()
return 0;
// Create
- QToolBar *toolBar = new QToolBar;
- toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- const int size = m_d->m_widget->style()->pixelMetric(QStyle::PM_SmallIconSize);
- toolBar->setIconSize(QSize(size, size));
- toolBar->addSeparator();
-
- if (m_d->m_submitAction)
- toolBar->addAction(m_d->m_submitAction);
- if (m_d->m_diffAction)
- toolBar->addAction(m_d->m_diffAction);
- m_d->m_toolWidget = toolBar;
- return toolBar;
+ m_d->m_toolWidget = createToolBar(m_d->m_widget, m_d->m_submitAction, m_d->m_diffAction);
+ return m_d->m_toolWidget;
}
QList<int> VCSBaseSubmitEditor::context() const
@@ -279,4 +289,14 @@ bool VCSBaseSubmitEditor::setFileContents(const QString &contents)
return true;
}
-} // namespace VCSBase
+QIcon VCSBaseSubmitEditor::diffIcon()
+{
+ return QIcon(QLatin1String(":/vcsbase/images/diff.png"));
+}
+
+QIcon VCSBaseSubmitEditor::submitIcon()
+{
+ return QIcon(QLatin1String(":/vcsbase/images/submit.png"));
+}
+
+}
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h
index 796f5c6129..dcaf7cf89d 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.h
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h
@@ -40,6 +40,10 @@
#include <QtCore/QList>
+QT_BEGIN_NAMESPACE
+class QIcon;
+QT_END_NAMESPACE
+
namespace Core {
namespace Utils {
class SubmitEditorWidget;
@@ -118,6 +122,10 @@ public:
void setFileList(const QStringList&);
void addFiles(const QStringList&, bool checked = true, bool userCheckable = true);
+ // Utilities returning some predefined icons for actions
+ static QIcon diffIcon();
+ static QIcon submitIcon();
+
signals:
void diffSelectedFiles(const QStringList &files);