Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
0bafbfc7
Commit
0bafbfc7
authored
Dec 3, 2003
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Better web browser command for Unix + generalized call (permit multiple '%s').
parent
14569d0f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/DefaultOptions.h
+3
-3
3 additions, 3 deletions
Common/DefaultOptions.h
Fltk/Callbacks.cpp
+29
-5
29 additions, 5 deletions
Fltk/Callbacks.cpp
with
32 additions
and
8 deletions
Common/DefaultOptions.h
+
3
−
3
View file @
0bafbfc7
...
...
@@ -64,7 +64,7 @@ StringXString GeneralOptions_String[] = {
#else
"emacs %s &"
,
#endif
"System command to launch a text editor
(OS-dependent)
"
},
"System command to launch a text editor"
},
{
F
|
S
,
"TmpFileName"
,
opt_general_tmp_filename
,
".gmsh-tmp"
,
"Temporary file used by the geometry module"
},
...
...
@@ -74,9 +74,9 @@ StringXString GeneralOptions_String[] = {
#elif defined(__APPLE__)
"open %s"
,
#else
"mozilla %s &"
,
"
if [[ $(ps -e|grep mozilla|grep -v grep) ]]; then mozilla -remote 'openurl(%s)' ; else
mozilla %s
; fi
&"
,
#endif
"System command to launch a web browser
(OS-dependent)
"
},
"System command to launch a web browser"
},
{
0
,
NULL
,
NULL
,
NULL
,
NULL
}
}
;
...
...
This diff is collapsed.
Click to expand it.
Fltk/Callbacks.cpp
+
29
−
5
View file @
0bafbfc7
// $Id: Callbacks.cpp,v 1.19
2
2003-12-03
04:28:18
geuzaine Exp $
// $Id: Callbacks.cpp,v 1.19
3
2003-12-03
22:17:49
geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -1495,11 +1495,36 @@ void help_about_cb(CALLBACK_ARGS)
WID
->
create_about_window
();
}
void
_replace_multi_format
(
char
*
in
,
char
*
val
,
char
*
out
){
int
i
=
0
,
j
=
0
;
out
[
0
]
=
'\0'
;
while
(
i
<
strlen
(
in
)){
if
(
in
[
i
]
==
'%'
&&
i
!=
strlen
(
in
)
-
1
){
if
(
in
[
i
+
1
]
==
's'
){
strcat
(
out
,
val
);
i
+=
2
;
j
+=
strlen
(
val
);
}
else
{
Msg
(
WARNING
,
"Skipping unknown format '%%%c' in '%s'"
,
in
[
i
+
1
],
in
);
i
+=
2
;
}
}
else
{
out
[
j
]
=
in
[
i
];
out
[
j
+
1
]
=
'\0'
;
i
++
;
j
++
;
}
}
out
[
j
]
=
'\0'
;
}
void
help_online_cb
(
CALLBACK_ARGS
)
{
char
cmd
[
1000
];
sprintf
(
cmd
,
CTX
.
web_browser
,
"http://www.geuz.org/gmsh/doc/texinfo/"
);
Msg
(
INFO
,
"Starting web browser '%s'"
,
cmd
);
_replace_multi_format
(
CTX
.
web_browser
,
"http://www.geuz.org/gmsh/doc/texinfo/"
,
cmd
);
SystemCall
(
cmd
);
}
...
...
@@ -1550,8 +1575,7 @@ void geometry_physical_cb(CALLBACK_ARGS)
void
geometry_edit_cb
(
CALLBACK_ARGS
)
{
char
cmd
[
1000
];
sprintf
(
cmd
,
CTX
.
editor
,
CTX
.
filename
);
Msg
(
INFO
,
"Starting text editor '%s'"
,
cmd
);
_replace_multi_format
(
CTX
.
editor
,
CTX
.
filename
,
cmd
);
SystemCall
(
cmd
);
}
...
...
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