Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
a6bd9f6e
Commit
a6bd9f6e
authored
6 years ago
by
Sergey Linev
Browse files
Options
Downloads
Patches
Plain Diff
webgui: let configure URL options via RWebDisplayArgs constructor
parent
d915f318
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx
+23
-4
23 additions, 4 deletions
gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx
gui/webdisplay/src/RWebDisplayArgs.cxx
+10
-0
10 additions, 0 deletions
gui/webdisplay/src/RWebDisplayArgs.cxx
with
33 additions
and
4 deletions
gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx
+
23
−
4
View file @
a6bd9f6e
...
...
@@ -43,7 +43,7 @@ protected:
bool
fHeadless
{
false
};
///<! is browser runs in headless mode
THttpServer
*
fServer
{
nullptr
};
///<! http server which handle all requests
int
fWidth
{
0
};
///<! custom window width, when not specified - used RWebWindow geometry
int
fHeight
{
0
};
///<! custom window
width
, when not specified - used RWebWindow geometry
int
fHeight
{
0
};
///<! custom window
height
, when not specified - used RWebWindow geometry
std
::
string
fUrlOpt
;
///<! extra URL options, which are append to window URL
std
::
string
fExec
;
///<! string to run browser, used with kCustom type
void
*
fDriverData
{
nullptr
};
///<! special data delivered to driver, can be used for QWebEngine
...
...
@@ -56,7 +56,9 @@ public:
RWebDisplayArgs
(
const
char
*
browser
);
void
SetBrowserKind
(
const
std
::
string
&
kind
);
/// set browser kind, see EBrowserKind for allowed values
void
SetBrowserKind
(
EBrowserKind
kind
)
{
fKind
=
kind
;
}
/// returns configured browser kind, see EBrowserKind for supported values
EBrowserKind
GetBrowserKind
()
const
{
return
fKind
;
}
std
::
string
GetBrowserName
()
const
;
...
...
@@ -72,35 +74,52 @@ public:
return
(
GetBrowserKind
()
==
kNative
)
||
(
GetBrowserKind
()
==
kFirefox
)
||
(
GetBrowserKind
()
==
kChrome
);
}
/// set window url
void
SetUrl
(
const
std
::
string
&
url
)
{
fUrl
=
url
;
}
/// returns window url
std
::
string
GetUrl
()
const
{
return
fUrl
;
}
/// set window url options
void
SetUrlOpt
(
const
std
::
string
&
opt
)
{
fUrlOpt
=
opt
;
}
/// returns window url options
std
::
string
GetUrlOpt
()
const
{
return
fUrlOpt
;
}
/// returns window url with append options
std
::
string
GetFullUrl
()
const
;
/// set headless mode
void
SetHeadless
(
bool
on
=
true
)
{
fHeadless
=
on
;
}
/// returns headless mode
bool
IsHeadless
()
const
{
return
fHeadless
;
}
void
SetHttpServer
(
THttpServer
*
serv
)
{
fServer
=
serv
;
}
THttpServer
*
GetHttpServer
()
const
{
return
fServer
;
}
/// set preferable web window width
void
SetWidth
(
int
w
=
0
)
{
fWidth
=
w
;
}
/// set preferable web window height
void
SetHeight
(
int
h
=
0
)
{
fHeight
=
h
;
}
/// returns preferable web window width
int
GetWidth
()
const
{
return
fWidth
;
}
/// returns preferable web window height
int
GetHeight
()
const
{
return
fHeight
;
}
/// set custom executable to start web browser
void
SetCustomExec
(
const
std
::
string
&
exec
)
{
SetBrowserKind
(
kCustom
);
fExec
=
exec
;
}
/// returns custom executable to start web browser
std
::
string
GetCustomExec
()
const
{
return
GetBrowserKind
()
==
kCustom
?
fExec
:
""
;
}
/// set http server instance, used for window display
void
SetHttpServer
(
THttpServer
*
serv
)
{
fServer
=
serv
;
}
/// returns http server instance, used for window display
THttpServer
*
GetHttpServer
()
const
{
return
fServer
;
}
/// [internal] set web-driver data, used to start window
void
SetDriverData
(
void
*
data
)
{
fDriverData
=
data
;
}
/// [internal] returns web-driver data, used to start window
void
*
GetDriverData
()
const
{
return
fDriverData
;
}
};
...
...
This diff is collapsed.
Click to expand it.
gui/webdisplay/src/RWebDisplayArgs.cxx
+
10
−
0
View file @
a6bd9f6e
...
...
@@ -53,6 +53,13 @@ ROOT::Experimental::RWebDisplayArgs::RWebDisplayArgs(const char *browser)
void
ROOT
::
Experimental
::
RWebDisplayArgs
::
SetBrowserKind
(
const
std
::
string
&
_kind
)
{
std
::
string
kind
=
_kind
;
auto
pos
=
kind
.
find
(
"?"
);
if
(
pos
==
0
)
{
SetUrlOpt
(
kind
.
substr
(
1
));
kind
.
clear
();
}
if
(
kind
.
empty
())
kind
=
gROOT
->
GetWebDisplay
().
Data
();
...
...
@@ -72,6 +79,9 @@ void ROOT::Experimental::RWebDisplayArgs::SetBrowserKind(const std::string &_kin
SetCustomExec
(
kind
);
}
/////////////////////////////////////////////////////////////////////
/// Returns configured browser name
std
::
string
ROOT
::
Experimental
::
RWebDisplayArgs
::
GetBrowserName
()
const
{
switch
(
GetBrowserKind
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment