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
7ab39b10
Commit
7ab39b10
authored
6 years ago
by
Sergey Linev
Committed by
Axel Naumann
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
webgui: formatting andf better variables names, more comments
parent
c224b9b6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gui/webdisplay/src/TWebWindowsManager.cxx
+24
-17
24 additions, 17 deletions
gui/webdisplay/src/TWebWindowsManager.cxx
with
24 additions
and
17 deletions
gui/webdisplay/src/TWebWindowsManager.cxx
+
24
−
17
View file @
7ab39b10
...
...
@@ -398,11 +398,16 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
enum
{
kNative
,
kLocal
,
kChrome
,
kFirefox
,
kCEF
,
kQt5
}
kind
=
kNative
;
if
(
where
==
"local"
)
kind
=
kLocal
;
else
if
(
where
==
"firefox"
)
kind
=
kFirefox
;
else
if
((
where
==
"chrome"
)
||
(
where
==
"chromium"
))
kind
=
kChrome
;
else
if
(
where
==
"cef"
)
kind
=
kCEF
;
else
if
(
where
==
"qt5"
)
kind
=
kQt5
;
if
(
where
==
"local"
)
kind
=
kLocal
;
else
if
(
where
==
"firefox"
)
kind
=
kFirefox
;
else
if
((
where
==
"chrome"
)
||
(
where
==
"chromium"
))
kind
=
kChrome
;
else
if
(
where
==
"cef"
)
kind
=
kCEF
;
else
if
(
where
==
"qt5"
)
kind
=
kQt5
;
#ifdef R__HAS_CEFWEB
...
...
@@ -576,15 +581,15 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
#endif
if
((
kind
==
kFirefox
)
&&
(
exec
.
Index
(
"$profile"
)
!=
kNPOS
))
{
TString
repl
;
TString
profile_arg
;
const
char
*
ff_profile
=
gEnv
->
GetValue
(
"WebGui.FirefoxProfile"
,
""
);
const
char
*
ff_profilepath
=
gEnv
->
GetValue
(
"WebGui.FirefoxProfilePath"
,
""
);
Int_t
ff_randomprofile
=
gEnv
->
GetValue
(
"WebGui.FirefoxRandomProfile"
,
0
);
if
(
ff_profile
&&
*
ff_profile
)
{
repl
.
Form
(
"-P %s"
,
ff_profile
);
profile_arg
.
Form
(
"-P %s"
,
ff_profile
);
}
else
if
(
ff_profilepath
&&
*
ff_profilepath
)
{
repl
.
Form
(
"-profile %s"
,
ff_profilepath
);
profile_arg
.
Form
(
"-profile %s"
,
ff_profilepath
);
}
else
if
((
ff_randomprofile
>
0
)
||
(
batch_mode
&&
(
ff_randomprofile
>=
0
)))
{
gRandom
->
SetSeed
(
0
);
...
...
@@ -592,15 +597,15 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
TString
rnd_profile
=
TString
::
Format
(
"root_ff_profile_%d"
,
gRandom
->
Integer
(
0x100000
));
TString
profile_dir
=
TString
::
Format
(
"%s/%s"
,
gSystem
->
TempDirectory
(),
rnd_profile
.
Data
());
repl
.
Form
(
"-profile %s"
,
profile_dir
.
Data
());
if
(
!
batch_mode
)
repl
.
Prepend
(
"-no-remote "
);
profile_arg
.
Form
(
"-profile %s"
,
profile_dir
.
Data
());
if
(
!
batch_mode
)
profile_arg
.
Prepend
(
"-no-remote "
);
gSystem
->
Exec
(
Form
(
"%s -no-remote -CreateProfile
\"
%s %s
\"
"
,
prog
.
Data
(),
rnd_profile
.
Data
(),
profile_dir
.
Data
()));
rmdir
=
std
::
string
(
"$rmdir$"
)
+
profile_dir
.
Data
();
}
exec
.
ReplaceAll
(
"$profile"
,
repl
.
Data
());
exec
.
ReplaceAll
(
"$profile"
,
profile_arg
.
Data
());
}
}
...
...
@@ -647,8 +652,10 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
#if !defined(_MSC_VER)
std
::
unique_ptr
<
TObjArray
>
args
(
exec
.
Tokenize
(
" "
));
if
(
!
args
||
(
args
->
GetLast
()
<=
0
))
if
(
!
args
||
(
args
->
GetLast
()
<=
0
))
{
R__ERROR_HERE
(
"WebDisplay"
)
<<
"Fork instruction is empty"
;
return
0
;
}
std
::
vector
<
char
*>
argv
;
argv
.
push_back
((
char
*
)
prog
.
Data
());
...
...
@@ -705,7 +712,7 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
unsigned
connid
=
win
.
AddProcId
(
batch_mode
,
key
,
where
+
rmdir
);
// for now just application name
R__DEBUG_HERE
(
"WebDisplay"
)
<<
"Show web window in browser with:
\n
"
<<
exec
;
R__DEBUG_HERE
(
"WebDisplay"
)
<<
"Show
ing
web window in browser with:
\n
"
<<
exec
;
#ifdef _MSC_VER
_spawnv
(
_P_NOWAIT
,
prog
.
Data
(),
argv
.
data
());
...
...
@@ -722,7 +729,8 @@ unsigned ROOT::Experimental::TWebWindowsManager::Show(ROOT::Experimental::TWebWi
void
ROOT
::
Experimental
::
TWebWindowsManager
::
HaltClient
(
const
std
::
string
&
procid
)
{
std
::
string
arg
=
procid
,
tmpdir
;
std
::
string
arg
=
procid
;
std
::
string
tmpdir
;
auto
pos
=
arg
.
find
(
"$rmdir$"
);
if
(
pos
!=
std
::
string
::
npos
)
{
...
...
@@ -764,7 +772,8 @@ void ROOT::Experimental::TWebWindowsManager::HaltClient(const std::string &proci
int
ROOT
::
Experimental
::
TWebWindowsManager
::
WaitFor
(
TWebWindow
&
win
,
WebWindowWaitFunc_t
check
,
bool
timed
,
double
timelimit
)
{
int
res
(
0
),
cnt
(
0
);
int
res
=
0
;
int
cnt
=
0
;
double
spent
=
0
;
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
...
...
@@ -790,8 +799,6 @@ int ROOT::Experimental::TWebWindowsManager::WaitFor(TWebWindow &win, WebWindowWa
cnt
++
;
}
// R__DEBUG_HERE("WebDisplay") << "Waiting result " << res << " spent time " << spent << " ntry " << cnt;
return
res
;
}
...
...
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