Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
7b24a593
Commit
7b24a593
authored
Jun 02, 2009
by
kh
Browse files
Whitespace cleanup, normalize connect.
Reviewed-by: dt
parent
b50eaa65
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/help/centralwidget.cpp
View file @
7b24a593
...
...
@@ -113,8 +113,8 @@ CentralWidget::CentralWidget(QHelpEngine *engine, QWidget *parent)
if
(
tabBar
)
{
tabBar
->
installEventFilter
(
this
);
tabBar
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
connect
(
tabBar
,
SIGNAL
(
customContextMenuRequested
(
const
QPoint
&
)),
this
,
SLOT
(
showTabBarContextMenu
(
const
QPoint
&
)));
connect
(
tabBar
,
SIGNAL
(
customContextMenuRequested
(
QPoint
)),
this
,
SLOT
(
showTabBarContextMenu
(
QPoint
)));
}
staticCentralWidget
=
this
;
...
...
@@ -314,7 +314,8 @@ void CentralWidget::printPreview()
#ifndef QT_NO_PRINTER
initPrinter
();
QPrintPreviewDialog
preview
(
printer
,
this
);
connect
(
&
preview
,
SIGNAL
(
paintRequested
(
QPrinter
*
)),
SLOT
(
printPreview
(
QPrinter
*
)));
connect
(
&
preview
,
SIGNAL
(
paintRequested
(
QPrinter
*
)),
SLOT
(
printPreview
(
QPrinter
*
)));
preview
.
exec
();
#endif
}
...
...
@@ -422,13 +423,18 @@ void CentralWidget::connectSignals()
{
const
HelpViewer
*
viewer
=
currentHelpViewer
();
if
(
viewer
)
{
connect
(
viewer
,
SIGNAL
(
copyAvailable
(
bool
)),
this
,
SIGNAL
(
copyAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
forwardAvailable
(
bool
)),
this
,
SIGNAL
(
forwardAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
backwardAvailable
(
bool
)),
this
,
SIGNAL
(
backwardAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
sourceChanged
(
const
QUrl
&
)),
this
,
SIGNAL
(
sourceChanged
(
const
QUrl
&
)));
connect
(
viewer
,
SIGNAL
(
highlighted
(
const
QString
&
)),
this
,
SIGNAL
(
highlighted
(
const
QString
&
)));
connect
(
viewer
,
SIGNAL
(
sourceChanged
(
const
QUrl
&
)),
this
,
SLOT
(
setTabTitle
(
const
QUrl
&
)));
connect
(
viewer
,
SIGNAL
(
copyAvailable
(
bool
)),
this
,
SIGNAL
(
copyAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
forwardAvailable
(
bool
)),
this
,
SIGNAL
(
forwardAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
backwardAvailable
(
bool
)),
this
,
SIGNAL
(
backwardAvailable
(
bool
)));
connect
(
viewer
,
SIGNAL
(
sourceChanged
(
QUrl
)),
this
,
SIGNAL
(
sourceChanged
(
QUrl
)));
connect
(
viewer
,
SIGNAL
(
highlighted
(
QString
)),
this
,
SIGNAL
(
highlighted
(
QString
)));
connect
(
viewer
,
SIGNAL
(
sourceChanged
(
QUrl
)),
this
,
SLOT
(
setTabTitle
(
QUrl
)));
}
}
...
...
src/plugins/help/filtersettingspage.cpp
View file @
7b24a593
...
...
@@ -35,7 +35,7 @@
#include <QtHelp/QHelpEngine>
using
namespace
Help
::
Internal
;
FilterSettingsPage
::
FilterSettingsPage
(
QHelpEngine
*
helpEngine
)
:
m_helpEngine
(
helpEngine
)
{
...
...
@@ -67,18 +67,17 @@ QWidget *FilterSettingsPage::createPage(QWidget *parent)
m_ui
.
setupUi
(
m_currentPage
);
m_ui
.
attributeWidget
->
header
()
->
hide
();
m_ui
.
attributeWidget
->
setRootIsDecorated
(
false
);
connect
(
m_ui
.
attributeWidget
,
SIGNAL
(
itemChanged
(
QTreeWidgetItem
*
,
int
)),
this
,
SLOT
(
updateFilterMap
()));
connect
(
m_ui
.
filterWidget
,
SIGNAL
(
currentItemChanged
(
QListWidgetItem
*
,
QListWidgetItem
*
)),
this
,
SLOT
(
updateAttributes
(
QListWidgetItem
*
)));
connect
(
m_ui
.
filterAddButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
addFilter
()));
connect
(
m_ui
.
filterRemoveButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
removeFilter
()));
SIGNAL
(
currentItemChanged
(
QListWidgetItem
*
,
QListWidgetItem
*
)),
this
,
SLOT
(
updateAttributes
(
QListWidgetItem
*
)));
connect
(
m_ui
.
filterAddButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
addFilter
()));
connect
(
m_ui
.
filterRemoveButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
removeFilter
()));
updateFilterPage
();
return
m_currentPage
;
}
...
...
@@ -91,7 +90,7 @@ void FilterSettingsPage::updateFilterPage()
m_ui
.
attributeWidget
->
clear
();
QHelpEngineCore
help
(
m_helpEngine
->
collectionFile
(),
0
);
help
.
setupData
();
help
.
setupData
();
m_filterMapBackup
.
clear
();
const
QStringList
filters
=
help
.
customFilters
();
foreach
(
const
QString
filter
,
filters
)
{
...
...
@@ -105,7 +104,7 @@ void FilterSettingsPage::updateFilterPage()
foreach
(
const
QString
a
,
help
.
filterAttributes
())
new
QTreeWidgetItem
(
m_ui
.
attributeWidget
,
QStringList
()
<<
a
);
if
(
m_filterMap
.
keys
().
count
())
m_ui
.
filterWidget
->
setCurrentRow
(
0
);
}
...
...
@@ -132,7 +131,7 @@ void FilterSettingsPage::updateFilterMap()
QString
filter
=
m_ui
.
filterWidget
->
currentItem
()
->
text
();
if
(
!
m_filterMap
.
contains
(
filter
))
return
;
QStringList
newAtts
;
QTreeWidgetItem
*
itm
=
0
;
for
(
int
i
=
0
;
i
<
m_ui
.
attributeWidget
->
topLevelItemCount
();
++
i
)
{
...
...
@@ -140,7 +139,7 @@ void FilterSettingsPage::updateFilterMap()
if
(
itm
->
checkState
(
0
)
==
Qt
::
Checked
)
newAtts
.
append
(
itm
->
text
(
0
));
}
m_filterMap
[
filter
]
=
newAtts
;
m_filterMap
[
filter
]
=
newAtts
;
}
void
FilterSettingsPage
::
addFilter
()
...
...
@@ -157,7 +156,7 @@ void FilterSettingsPage::addFilter()
QList
<
QListWidgetItem
*>
lst
=
m_ui
.
filterWidget
->
findItems
(
filterName
,
Qt
::
MatchCaseSensitive
);
m_ui
.
filterWidget
->
setCurrentItem
(
lst
.
first
());
m_ui
.
filterWidget
->
setCurrentItem
(
lst
.
first
());
}
void
FilterSettingsPage
::
removeFilter
()
...
...
@@ -175,7 +174,7 @@ void FilterSettingsPage::removeFilter()
}
void
FilterSettingsPage
::
apply
()
{
{
// This is handled via HelpPlugin::checkForHelpChanges, which is connected
// to DocSettingsPage::apply.
}
...
...
src/plugins/help/filtersettingspage.h
View file @
7b24a593
...
...
@@ -63,7 +63,7 @@ private slots:
void
updateFilterMap
();
void
updateFilterPage
();
void
addFilter
();
void
removeFilter
();
void
removeFilter
();
private:
QHelpEngine
*
m_helpEngine
;
...
...
src/plugins/help/helpfindsupport.cpp
View file @
7b24a593
...
...
@@ -87,7 +87,7 @@ HelpViewerFindSupport::HelpViewerFindSupport(HelpViewer *viewer)
QString
HelpViewerFindSupport
::
currentFindString
()
const
{
QTC_ASSERT
(
m_viewer
,
return
QString
());
#if !defined(QT_NO_WEBKIT)
#if !defined(QT_NO_WEBKIT)
return
m_viewer
->
selectedText
();
#else
return
QString
();
...
...
src/plugins/help/helpplugin.cpp
View file @
7b24a593
...
...
@@ -90,10 +90,11 @@ void HelpManager::registerDocumentation(const QStringList &fileNames)
if
(
!
hc
.
setupData
())
qWarning
()
<<
"Could not initialize help engine:"
<<
hc
.
error
();
foreach
(
const
QString
&
fileName
,
fileNames
)
{
if
(
!
QFile
::
exists
(
fileName
))
if
(
!
QFile
Info
(
fileName
)
.
exists
()
)
continue
;
QString
fileNamespace
=
QHelpEngineCore
::
namespaceName
(
fileName
);
if
(
!
fileNamespace
.
isEmpty
()
&&
!
hc
.
registeredDocumentations
().
contains
(
fileNamespace
))
{
const
QString
&
nameSpace
=
QHelpEngineCore
::
namespaceName
(
fileName
);
if
(
!
nameSpace
.
isEmpty
()
&&
!
hc
.
registeredDocumentations
().
contains
(
nameSpace
))
{
if
(
hc
.
registerDocumentation
(
fileName
))
needsSetup
=
true
;
else
...
...
@@ -141,7 +142,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
if
(
!
locale
.
isEmpty
())
{
QTranslator
*
qtr
=
new
QTranslator
(
this
);
qtr
->
load
(
QLatin1String
(
"assistant_"
)
+
locale
,
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
));
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
));
qApp
->
installTranslator
(
qtr
);
}
...
...
@@ -157,10 +158,10 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
QDir
directory
(
fi
.
absolutePath
()
+
"/qtcreator"
);
if
(
!
directory
.
exists
())
directory
.
mkpath
(
directory
.
absolutePath
());
m_helpEngine
=
new
QHelpEngine
(
directory
.
absolutePath
()
+
QLatin1String
(
"/helpcollection.qhc"
),
this
);
connect
(
m_helpEngine
,
SIGNAL
(
setupFinished
()),
this
,
SLOT
(
updateFilterComboBox
()));
m_helpEngine
=
new
QHelpEngine
(
directory
.
absolutePath
()
+
QLatin1String
(
"/helpcollection.qhc"
),
this
);
connect
(
m_helpEngine
,
SIGNAL
(
setupFinished
()),
this
,
SLOT
(
updateFilterComboBox
()));
addAutoReleasedObject
(
new
HelpManager
(
m_helpEngine
));
...
...
@@ -171,8 +172,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
addAutoReleasedObject
(
m_filterSettingsPage
);
connect
(
m_docSettingsPage
,
SIGNAL
(
documentationAdded
()),
m_filterSettingsPage
,
SLOT
(
updateFilterPage
()));
connect
(
m_docSettingsPage
,
SIGNAL
(
dialogAccepted
()),
this
,
SLOT
(
checkForHelpChanges
()));
connect
(
m_docSettingsPage
,
SIGNAL
(
dialogAccepted
()),
this
,
SLOT
(
checkForHelpChanges
()));
m_contentWidget
=
new
ContentWindow
(
m_helpEngine
);
m_contentWidget
->
setWindowTitle
(
tr
(
"Contents"
));
...
...
@@ -183,53 +184,69 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
m_bookmarkManager
=
new
BookmarkManager
(
m_helpEngine
);
m_bookmarkWidget
=
new
BookmarkWidget
(
m_bookmarkManager
,
0
,
false
);
m_bookmarkWidget
->
setWindowTitle
(
tr
(
"Bookmarks"
));
connect
(
m_bookmarkWidget
,
SIGNAL
(
addBookmark
()),
this
,
SLOT
(
addBookmark
()));
connect
(
m_bookmarkWidget
,
SIGNAL
(
addBookmark
()),
this
,
SLOT
(
addBookmark
()));
Core
::
ActionManager
*
am
=
m_core
->
actionManager
();
Core
::
Command
*
cmd
;
// Add Home, Previous and Next actions (used in the toolbar)
QAction
*
homeAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/home.png"
)),
tr
(
"Home"
),
this
);
QAction
*
homeAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/home.png"
)),
tr
(
"Home"
),
this
);
cmd
=
am
->
registerAction
(
homeAction
,
QLatin1String
(
"Help.Home"
),
globalcontext
);
QAction
*
previousAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/previous.png"
)),
QAction
*
previousAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/previous.png"
)),
tr
(
"Previous"
),
this
);
cmd
=
am
->
registerAction
(
previousAction
,
QLatin1String
(
"Help.Previous"
),
modecontext
);
cmd
=
am
->
registerAction
(
previousAction
,
QLatin1String
(
"Help.Previous"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Back
);
QAction
*
nextAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/next.png"
)),
tr
(
"Next"
),
this
);
QAction
*
nextAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/next.png"
)),
tr
(
"Next"
),
this
);
cmd
=
am
->
registerAction
(
nextAction
,
QLatin1String
(
"Help.Next"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Forward
);
QAction
*
addBookmarkAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/bookmark.png"
)),
QAction
*
addBookmarkAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/bookmark.png"
)),
tr
(
"Add Bookmark"
),
this
);
cmd
=
am
->
registerAction
(
addBookmarkAction
,
QLatin1String
(
"Help.AddBookmark"
),
modecontext
);
cmd
=
am
->
registerAction
(
addBookmarkAction
,
QLatin1String
(
"Help.AddBookmark"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_M
));
// Add Index, Contents, and Context menu items and a separator to the Help menu
QAction
*
indexAction
=
new
QAction
(
tr
(
"Index"
),
this
);
cmd
=
am
->
registerAction
(
indexAction
,
QLatin1String
(
"Help.Index"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
cmd
=
am
->
registerAction
(
indexAction
,
QLatin1String
(
"Help.Index"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
QAction
*
contentsAction
=
new
QAction
(
tr
(
"Contents"
),
this
);
cmd
=
am
->
registerAction
(
contentsAction
,
QLatin1String
(
"Help.Contents"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
cmd
=
am
->
registerAction
(
contentsAction
,
QLatin1String
(
"Help.Contents"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
QAction
*
searchAction
=
new
QAction
(
tr
(
"Search"
),
this
);
cmd
=
am
->
registerAction
(
searchAction
,
QLatin1String
(
"Help.Search"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
cmd
=
am
->
registerAction
(
searchAction
,
QLatin1String
(
"Help.Search"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
QAction
*
contextAction
=
new
QAction
(
tr
(
"Context Help"
),
this
);
cmd
=
am
->
registerAction
(
contextAction
,
QLatin1String
(
"Help.Context"
),
globalcontext
);
cmd
=
am
->
registerAction
(
contextAction
,
QLatin1String
(
"Help.Context"
),
globalcontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
Key_F1
));
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
#ifndef Q_OS_MAC
QAction
*
sep
=
new
QAction
(
this
);
sep
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Help.Separator"
),
globalcontext
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
am
->
actionContainer
(
Core
::
Constants
::
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
#endif
m_centralWidget
=
new
Help
::
Internal
::
CentralWidget
(
m_helpEngine
);
...
...
@@ -276,21 +293,24 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
QMap
<
QString
,
Core
::
Command
*>
shortcutMap
;
QShortcut
*
shortcut
=
new
QShortcut
(
splitter
);
shortcut
->
setWhatsThis
(
tr
(
"Activate Index in Help mode"
));
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.IndexShortcut"
),
modecontext
);
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.IndexShortcut"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_I
));
connect
(
shortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
activateIndex
()));
shortcutMap
.
insert
(
m_indexWidget
->
windowTitle
(),
cmd
);
shortcut
=
new
QShortcut
(
splitter
);
shortcut
->
setWhatsThis
(
tr
(
"Activate Contents in Help mode"
));
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.ContentsShortcut"
),
modecontext
);
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.ContentsShortcut"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_T
));
connect
(
shortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
activateContents
()));
shortcutMap
.
insert
(
m_contentWidget
->
windowTitle
(),
cmd
);
shortcut
=
new
QShortcut
(
splitter
);
shortcut
->
setWhatsThis
(
tr
(
"Activate Search in Help mode"
));
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.SearchShortcut"
),
modecontext
);
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.SearchShortcut"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_S
));
connect
(
shortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
activateSearch
()));
shortcutMap
.
insert
(
m_searchWidget
->
windowTitle
(),
cmd
);
...
...
@@ -302,23 +322,23 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
connect
(
previousAction
,
SIGNAL
(
triggered
()),
m_centralWidget
,
SLOT
(
backward
()));
connect
(
nextAction
,
SIGNAL
(
triggered
()),
m_centralWidget
,
SLOT
(
forward
()));
connect
(
addBookmarkAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addBookmark
()));
connect
(
m_contentWidget
,
SIGNAL
(
linkActivated
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_searchWidget
,
SIGNAL
(
requestShowLink
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_searchWidget
,
SIGNAL
(
requestShowLinkInNewTab
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSourceInNewTab
(
const
QUrl
&
)));
connect
(
m_bookmarkWidget
,
SIGNAL
(
requestShowLink
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_contentWidget
,
SIGNAL
(
linkActivated
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
connect
(
m_searchWidget
,
SIGNAL
(
requestShowLink
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
connect
(
m_searchWidget
,
SIGNAL
(
requestShowLinkInNewTab
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSourceInNewTab
(
QUrl
)));
connect
(
m_bookmarkWidget
,
SIGNAL
(
requestShowLink
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_centralWidget
,
SIGNAL
(
backwardAvailable
(
bool
)),
previousAction
,
SLOT
(
setEnabled
(
bool
)));
connect
(
m_centralWidget
,
SIGNAL
(
forwardAvailable
(
bool
)),
nextAction
,
SLOT
(
setEnabled
(
bool
)));
connect
(
m_centralWidget
,
SIGNAL
(
addNewBookmark
(
const
QString
&
,
const
QString
&
)),
this
,
SLOT
(
addNewBookmark
(
const
QString
&
,
const
QString
&
)));
connect
(
m_centralWidget
,
SIGNAL
(
addNewBookmark
(
QString
,
QString
)),
this
,
SLOT
(
addNewBookmark
(
QString
,
QString
)));
QList
<
QAction
*>
actionList
;
actionList
<<
previousAction
...
...
@@ -338,19 +358,19 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
connect
(
m_core
->
modeManager
(),
SIGNAL
(
currentModeChanged
(
Core
::
IMode
*
)),
this
,
SLOT
(
modeChanged
(
Core
::
IMode
*
)));
connect
(
m_contentWidget
,
SIGNAL
(
linkActivated
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
const
QUrl
&
)),
m_centralWidget
,
SLOT
(
setSource
(
const
QUrl
&
)));
connect
(
m_indexWidget
,
SIGNAL
(
linksActivated
(
const
QMap
<
QString
,
QUrl
>
&
,
const
QString
&
)),
m_centralWidget
,
SLOT
(
showTopicChooser
(
const
QMap
<
QString
,
QUrl
>
&
,
const
QString
&
)));
connect
(
m_contentWidget
,
SIGNAL
(
linkActivated
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
connect
(
m_indexWidget
,
SIGNAL
(
linksActivated
(
QMap
<
QString
,
QUrl
>
,
QString
)),
m_centralWidget
,
SLOT
(
showTopicChooser
(
QMap
<
QString
,
QUrl
>
,
QString
)));
HelpIndexFilter
*
helpIndexFilter
=
new
HelpIndexFilter
(
this
,
m_helpEngine
);
addAutoReleasedObject
(
helpIndexFilter
);
connect
(
helpIndexFilter
,
SIGNAL
(
linkActivated
(
QUrl
)),
this
,
SLOT
(
switchToHelpMode
(
QUrl
)));
connect
(
helpIndexFilter
,
SIGNAL
(
linksActivated
(
const
QMap
<
QString
,
QUrl
>
&
,
const
QString
&
)),
this
,
SLOT
(
switchToHelpMode
(
const
QMap
<
QString
,
QUrl
>
&
,
const
QString
&
)));
connect
(
helpIndexFilter
,
SIGNAL
(
linkActivated
(
QUrl
)),
this
,
SLOT
(
switchToHelpMode
(
QUrl
)));
connect
(
helpIndexFilter
,
SIGNAL
(
linksActivated
(
QMap
<
QString
,
QUrl
>
,
QString
)),
this
,
SLOT
(
switchToHelpMode
(
QMap
<
QString
,
QUrl
>
,
QString
)));
previousAction
->
setEnabled
(
m_centralWidget
->
isBackwardAvailable
());
nextAction
->
setEnabled
(
m_centralWidget
->
isForwardAvailable
());
...
...
@@ -365,8 +385,12 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
void
HelpPlugin
::
createRightPaneSideBar
()
{
QAction
*
switchToHelpMode
=
new
QAction
(
"Go to Help Mode"
,
this
);
m_rightPaneBackwardAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/previous.png"
)),
tr
(
"Previous"
),
this
);
m_rightPaneForwardAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/next.png"
)),
tr
(
"Next"
),
this
);
m_rightPaneBackwardAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/previous.png"
)),
tr
(
"Previous"
),
this
);
m_rightPaneForwardAction
=
new
QAction
(
QIcon
(
QLatin1String
(
":/help/images/next.png"
)),
tr
(
"Next"
),
this
);
QToolBar
*
rightPaneToolBar
=
new
QToolBar
();
rightPaneToolBar
->
addAction
(
switchToHelpMode
);
...
...
@@ -374,8 +398,10 @@ void HelpPlugin::createRightPaneSideBar()
rightPaneToolBar
->
addAction
(
m_rightPaneForwardAction
);
connect
(
switchToHelpMode
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
switchToHelpMode
()));
connect
(
m_rightPaneBackwardAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
rightPaneBackward
()));
connect
(
m_rightPaneForwardAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
rightPaneForward
()));
connect
(
m_rightPaneBackwardAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
rightPaneBackward
()));
connect
(
m_rightPaneForwardAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
rightPaneForward
()));
QToolButton
*
closeButton
=
new
QToolButton
();
closeButton
->
setProperty
(
"type"
,
QLatin1String
(
"dockbutton"
));
...
...
@@ -457,7 +483,8 @@ void HelpPlugin::switchToHelpMode(const QUrl &source)
m_centralWidget
->
setFocus
();
}
void
HelpPlugin
::
switchToHelpMode
(
const
QMap
<
QString
,
QUrl
>
&
urls
,
const
QString
&
keyword
)
void
HelpPlugin
::
switchToHelpMode
(
const
QMap
<
QString
,
QUrl
>
&
urls
,
const
QString
&
keyword
)
{
activateHelpMode
();
m_centralWidget
->
showTopicChooser
(
urls
,
keyword
);
...
...
@@ -479,9 +506,11 @@ void HelpPlugin::extensionsInitialized()
bool
needsSetup
=
false
;
bool
assistantInternalDocRegistered
=
false
;
foreach
(
QString
ns
,
m_helpEngine
->
registeredDocumentations
())
{
if
(
ns
==
QString
(
"com.nokia.qtcreator.%1%2"
)
.
arg
(
IDE_VERSION_MAJOR
).
arg
(
IDE_VERSION_MINOR
))
{
const
QString
&
docInternal
=
QString
(
"com.nokia.qtcreator.%1%2"
)
.
arg
(
IDE_VERSION_MAJOR
).
arg
(
IDE_VERSION_MINOR
);
const
QStringList
&
docs
=
m_helpEngine
->
registeredDocumentations
();
foreach
(
const
QString
&
ns
,
docs
)
{
if
(
ns
==
docInternal
)
{
assistantInternalDocRegistered
=
true
;
break
;
}
...
...
@@ -500,21 +529,22 @@ void HelpPlugin::extensionsInitialized()
QHelpEngineCore
hc
(
fi
.
absoluteFilePath
());
hc
.
setupData
();
QString
fileNamespace
=
QHelpEngineCore
::
namespaceName
(
qchFileName
);
if
(
!
fileNamespace
.
isEmpty
()
&&
!
hc
.
registeredDocumentations
().
contains
(
fileNamespace
))
{
if
(
!
hc
.
registerDocumentation
(
qchFileName
))
qDebug
()
<<
hc
.
error
();
needsSetup
=
true
;
if
(
!
fileNamespace
.
isEmpty
()
&&
!
hc
.
registeredDocumentations
().
contains
(
fileNamespace
))
{
if
(
!
hc
.
registerDocumentation
(
qchFileName
))
qDebug
()
<<
hc
.
error
();
needsSetup
=
true
;
}
}
int
i
=
m_helpEngine
->
customValue
(
QLatin1String
(
"UnfilteredFilterInserted"
)
).
toInt
();
QLatin1String
key
(
"UnfilteredFilterInserted"
);
int
i
=
m_helpEngine
->
customValue
(
key
).
toInt
();
if
(
i
!=
1
)
{
{
QHelpEngineCore
hc
(
m_helpEngine
->
collectionFile
());
hc
.
setupData
();
hc
.
addCustomFilter
(
tr
(
"Unfiltered"
),
QStringList
());
hc
.
setCustomValue
(
QLatin1String
(
"UnfilteredFilterInserted"
)
,
1
);
hc
.
setCustomValue
(
key
,
1
);
}
m_helpEngine
->
blockSignals
(
true
);
m_helpEngine
->
setCurrentFilter
(
tr
(
"Unfiltered"
));
...
...
@@ -528,9 +558,15 @@ void HelpPlugin::extensionsInitialized()
updateFilterComboBox
();
m_bookmarkManager
->
setupBookmarkModels
();
if
(
Core
::
Internal
::
WelcomeMode
*
welcomeMode
=
qobject_cast
<
Core
::
Internal
::
WelcomeMode
*>
(
m_core
->
modeManager
()
->
mode
(
Core
::
Constants
::
MODE_WELCOME
)))
{
connect
(
welcomeMode
,
SIGNAL
(
openHelpPage
(
const
QString
&
)),
this
,
SLOT
(
openHelpPage
(
const
QString
&
)));
connect
(
welcomeMode
,
SIGNAL
(
openContextHelpPage
(
const
QString
&
)),
this
,
SLOT
(
openContextHelpPage
(
QString
)));
using
namespace
Core
::
Internal
;
using
namespace
Core
::
Constants
;
WelcomeMode
*
welcomeMode
=
qobject_cast
<
WelcomeMode
*>
(
m_core
->
modeManager
()
->
mode
(
MODE_WELCOME
));
if
(
welcomeMode
)
{
connect
(
welcomeMode
,
SIGNAL
(
openHelpPage
(
QString
)),
this
,
SLOT
(
openHelpPage
(
QString
)));
connect
(
welcomeMode
,
SIGNAL
(
openContextHelpPage
(
QString
)),
this
,
SLOT
(
openContextHelpPage
(
QString
)));
}
}
...
...
@@ -671,8 +707,8 @@ QToolBar *HelpPlugin::createToolBar()
layout
->
addWidget
(
new
QLabel
(
tr
(
"Filtered by:"
)));
m_filterComboBox
=
new
QComboBox
;
m_filterComboBox
->
setMinimumContentsLength
(
20
);
connect
(
m_filterComboBox
,
SIGNAL
(
activated
(
const
QString
&
)),
this
,
SLOT
(
filterDocumentation
(
const
QString
&
)));
connect
(
m_filterComboBox
,
SIGNAL
(
activated
(
QString
)),
this
,
SLOT
(
filterDocumentation
(
QString
)));
layout
->
addWidget
(
m_filterComboBox
);
toolWidget
->
addWidget
(
w
);
...
...
src/shared/help/helpviewer.cpp
View file @
7b24a593
...
...
@@ -235,7 +235,7 @@ HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *paren
,
helpEngine
(
engine
)
,
parentWidget
(
parent
)
,
multiTabsAllowed
(
true
)
{
{
setPage
(
new
HelpPage
(
parent
,
helpEngine
,
this
));
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
false
);
settings
()
->
setAttribute
(
QWebSettings
::
JavaEnabled
,
false
);
...
...
src/shared/help/helpviewer.h
View file @
7b24a593
...
...
@@ -142,7 +142,7 @@ protected:
void
wheelEvent
(
QWheelEvent
*
e
);
private:
QVariant
loadResource
(
int
type
,
const
QUrl
&
name
);
QVariant
loadResource
(
int
type
,
const
QUrl
&
name
);
void
openLinkInNewTab
(
const
QString
&
link
);
bool
hasAnchorAt
(
const
QPoint
&
pos
);
void
contextMenuEvent
(
QContextMenuEvent
*
e
);
...
...
Write
Preview
Supports
Markdown
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