-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfpm-menu.tcl
97 lines (80 loc) · 2.1 KB
/
fpm-menu.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# fpm-menu.tcl --
# Implement the menu items
#
# showInformation
# Show the general information on fpm
#
# Arguments:
# None
proc showInformation {} {
global fpmInformation
showPkgInformation 0
tk_messageBox -icon info -type ok -title "Fpm - Fortran package manager" \
-message "The package manager is found at $fpmInformation"
}
# showAboutBox
# Show the general information on fpm
#
# Arguments:
# None
proc showAboutBox {} {
global fpmGuiVersion
global fpmCommand
set fpmVersion [exec $fpmCommand --version]
tk_messageBox -icon info -type ok -title "Fpm - Fortran package manager" \
-message \
"$fpmVersion\n
GUI version: $fpmGuiVersion"
}
# saveProfile --
# Save the settings in a profile file
#
# Arguments:
# new Whether to save under a new name or not
#
proc saveProfile {new} {
global profileName
global installDir
global checkoutDir
global registryDir
global compiler
global compilerProfile
if { $new || $profileName == "" } {
set newProfileName [tk_getSaveFile -title "Save profile as ..." -filetypes [list {{fpm profile} {.profile}}] -initialfile $profileName]
if { $newProfileName != "" } {
set profileName $newProfileName
}
}
set outfile [open $profileName w]
foreach value {installDir checkoutDir registryDir } {
puts $outfile "set $value [file normalize [set $value]]"
}
foreach value {compiler compilerProfile} {
puts $outfile "set $value [set $value]"
}
close $outfile
}
# openProfile --
# Open an existing profile file
#
# Arguments:
# None
#
proc openProfile {} {
global profileName
set newProfileName [tk_getOpenFile -title "Open profile" -filetypes [list {{fpm profile} {.profile}}] -initialfile $profileName]
if { $newProfileName != "" } {
set profileName $newProfileName
source $profileName
}
}
# newProfile --
# Create a new profile file
#
# Arguments:
# None
#
proc newProfile {} {
global profileName
set profileName "" ;# Force a Save to bring up a dialogue
}