Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
e6a2b419
Commit
e6a2b419
authored
Sep 07, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue
http://188.165.53.52/jira/browse/SANKORE-240
parent
d16520d1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
65 deletions
+41
-65
WBBrowserWindow.cpp
src/web/browser/WBBrowserWindow.cpp
+13
-14
WBTabWidget.cpp
src/web/browser/WBTabWidget.cpp
+28
-49
WBTabWidget.h
src/web/browser/WBTabWidget.h
+0
-2
No files found.
src/web/browser/WBBrowserWindow.cpp
View file @
e6a2b419
...
...
@@ -85,15 +85,12 @@ WBHistoryManager *WBBrowserWindow::sHistoryManager = 0;
WBBrowserWindow
::
WBBrowserWindow
(
QWidget
*
parent
,
Ui
::
MainWindow
*
uniboardMainWindow
,
bool
isViewerWebInstance
)
:
QWidget
(
parent
)
,
mWebToolBar
(
0
)
,
mSearchToolBar
(
0
)
,
mTabWidget
(
new
WBTabWidget
(
this
))
,
mSearchAction
(
0
)
,
mUniboardMainWindow
(
uniboardMainWindow
)
,
mWebToolBar
(
0
)
{
qDebug
()
<<
"Height: "
<<
this
->
height
();
qDebug
()
<<
"width: "
<<
this
->
width
();
QWebSettings
*
defaultSettings
=
QWebSettings
::
globalSettings
();
defaultSettings
->
setAttribute
(
QWebSettings
::
JavascriptEnabled
,
true
);
defaultSettings
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
...
...
@@ -110,8 +107,7 @@ WBBrowserWindow::WBBrowserWindow(QWidget *parent, Ui::MainWindow* uniboardMainWi
this
->
setLayout
(
layout
);
connect
(
mTabWidget
,
SIGNAL
(
loadPage
(
const
QString
&
)),
this
,
SLOT
(
loadPage
(
const
QString
&
)));
connect
(
mTabWidget
,
SIGNAL
(
loadPage
(
const
QString
&
)),
this
,
SLOT
(
loadPage
(
const
QString
&
)));
connect
(
mTabWidget
,
SIGNAL
(
setCurrentTitle
(
const
QString
&
)),
this
,
SLOT
(
slotUpdateWindowTitle
(
const
QString
&
)));
...
...
@@ -122,12 +118,7 @@ WBBrowserWindow::WBBrowserWindow(QWidget *parent, Ui::MainWindow* uniboardMainWi
connect
(
mTabWidget
,
SIGNAL
(
loadFinished
(
bool
)),
this
,
SIGNAL
(
activeViewPageChanged
()));
connect
(
mTabWidget
,
SIGNAL
(
lastTabClosed
()),
mTabWidget
,
SLOT
(
newTab
()));
connect
(
mTabWidget
,
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)),
this
,
SLOT
(
geometryChangeRequested
(
const
QRect
&
)));
connect
(
mTabWidget
,
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)),
this
,
SLOT
(
geometryChangeRequested
(
const
QRect
&
)));
slotUpdateWindowTitle
();
...
...
@@ -141,7 +132,15 @@ WBBrowserWindow::WBBrowserWindow(QWidget *parent, Ui::MainWindow* uniboardMainWi
WBBrowserWindow
::~
WBBrowserWindow
()
{
// NOOP
if
(
mTabWidget
){
delete
mTabWidget
;
mTabWidget
=
NULL
;
}
if
(
mSearchToolBar
){
delete
mSearchToolBar
;
mSearchToolBar
=
NULL
;
}
}
...
...
src/web/browser/WBTabWidget.cpp
View file @
e6a2b419
...
...
@@ -87,8 +87,7 @@ WBTabBar::WBTabBar(QWidget *parent)
connect
(
shortCut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
selectTabAction
()));
}
setTabsClosable
(
true
);
connect
(
this
,
SIGNAL
(
tabCloseRequested
(
int
)),
this
,
SIGNAL
(
closeTab
(
int
)));
connect
(
this
,
SIGNAL
(
tabCloseRequested
(
int
)),
this
,
SIGNAL
(
closeTab
(
int
)));
setSelectionBehaviorOnRemove
(
QTabBar
::
SelectPreviousTab
);
setMovable
(
true
);
setDocumentMode
(
false
);
...
...
@@ -116,26 +115,23 @@ void WBTabBar::contextMenuRequested(const QPoint &position)
menu
.
addAction
(
tr
(
"New &Tab"
),
this
,
SIGNAL
(
newTab
()),
QKeySequence
::
AddTab
);
int
index
=
tabAt
(
position
);
if
(
-
1
!=
index
)
{
QAction
*
action
=
menu
.
addAction
(
tr
(
"Clone Tab"
),
this
,
SLOT
(
cloneTab
()));
QAction
*
action
=
menu
.
addAction
(
tr
(
"Clone Tab"
),
this
,
SLOT
(
cloneTab
()));
action
->
setData
(
index
);
menu
.
addSeparator
();
action
=
menu
.
addAction
(
tr
(
"&Close Tab"
),
this
,
SLOT
(
closeTab
()),
QKeySequence
::
Close
);
action
=
menu
.
addAction
(
tr
(
"&Close Tab"
),
this
,
SLOT
(
closeTab
()),
QKeySequence
::
Close
);
action
->
setData
(
index
);
action
=
menu
.
addAction
(
tr
(
"Close &Other Tabs"
),
this
,
SLOT
(
closeOtherTabs
()));
action
=
menu
.
addAction
(
tr
(
"Close &Other Tabs"
),
this
,
SLOT
(
closeOtherTabs
()));
action
->
setData
(
index
);
menu
.
addSeparator
();
action
=
menu
.
addAction
(
tr
(
"Reload Tab"
),
this
,
SLOT
(
reloadTab
()),
QKeySequence
::
Refresh
);
action
=
menu
.
addAction
(
tr
(
"Reload Tab"
),
this
,
SLOT
(
reloadTab
()),
QKeySequence
::
Refresh
);
action
->
setData
(
index
);
}
else
{
}
else
{
menu
.
addSeparator
();
}
menu
.
addAction
(
tr
(
"Reload All Tabs"
),
this
,
SIGNAL
(
reloadAllTabs
()));
...
...
@@ -412,45 +408,30 @@ WBWebView *WBTabWidget::newTab(bool makeCurrent)
p
.
setColor
(
QPalette
::
Window
,
palette
().
color
(
QPalette
::
Base
));
emptyWidget
->
setPalette
(
p
);
emptyWidget
->
setAutoFillBackground
(
true
);
disconnect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
currentChanged
(
int
)));
disconnect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
currentChanged
(
int
)));
addTab
(
emptyWidget
,
tr
(
"(Untitled)"
));
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
currentChanged
(
int
)));
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
currentChanged
(
int
)));
return
0
;
}
// webview
WBWebView
*
webView
=
new
WBWebView
;
urlLineEdit
->
setWebView
(
webView
);
connect
(
webView
,
SIGNAL
(
loadStarted
()),
this
,
SLOT
(
webViewLoadStarted
()));
connect
(
webView
,
SIGNAL
(
loadFinished
(
bool
)),
this
,
SLOT
(
webViewIconChanged
()));
connect
(
webView
,
SIGNAL
(
iconChanged
()),
this
,
SLOT
(
webViewIconChanged
()));
connect
(
webView
,
SIGNAL
(
titleChanged
(
const
QString
&
)),
this
,
SLOT
(
webViewTitleChanged
(
const
QString
&
)));
connect
(
webView
,
SIGNAL
(
urlChanged
(
const
QUrl
&
)),
this
,
SLOT
(
webViewUrlChanged
(
const
QUrl
&
)));
connect
(
webView
->
page
(),
SIGNAL
(
windowCloseRequested
()),
this
,
SLOT
(
windowCloseRequested
()));
connect
(
webView
->
page
(),
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)),
this
,
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)));
connect
(
webView
->
page
(),
SIGNAL
(
printRequested
(
QWebFrame
*
)),
this
,
SIGNAL
(
printRequested
(
QWebFrame
*
)));
connect
(
webView
->
page
(),
SIGNAL
(
menuBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
menuBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
->
page
(),
SIGNAL
(
statusBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
statusBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
->
page
(),
SIGNAL
(
toolBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
toolBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
,
SIGNAL
(
pixmapCaptured
(
const
QPixmap
&
,
bool
)),
UBApplication
::
applicationController
,
SLOT
(
addCapturedPixmap
(
const
QPixmap
&
,
bool
)));
connect
(
webView
,
SIGNAL
(
embedCodeCaptured
(
const
QString
&
)),
UBApplication
::
applicationController
,
SLOT
(
addCapturedEmbedCode
(
const
QString
&
)));
connect
(
webView
,
SIGNAL
(
loadStarted
()),
this
,
SLOT
(
webViewLoadStarted
()));
connect
(
webView
,
SIGNAL
(
loadFinished
(
bool
)),
this
,
SLOT
(
webViewIconChanged
()));
connect
(
webView
,
SIGNAL
(
iconChanged
()),
this
,
SLOT
(
webViewIconChanged
()));
connect
(
webView
,
SIGNAL
(
titleChanged
(
const
QString
&
)),
this
,
SLOT
(
webViewTitleChanged
(
const
QString
&
)));
connect
(
webView
,
SIGNAL
(
urlChanged
(
const
QUrl
&
)),
this
,
SLOT
(
webViewUrlChanged
(
const
QUrl
&
)));
connect
(
webView
->
page
(),
SIGNAL
(
windowCloseRequested
()),
this
,
SLOT
(
windowCloseRequested
()));
connect
(
webView
->
page
(),
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)),
this
,
SIGNAL
(
geometryChangeRequested
(
const
QRect
&
)));
connect
(
webView
->
page
(),
SIGNAL
(
printRequested
(
QWebFrame
*
)),
this
,
SIGNAL
(
printRequested
(
QWebFrame
*
)));
connect
(
webView
->
page
(),
SIGNAL
(
menuBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
menuBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
->
page
(),
SIGNAL
(
statusBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
statusBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
->
page
(),
SIGNAL
(
toolBarVisibilityChangeRequested
(
bool
)),
this
,
SIGNAL
(
toolBarVisibilityChangeRequested
(
bool
)));
connect
(
webView
,
SIGNAL
(
pixmapCaptured
(
const
QPixmap
&
,
bool
)),
UBApplication
::
applicationController
,
SLOT
(
addCapturedPixmap
(
const
QPixmap
&
,
bool
)));
connect
(
webView
,
SIGNAL
(
embedCodeCaptured
(
const
QString
&
)),
UBApplication
::
applicationController
,
SLOT
(
addCapturedEmbedCode
(
const
QString
&
)));
addTab
(
webView
,
tr
(
"(Untitled)"
));
if
(
makeCurrent
)
...
...
@@ -465,7 +446,6 @@ WBWebView *WBTabWidget::newTab(bool makeCurrent)
if
(
count
()
==
1
)
currentChanged
(
currentIndex
());
emit
tabsChanged
();
return
webView
;
}
...
...
@@ -553,13 +533,13 @@ void WBTabWidget::closeTab(int index)
removeTab
(
index
);
webView
->
deleteLater
();
emit
tabsChanged
();
if
(
hasFocus
&&
count
()
>
0
)
currentWebView
()
->
setFocus
();
if
(
count
()
==
0
)
emit
lastTabClosed
();
if
(
count
()
==
0
){
newTab
();
emit
currentChanged
(
0
);
}
}
void
WBTabWidget
::
webViewLoadStarted
()
...
...
@@ -616,7 +596,6 @@ void WBTabWidget::webViewUrlChanged(const QUrl &url)
{
mTabBar
->
setTabData
(
index
,
url
);
}
emit
tabsChanged
();
// web view does not reload sometime on OSX ... force it
webView
->
show
();
...
...
src/web/browser/WBTabWidget.h
View file @
e6a2b419
...
...
@@ -143,8 +143,6 @@ class WBTabWidget : public QTabWidget
signals
:
// tab widget signals
void
loadPage
(
const
QString
&
url
);
void
tabsChanged
();
void
lastTabClosed
();
// current tab signals
void
setCurrentTitle
(
const
QString
&
url
);
...
...
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