Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
3b707461
Commit
3b707461
authored
Feb 21, 2011
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a configure item to the external tools menu.
parent
1d3adef2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
src/plugins/coreplugin/coreconstants.h
src/plugins/coreplugin/coreconstants.h
+1
-0
src/plugins/coreplugin/externaltool.cpp
src/plugins/coreplugin/externaltool.cpp
+15
-1
src/plugins/coreplugin/externaltool.h
src/plugins/coreplugin/externaltool.h
+4
-0
src/plugins/coreplugin/toolsettings.cpp
src/plugins/coreplugin/toolsettings.cpp
+1
-1
No files found.
src/plugins/coreplugin/coreconstants.h
View file @
3b707461
...
...
@@ -253,6 +253,7 @@ const char * const SETTINGS_CATEGORY_CORE = "A.Core";
const
char
*
const
SETTINGS_CATEGORY_CORE_ICON
=
":/core/images/category_core.png"
;
const
char
*
const
SETTINGS_TR_CATEGORY_CORE
=
QT_TRANSLATE_NOOP
(
"Core"
,
"Environment"
);
const
char
*
const
SETTINGS_ID_ENVIRONMENT
=
"A.General"
;
const
char
*
const
SETTINGS_ID_TOOLS
=
"G.ExternalTools"
;
const
char
*
const
SETTINGS_DEFAULTTEXTENCODING
=
"General/DefaultFileEncoding"
;
...
...
src/plugins/coreplugin/externaltool.cpp
View file @
3b707461
...
...
@@ -47,7 +47,6 @@
#include <QtCore/QFile>
#include <QtCore/QDateTime>
#include <QtGui/QMenu>
#include <QtGui/QMenuItem>
#include <QtGui/QAction>
#include <QtDebug>
...
...
@@ -677,6 +676,11 @@ ExternalToolManager::~ExternalToolManager()
void
ExternalToolManager
::
initialize
()
{
m_configureSeparator
=
new
QAction
(
this
);
m_configureSeparator
->
setSeparator
(
true
);
m_configureAction
=
new
QAction
(
tr
(
"Configure..."
),
this
);
connect
(
m_configureAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openPreferences
()));
// add the external tools menu
ActionManager
*
am
=
m_core
->
actionManager
();
ActionContainer
*
mexternaltools
=
am
->
createMenu
(
Id
(
Constants
::
M_TOOLS_EXTERNAL
));
...
...
@@ -844,6 +848,10 @@ void ExternalToolManager::setToolsByCategory(const QMap<QString, QList<Internal:
qDeleteAll
(
m_containers
);
// remember the new containers
m_containers
=
newContainers
;
// (re)add the configure menu item
mexternaltools
->
menu
()
->
addAction
(
m_configureSeparator
);
mexternaltools
->
menu
()
->
addAction
(
m_configureAction
);
}
void
ExternalToolManager
::
readSettings
(
const
QMap
<
QString
,
ExternalTool
*>
&
tools
,
...
...
@@ -901,3 +909,9 @@ void ExternalToolManager::writeSettings()
settings
->
endGroup
();
}
void
ExternalToolManager
::
openPreferences
()
{
ICore
::
instance
()
->
showOptionsDialog
(
QLatin1String
(
Core
::
Constants
::
SETTINGS_CATEGORY_CORE
),
QLatin1String
(
Core
::
Constants
::
SETTINGS_ID_TOOLS
));
}
src/plugins/coreplugin/externaltool.h
View file @
3b707461
...
...
@@ -43,6 +43,7 @@
#include <QtCore/QProcess>
#include <QtCore/QSharedPointer>
#include <QtCore/QTextCodec>
#include <QtGui/QMenu>
namespace
Core
{
namespace
Internal
{
...
...
@@ -176,6 +177,7 @@ signals:
private
slots
:
void
menuActivated
();
void
openPreferences
();
private:
void
initialize
();
...
...
@@ -193,6 +195,8 @@ private:
QMap
<
QString
,
QList
<
Internal
::
ExternalTool
*>
>
m_categoryMap
;
QMap
<
QString
,
QAction
*>
m_actions
;
QMap
<
QString
,
ActionContainer
*>
m_containers
;
QAction
*
m_configureSeparator
;
QAction
*
m_configureAction
;
// for sending the replaceSelectionRequested signal
friend
class
Core
::
Internal
::
ExternalToolRunner
;
...
...
src/plugins/coreplugin/toolsettings.cpp
View file @
3b707461
...
...
@@ -49,7 +49,7 @@ ToolSettings::ToolSettings(QObject *parent) :
QString
ToolSettings
::
id
()
const
{
return
QLatin1String
(
"G.ExternalTools"
);
return
QLatin1String
(
Core
::
Constants
::
SETTINGS_ID_TOOLS
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment