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
PIM
PIM Messagelib
Commits
bfeac95d
Commit
bfeac95d
authored
Jan 04, 2016
by
Laurent Montel
😁
Browse files
Rename and install findbarwebview
parent
2aa046bc
Changes
10
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
bfeac95d
...
...
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings)
include
(
ECMQtDeclareLoggingCategory
)
include
(
ECMAddTests
)
set
(
MESSAGELIB_LIB_VERSION
"5.1.5
0
"
)
set
(
MESSAGELIB_LIB_VERSION
"5.1.5
1
"
)
set
(
KF5_VERSION
"5.17.0"
)
set
(
KDEPIMLIBS_LIB_VERSION
"5.1.42"
)
...
...
messageviewer/src/CMakeLists.txt
View file @
bfeac95d
...
...
@@ -138,7 +138,7 @@ set(libmessageviewer_scamdetection_SRCS
set
(
libmessageviewer_findbar_SRCS
findbar/findbarbase.cpp
findbar/findbar
mail
webview.cpp
findbar/findbarwebview.cpp
findbar/findbarsourceview.cpp
)
...
...
@@ -305,6 +305,16 @@ ecm_generate_headers(MessageViewer_Camelcaseutils_HEADERS
RELATIVE utils
)
ecm_generate_headers
(
MessageViewer_Camelfindbar_HEADERS
HEADER_NAMES
FindBarWebView
FindBarBase
REQUIRED_HEADERS MessageViewer_findbar_HEADERS
PREFIX MessageViewer
RELATIVE findbar
)
ecm_generate_headers
(
MessageViewer_Camelcaseantispam_HEADERS
HEADER_NAMES
SpamHeaderAnalyzer
...
...
@@ -412,6 +422,7 @@ install(FILES
${
MessageViewer_Camelcasemain_HEADERS
}
${
MessageViewer_Camelcaseviewerjob_HEADERS
}
${
MessageViewer_Camelcaseantispam_HEADERS
}
${
MessageViewer_Camelfindbar_HEADERS
}
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/MessageViewer
COMPONENT Devel
)
...
...
@@ -430,6 +441,7 @@ install(FILES
${
MessageViewer_widgets_HEADERS
}
${
MessageViewer_viewerjob_HEADERS
}
${
MessageViewer_antispam_HEADERS
}
${
MessageViewer_findbar_HEADERS
}
${
CMAKE_CURRENT_BINARY_DIR
}
/messageviewer_export.h
${
CMAKE_CURRENT_BINARY_DIR
}
/globalsettings_messageviewer.h
${
CMAKE_CURRENT_BINARY_DIR
}
/messageviewer_debug.h
...
...
messageviewer/src/findbar/autotests/CMakeLists.txt
View file @
bfeac95d
...
...
@@ -3,4 +3,4 @@ ecm_add_test(findbarbasetest.cpp ../findbarbase.cpp
NAME_PREFIX
"messageviewer-findbar-"
LINK_LIBRARIES Qt5::Test Qt5::Widgets Qt5::Gui KF5::Completion KF5::I18n KF5::ConfigWidgets KF5::PimCommon
)
set_property
(
TARGET findbarbasetest PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/messageviewer
)
set_property
(
TARGET findbarbasetest PROPERTY INCLUDE_DIRECTORIES
${
CMAKE_SOURCE_DIR
}
/messageviewer
${
CMAKE_BINARY_DIR
}
/messageviewer/src
)
messageviewer/src/findbar/findbarbase.h
View file @
bfeac95d
...
...
@@ -21,7 +21,7 @@
#define FINDBARBASE_H
#include <QWidget>
#include "messageviewer_export.h"
class
QAction
;
class
QPushButton
;
class
QMenu
;
...
...
@@ -32,7 +32,7 @@ class LineEditWithCompleter;
}
namespace
MessageViewer
{
class
FindBarBase
:
public
QWidget
class
MESSAGEVIEWER_EXPORT
FindBarBase
:
public
QWidget
{
Q_OBJECT
public:
...
...
messageviewer/src/findbar/findbar
mail
webview.cpp
→
messageviewer/src/findbar/findbarwebview.cpp
View file @
bfeac95d
...
...
@@ -16,15 +16,15 @@
* Boston, MA 02110-1301, USA.
*/
#include "findbar
mail
webview.h"
#include "findbarwebview.h"
#include "PimCommon/LineEditWithCompleter"
#include
"viewer/mailw
eb
v
iew
.h"
#include
<QW
eb
V
iew
>
#include <KLocalizedString>
#include <QMenu>
using
namespace
MessageViewer
;
FindBar
Mail
WebView
::
FindBar
Mail
WebView
(
Mail
WebView
*
view
,
QWidget
*
parent
)
FindBarWebView
::
FindBarWebView
(
Q
WebView
*
view
,
QWidget
*
parent
)
:
FindBarBase
(
parent
),
mView
(
view
)
{
QMenu
*
options
=
optionsMenu
();
...
...
@@ -32,15 +32,15 @@ FindBarMailWebView::FindBarMailWebView(MailWebView *view, QWidget *parent)
mHighlightAll
->
setCheckable
(
true
);
mFindInSelection
=
options
->
addAction
(
i18n
(
"Find in selection first"
));
mFindInSelection
->
setCheckable
(
true
);
connect
(
mHighlightAll
,
&
QAction
::
toggled
,
this
,
&
FindBar
Mail
WebView
::
slotHighlightAllChanged
);
connect
(
mFindInSelection
,
&
QAction
::
toggled
,
this
,
&
FindBar
Mail
WebView
::
slotFindSelectionFirstChanged
);
connect
(
mHighlightAll
,
&
QAction
::
toggled
,
this
,
&
FindBarWebView
::
slotHighlightAllChanged
);
connect
(
mFindInSelection
,
&
QAction
::
toggled
,
this
,
&
FindBarWebView
::
slotFindSelectionFirstChanged
);
}
FindBar
Mail
WebView
::~
FindBar
Mail
WebView
()
FindBarWebView
::~
FindBarWebView
()
{
}
void
FindBar
Mail
WebView
::
searchText
(
bool
backward
,
bool
isAutoSearch
)
void
FindBarWebView
::
searchText
(
bool
backward
,
bool
isAutoSearch
)
{
QWebPage
::
FindFlags
searchOptions
=
QWebPage
::
FindWrapsAroundDocument
;
...
...
@@ -68,7 +68,7 @@ void FindBarMailWebView::searchText(bool backward, bool isAutoSearch)
setFoundMatch
(
found
);
}
void
FindBar
Mail
WebView
::
updateHighLight
(
bool
highLight
)
void
FindBarWebView
::
updateHighLight
(
bool
highLight
)
{
bool
found
=
false
;
if
(
highLight
)
{
...
...
@@ -84,7 +84,7 @@ void FindBarMailWebView::updateHighLight(bool highLight)
setFoundMatch
(
found
);
}
void
FindBar
Mail
WebView
::
updateSensitivity
(
bool
sensitivity
)
void
FindBarWebView
::
updateSensitivity
(
bool
sensitivity
)
{
QWebPage
::
FindFlags
searchOptions
=
QWebPage
::
FindWrapsAroundDocument
;
if
(
sensitivity
)
{
...
...
@@ -98,7 +98,7 @@ void FindBarMailWebView::updateSensitivity(bool sensitivity)
setFoundMatch
(
found
);
}
void
FindBar
Mail
WebView
::
slotFindSelectionFirstChanged
(
bool
findSectionFirst
)
void
FindBarWebView
::
slotFindSelectionFirstChanged
(
bool
findSectionFirst
)
{
QWebPage
::
FindFlags
searchOptions
=
QWebPage
::
FindWrapsAroundDocument
;
if
(
findSectionFirst
)
{
...
...
@@ -112,9 +112,11 @@ void FindBarMailWebView::slotFindSelectionFirstChanged(bool findSectionFirst)
setFoundMatch
(
found
);
}
void
FindBar
Mail
WebView
::
clearSelections
()
void
FindBarWebView
::
clearSelections
()
{
mView
->
clearFindSelection
();
//WEBKIT: TODO: Find a way to unselect last selection
// http://bugreports.qt.nokia.com/browse/QTWEBKIT-80
mView
->
findText
(
QString
(),
QWebPage
::
HighlightAllOccurrences
);
mLastSearchStr
.
clear
();
FindBarBase
::
clearSelections
();
}
...
...
messageviewer/src/findbar/findbar
mail
webview.h
→
messageviewer/src/findbar/findbarwebview.h
View file @
bfeac95d
...
...
@@ -20,24 +20,22 @@
#define MESSAGEVIEWER_FINDBAR_MAILWEBVIEW_H
#include "findbarbase.h"
#include "messageviewer_export.h"
namespace
MessageViewer
{
class
MailWebView
;
}
class
QWebView
;
namespace
MessageViewer
{
class
FindBar
Mail
WebView
:
public
FindBarBase
class
MESSAGEVIEWER_EXPORT
FindBarWebView
:
public
FindBarBase
{
Q_OBJECT
public:
explicit
FindBar
Mail
WebView
(
Mail
WebView
*
view
,
QWidget
*
parent
=
Q_NULLPTR
);
~
FindBar
Mail
WebView
();
explicit
FindBarWebView
(
Q
WebView
*
view
,
QWidget
*
parent
=
Q_NULLPTR
);
~
FindBarWebView
();
private:
explicit
FindBar
Mail
WebView
(
QWidget
*
parent
)
explicit
FindBarWebView
(
QWidget
*
parent
)
{
Q_UNUSED
(
parent
);
}
...
...
@@ -49,7 +47,7 @@ private:
private
Q_SLOTS
:
void
slotFindSelectionFirstChanged
(
bool
findSectionFirst
);
private:
Mail
WebView
*
mView
;
Q
WebView
*
mView
;
QAction
*
mHighlightAll
;
QAction
*
mFindInSelection
;
};
...
...
messageviewer/src/viewer/mailwebview.cpp
View file @
bfeac95d
...
...
@@ -299,14 +299,6 @@ void MailWebView::setElementByIdVisible(const QString &id, bool visible)
}
}
void
MailWebView
::
clearFindSelection
()
{
//WEBKIT: TODO: Find a way to unselect last selection
// http://bugreports.qt.nokia.com/browse/QTWEBKIT-80
KWebView
::
findText
(
QString
(),
QWebPage
::
HighlightAllOccurrences
);
}
void
MailWebView
::
keyReleaseEvent
(
QKeyEvent
*
e
)
{
if
(
MessageViewer
::
MessageViewerSettings
::
self
()
->
accessKeyEnabled
())
{
...
...
messageviewer/src/viewer/mailwebview.h
View file @
bfeac95d
...
...
@@ -42,8 +42,6 @@ public:
explicit
MailWebView
(
KActionCollection
*
actionCollection
=
Q_NULLPTR
,
QWidget
*
parent
=
Q_NULLPTR
);
~
MailWebView
();
void
clearFindSelection
();
void
scrollUp
(
int
pixels
);
void
scrollDown
(
int
pixels
);
bool
isScrolledToBottom
()
const
;
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
bfeac95d
...
...
@@ -125,7 +125,7 @@
#include "messageviewer/messageviewerutil.h"
#include "widgets/vcardviewer.h"
#include "viewer/mailwebview.h"
#include "findbar/findbar
mail
webview.h"
#include "findbar/findbarwebview.h"
#include "header/headerstylemenumanager.h"
#include "messageviewer/bodypart.h"
...
...
@@ -1482,7 +1482,7 @@ void ViewerPrivate::createWidgets()
mSliderContainer
=
new
KPIMTextEdit
::
SlideContainer
(
readerBox
);
mSliderContainer
->
setObjectName
(
QStringLiteral
(
"slidercontainer"
));
readerBoxVBoxLayout
->
addWidget
(
mSliderContainer
);
mFindBar
=
new
FindBar
Mail
WebView
(
mViewer
,
q
);
mFindBar
=
new
FindBarWebView
(
mViewer
,
q
);
connect
(
mFindBar
,
&
FindBarBase
::
hideFindBar
,
mSliderContainer
,
&
KPIMTextEdit
::
SlideContainer
::
slideOut
);
mSliderContainer
->
setContent
(
mFindBar
);
...
...
messageviewer/src/viewer/viewer_p.h
View file @
bfeac95d
...
...
@@ -71,7 +71,7 @@ class HtmlWriter;
class
CSSHelper
;
class
AttachmentStrategy
;
class
ObjectTreeParser
;
class
FindBar
Mail
WebView
;
class
FindBarWebView
;
class
WebKitPartHtmlWriter
;
class
HtmlStatusBar
;
class
MailWebView
;
...
...
@@ -601,7 +601,7 @@ public:
MimePartTreeView
*
mMimePartTree
;
#endif
MailWebView
*
mViewer
;
FindBar
Mail
WebView
*
mFindBar
;
FindBarWebView
*
mFindBar
;
const
AttachmentStrategy
*
mAttachmentStrategy
;
QTimer
mUpdateReaderWinTimer
;
...
...
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