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
62288077
Commit
62288077
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
trying to fix opening files through Mac finder
parent
983638db
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Common/Gmsh.cpp
+5
-1
5 additions, 1 deletion
Common/Gmsh.cpp
Common/OpenFile.cpp
+6
-2
6 additions, 2 deletions
Common/OpenFile.cpp
Fltk/FlGui.cpp
+2
-1
2 additions, 1 deletion
Fltk/FlGui.cpp
Fltk/FlGui.h
+6
-3
6 additions, 3 deletions
Fltk/FlGui.h
demos/indheat.geo
+10
-10
10 additions, 10 deletions
demos/indheat.geo
with
29 additions
and
17 deletions
Common/Gmsh.cpp
+
5
−
1
View file @
62288077
...
@@ -216,7 +216,7 @@ int GmshFLTK(int argc, char **argv)
...
@@ -216,7 +216,7 @@ int GmshFLTK(int argc, char **argv)
FlGui
::
instance
()
->
check
();
FlGui
::
instance
()
->
check
();
// open project file and merge all other input files
// open project file and merge all other input files
if
(
!
FlGui
::
instance
()
->
getOpenedThroughMacFinder
()){
if
(
FlGui
::
getOpenedThroughMacFinder
()
.
empty
()
){
OpenProject
(
GModel
::
current
()
->
getFileName
());
OpenProject
(
GModel
::
current
()
->
getFileName
());
for
(
unsigned
int
i
=
1
;
i
<
CTX
::
instance
()
->
files
.
size
();
i
++
){
for
(
unsigned
int
i
=
1
;
i
<
CTX
::
instance
()
->
files
.
size
();
i
++
){
if
(
CTX
::
instance
()
->
files
[
i
]
==
"-new"
){
if
(
CTX
::
instance
()
->
files
[
i
]
==
"-new"
){
...
@@ -227,6 +227,10 @@ int GmshFLTK(int argc, char **argv)
...
@@ -227,6 +227,10 @@ int GmshFLTK(int argc, char **argv)
MergeFile
(
CTX
::
instance
()
->
files
[
i
]);
MergeFile
(
CTX
::
instance
()
->
files
[
i
]);
}
}
}
}
else
{
Msg
::
Info
(
"AAAAAAAAAAAAAAAAAAAAA
\n
"
);
OpenProject
(
FlGui
::
getOpenedThroughMacFinder
());
}
if
(
CTX
::
instance
()
->
post
.
combineTime
){
if
(
CTX
::
instance
()
->
post
.
combineTime
){
PView
::
combine
(
true
,
2
,
CTX
::
instance
()
->
post
.
combineRemoveOrig
);
PView
::
combine
(
true
,
2
,
CTX
::
instance
()
->
post
.
combineRemoveOrig
);
...
...
This diff is collapsed.
Click to expand it.
Common/OpenFile.cpp
+
6
−
2
View file @
62288077
...
@@ -634,8 +634,12 @@ void OpenProject(const std::string &fileName)
...
@@ -634,8 +634,12 @@ void OpenProject(const std::string &fileName)
void
OpenProjectMacFinder
(
const
char
*
fileName
)
void
OpenProjectMacFinder
(
const
char
*
fileName
)
{
{
#if defined(HAVE_FLTK)
#if defined(HAVE_FLTK)
if
(
FlGui
::
available
()){
if
(
!
FlGui
::
available
()){
FlGui
::
instance
()
->
setOpenedThroughMacFinder
(
true
);
// Gmsh is not ready: will open the file later
FlGui
::
setOpenedThroughMacFinder
(
fileName
);
}
else
if
(
FlGui
::
available
()){
// Gmsh is running
OpenProject
(
fileName
);
OpenProject
(
fileName
);
drawContext
::
global
()
->
draw
();
drawContext
::
global
()
->
draw
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/FlGui.cpp
+
2
−
1
View file @
62288077
...
@@ -197,7 +197,7 @@ static int globalShortcut(int event)
...
@@ -197,7 +197,7 @@ static int globalShortcut(int event)
return
FlGui
::
instance
()
->
testGlobalShortcuts
(
event
);
return
FlGui
::
instance
()
->
testGlobalShortcuts
(
event
);
}
}
FlGui
::
FlGui
(
int
argc
,
char
**
argv
)
:
_openedThroughMacFinder
(
false
)
FlGui
::
FlGui
(
int
argc
,
char
**
argv
)
{
{
// set X display
// set X display
if
(
CTX
::
instance
()
->
display
.
size
())
if
(
CTX
::
instance
()
->
display
.
size
())
...
@@ -306,6 +306,7 @@ FlGui::FlGui(int argc, char **argv) : _openedThroughMacFinder(false)
...
@@ -306,6 +306,7 @@ FlGui::FlGui(int argc, char **argv) : _openedThroughMacFinder(false)
}
}
FlGui
*
FlGui
::
_instance
=
0
;
FlGui
*
FlGui
::
_instance
=
0
;
std
::
string
FlGui
::
_openedThroughMacFinder
=
""
;
FlGui
*
FlGui
::
instance
(
int
argc
,
char
**
argv
)
FlGui
*
FlGui
::
instance
(
int
argc
,
char
**
argv
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Fltk/FlGui.h
+
6
−
3
View file @
62288077
...
@@ -43,7 +43,7 @@ class MElement;
...
@@ -43,7 +43,7 @@ class MElement;
class
FlGui
{
class
FlGui
{
private:
private:
static
FlGui
*
_instance
;
static
FlGui
*
_instance
;
bool
_openedThroughMacFinder
;
static
std
::
string
_openedThroughMacFinder
;
public:
public:
std
::
vector
<
GVertex
*>
selectedVertices
;
std
::
vector
<
GVertex
*>
selectedVertices
;
std
::
vector
<
GEdge
*>
selectedEdges
;
std
::
vector
<
GEdge
*>
selectedEdges
;
...
@@ -80,8 +80,11 @@ class FlGui{
...
@@ -80,8 +80,11 @@ class FlGui{
// wait (at most time seconds) for any events, then process them
// wait (at most time seconds) for any events, then process them
static
void
wait
(
double
time
);
static
void
wait
(
double
time
);
// is a file opened through the Mac Finder?
// is a file opened through the Mac Finder?
void
setOpenedThroughMacFinder
(
bool
val
){
_openedThroughMacFinder
=
val
;
}
static
void
setOpenedThroughMacFinder
(
const
std
::
string
&
name
)
bool
getOpenedThroughMacFinder
(){
return
_openedThroughMacFinder
;
}
{
_openedThroughMacFinder
=
name
;
}
static
std
::
string
getOpenedThroughMacFinder
(){
return
_openedThroughMacFinder
;
}
// test application-level keyboard shortcuts
// test application-level keyboard shortcuts
int
testGlobalShortcuts
(
int
event
);
int
testGlobalShortcuts
(
int
event
);
// test the arrow shortcuts (not in the application-level shortcuts)
// test the arrow shortcuts (not in the application-level shortcuts)
...
...
This diff is collapsed.
Click to expand it.
demos/indheat.geo
+
10
−
10
View file @
62288077
...
@@ -3,17 +3,17 @@ nn = 40; // mesh subdivisions per turn
...
@@ -3,17 +3,17 @@ nn = 40; // mesh subdivisions per turn
DefineConstant
DefineConstant
[
[
turns
=
{
5
,
Label
"Number of coil turns"
},
turns
=
{
5
,
Label
"Number of coil turns"
,
Path
"Parameters"
},
r
=
{
0.11
,
Label
"Coil radius"
},
r
=
{
0.11
,
Label
"Coil radius"
,
Path
"Parameters"
},
rc
=
{
0.01
,
Label
"Coil wire radius"
},
rc
=
{
0.01
,
Label
"Coil wire radius"
,
Path
"Parameters"
},
hc
=
{
0.25
,
Label
"Coil height"
},
hc
=
{
0.25
,
Label
"Coil height"
,
Path
"Parameters"
},
ht
=
{
0.4
,
Label
"Tube height"
},
ht
=
{
0.4
,
Label
"Tube height"
,
Path
"Parameters"
},
rt1
=
{
0.075
,
Label
"Tube internal radius"
},
rt1
=
{
0.075
,
Label
"Tube internal radius"
,
Path
"Parameters"
},
rt2
=
{
0.092
,
Label
"Tube external radius"
},
rt2
=
{
0.092
,
Label
"Tube external radius"
,
Path
"Parameters"
},
lb
=
{
1
,
Label
"Infinite box width"
},
lb
=
{
1
,
Label
"Infinite box width"
,
Path
"Parameters"
},
left
=
{
1
,
Choices
{
0
,
1
},
Label
"Terminals on the left?"
}
left
=
{
1
,
Choices
{
0
,
1
},
Label
"Terminals on the left?"
,
Path
"Parameters"
}
//macro = {"aa.pos", Label "Run my macro!", Kind "macro", Path "Actions"},
//macro = {"aa.pos", Label "Run my macro!", Kind "macro", Path "Actions"},
showLines
=
{
1
,
Choices
{
0
,
1
},
Label
"Show lines?"
}
showLines
=
{
1
,
Choices
{
0
,
1
},
Label
"Show lines?"
,
Path
"Options"
}
];
];
Geometry
.
Lines
=
showLines
;
Geometry
.
Lines
=
showLines
;
...
...
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