Project tree: Fix profile popup menu.
[DEVELOPMENT ENVIRONMENT] * BUG: Project tree: Fix profile popup menu. * NEW: File property dialog: Take profile files into account. * NEW: Update French translation. * BUG: Fix file header text in the message of confirmation dialogs.
This commit is contained in:
parent
0ab20519da
commit
2b63368921
6 changed files with 351 additions and 262 deletions
File diff suppressed because it is too large
Load diff
|
@ -49,6 +49,12 @@ Public Sub fprInfo_Data()
|
|||
Return
|
||||
Endif
|
||||
|
||||
Else If Project.IsProfilePath(sPath) Then
|
||||
|
||||
Try fprInfo.Data.Icon = Project.GetFileIcon(sPath, 64)
|
||||
fprInfo.Data.Type = ("Gambas profile file")
|
||||
Return
|
||||
|
||||
Endif
|
||||
|
||||
Stop Event
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
}
|
||||
{ HBox1 HBox
|
||||
MoveScaled(1,46,40,6)
|
||||
Centered = True
|
||||
Margin = True
|
||||
Invert = True
|
||||
{ btnClose Button
|
||||
MoveScaled(12,0,16,4)
|
||||
Text = ("Close")
|
||||
|
|
|
@ -316,6 +316,8 @@ Public Sub tvwProject_Menu()
|
|||
|
||||
If $sKey = Project.KEY_CONNECTION Or If Project.IsConnectionPath($sKey) Then
|
||||
mnuDatabase.Popup
|
||||
Else If $sKey = Project.KEY_PROFILE Or If Project.IsProfilePath($sKey) Then
|
||||
mnuProfile.Popup
|
||||
Else
|
||||
|
||||
If Left($sKey) <> "$" And If Not Exist($sKey) Then
|
||||
|
@ -535,9 +537,34 @@ Public Sub mnuPopup_Show()
|
|||
|
||||
Endif
|
||||
|
||||
Else If sRoot = Project.KEY_PROFILE Then
|
||||
|
||||
mnuNew.Hide
|
||||
mnuImportFile.Hide
|
||||
mnuRenameFile.Hide
|
||||
mnuDeleteFile.Visible = CanDelete(sCurrent)
|
||||
mnuStartup.Hide
|
||||
mnuRunThat.Hide
|
||||
mnuDoNotTranslate.Hide
|
||||
mnuCompressFile.Hide
|
||||
mnuCut.Hide
|
||||
mnuCopy.Hide
|
||||
mnuPaste.Hide
|
||||
|
||||
Else
|
||||
|
||||
If sRoot = Project.KEY_EXTERN Or If sRoot Begins "/" Then
|
||||
' If sRoot = Project.KEY_EXTERN Or If sRoot Begins "/" Or If sRoot = Project.KEY_PROFILE Then
|
||||
' mnuNew.Hide
|
||||
' mnuImportFile.Hide
|
||||
' Endif
|
||||
|
||||
If $sKey = Project.KEY_MISC Or If $sKey = Project.KEY_PROJECT Or If $sKey = Project.KEY_PUBLIC Then
|
||||
bCanStoreFile = True '$sKey = Project.KEY_MISC Or $sKey = Project.KEY_PROJECT
|
||||
Else
|
||||
bCanStoreFile = False
|
||||
Endif
|
||||
|
||||
If Not bCanStoreFile Then
|
||||
mnuNew.Hide
|
||||
mnuImportFile.Hide
|
||||
Endif
|
||||
|
@ -555,14 +582,8 @@ Public Sub mnuPopup_Show()
|
|||
mnuEditFile.Visible = mnuEditFile.Visible And CanEdit(sCurrent)
|
||||
mnuEditClass.Visible = False
|
||||
|
||||
mnuStartup.Visible = False
|
||||
mnuRunThat.Visible = False
|
||||
|
||||
If $sKey = Project.KEY_MISC Or If $sKey = Project.KEY_PROJECT Or If $sKey = Project.KEY_PUBLIC Then
|
||||
bCanStoreFile = True '$sKey = Project.KEY_MISC Or $sKey = Project.KEY_PROJECT
|
||||
Else
|
||||
bCanStoreFile = False
|
||||
Endif
|
||||
mnuStartup.Hide
|
||||
mnuRunThat.Hide
|
||||
|
||||
mnuDoNotTranslate.Hide
|
||||
|
||||
|
@ -689,6 +710,22 @@ Public Sub mnuDatabase_Show()
|
|||
|
||||
End
|
||||
|
||||
Public Sub mnuProfile_Show()
|
||||
|
||||
Dim bVisible As Boolean
|
||||
|
||||
bVisible = $sKey <> Project.KEY_PROFILE
|
||||
|
||||
mnuEditProfile.Visible = bVisible
|
||||
mnuDeleteProfile.Visible = bVisible
|
||||
mnuInfoProfile.Show
|
||||
|
||||
mnuRemoveAllProfile.Visible = Not bVisible
|
||||
|
||||
UpdateRecentFile(mnuOpenRecentFile3)
|
||||
|
||||
End
|
||||
|
||||
Private Function FormatFile(sPath As String) As String
|
||||
|
||||
Dim sText As String
|
||||
|
@ -1518,7 +1555,7 @@ Public Sub OnProjectChange()
|
|||
' mnuUseTerminal.Value = Design.UseTerminal
|
||||
' mnuRedirectStderr.Value = Design.RedirectStderr
|
||||
' mnuUseHttpServer.Value = Design.UseHttpServer
|
||||
mnuProfile.Value = Project.Config["/Debug/Profiling"]
|
||||
mnuEnableProfile.Value = Project.Config["/Debug/Profiling"]
|
||||
mnuDebugInside.Value = Project.Config["/Debug/DebugInside"]
|
||||
|
||||
OnRefreshComponents
|
||||
|
@ -1730,7 +1767,7 @@ Public Sub Action_Activate((Key) As String) As Boolean
|
|||
Try hEditor = Project.ActiveForm
|
||||
If Not Error Then hEditor.RunUntil
|
||||
|
||||
Case "info"
|
||||
Case "info", "info-profile"
|
||||
If tvwProject.Key = Project.Dir Then
|
||||
FProjectProperty.Run() 'Then Project.Refresh
|
||||
Else
|
||||
|
@ -1861,11 +1898,14 @@ End
|
|||
|
||||
Private Sub RefreshMenu()
|
||||
|
||||
GetCurrent
|
||||
GetCurrent()
|
||||
|
||||
If $sKey = Project.KEY_CONNECTION Or If Project.IsConnectionPath($sKey) Then
|
||||
If tvwProject.HasFocus Then Project.SetCurrentPopup(mnuDatabase)
|
||||
mnuDatabase_Show
|
||||
Else If $sKey = Project.KEY_PROFILE Or If Project.IsProfilePath($sKey) Then
|
||||
If tvwProject.HasFocus Then Project.SetCurrentPopup(mnuProfile)
|
||||
mnuProfile_Show
|
||||
Else
|
||||
If tvwProject.HasFocus Then Project.SetCurrentPopup(mnuPopup)
|
||||
mnuPopup_Show
|
||||
|
@ -3650,3 +3690,9 @@ Public Sub mnuVcAddBranch_Click()
|
|||
VersionControl.AddBranch
|
||||
|
||||
End
|
||||
|
||||
Public Sub mnuEditProfile_Click()
|
||||
|
||||
tvwProject_Activate
|
||||
|
||||
End
|
||||
|
|
|
@ -383,7 +383,7 @@
|
|||
}
|
||||
{ Menu48 Menu
|
||||
}
|
||||
{ mnuProfile Menu
|
||||
{ mnuEnableProfile Menu
|
||||
Action = "profile"
|
||||
Text = ("Activate profiling")
|
||||
Toggle = True
|
||||
|
@ -819,11 +819,6 @@
|
|||
Text = ("Compress file")
|
||||
Picture = Picture["icon:/small/compress"]
|
||||
}
|
||||
{ mnuRemoveAllProfile Menu
|
||||
Action = "remove-all-profile"
|
||||
Text = ("Remove all profile files") & "..."
|
||||
Picture = Picture["icon:/small/delete"]
|
||||
}
|
||||
{ Menu56 Menu
|
||||
}
|
||||
{ mnuInfoVC Menu
|
||||
|
@ -833,7 +828,7 @@
|
|||
}
|
||||
{ mnuInformation Menu
|
||||
Action = "info"
|
||||
Text = Shortcut(("Properties"), "P") & "..."
|
||||
Text = ("Properties") & "..."
|
||||
Picture = Picture["icon:/small/info"]
|
||||
Shortcut = "Ctrl+Shift+I"
|
||||
}
|
||||
|
@ -841,7 +836,7 @@
|
|||
{ mnuDatabase Menu
|
||||
Enabled = False
|
||||
{ mnuNewConnection Menu
|
||||
Text = Shortcut(("New connection"), "N") & "..."
|
||||
Text = ("New connection") & "..."
|
||||
Picture = Picture["icon:/small/new"]
|
||||
}
|
||||
{ mnuOpenRecentFile2 Menu
|
||||
|
@ -853,32 +848,59 @@
|
|||
{ Menu17 Menu
|
||||
}
|
||||
{ mnuEditConnection Menu
|
||||
Text = Shortcut(("Open"), "O")
|
||||
Text = ("Open")
|
||||
Picture = Picture["icon:/small/edit"]
|
||||
}
|
||||
{ mnuKillConnection Menu mnuDeleteFile
|
||||
Name = "mnuKillConnection"
|
||||
Text = Shortcut(("Remove"), "R")
|
||||
Text = ("Remove") & "..."
|
||||
Picture = Picture["icon:/small/delete"]
|
||||
Shortcut = "Shift+Del"
|
||||
Shortcut = "Del"
|
||||
}
|
||||
{ Menu25 Menu
|
||||
}
|
||||
{ mnuAddVersionConnection Menu mnuAddVersion
|
||||
Name = "mnuAddVersionConnection"
|
||||
Text = Shortcut(("Add to repository"), "A")
|
||||
Text = ("Add to repository")
|
||||
}
|
||||
{ mnuInfoConnection Menu
|
||||
Text = Shortcut(("Properties"), "P") & "..."
|
||||
Text = ("Properties") & "..."
|
||||
Picture = Picture["icon:/small/info"]
|
||||
Shortcut = "Ctrl+I"
|
||||
}
|
||||
}
|
||||
{ mnuProfile Menu
|
||||
Enabled = False
|
||||
{ mnuOpenRecentFile3 Menu
|
||||
Text = ("Recent")
|
||||
Picture = Picture["icon:/small/recent"]
|
||||
{ Menu59 Menu
|
||||
}
|
||||
}
|
||||
{ Menu26 Menu
|
||||
}
|
||||
{ mnuRefresh3 Menu
|
||||
Action = "refresh-project"
|
||||
Text = Shortcut(("Refresh"), "R")
|
||||
Picture = Picture["icon:/small/refresh"]
|
||||
{ mnuEditProfile Menu
|
||||
Text = ("Open")
|
||||
Picture = Picture["icon:/small/edit"]
|
||||
}
|
||||
{ mnuDeleteProfile Menu mnuDeleteFile
|
||||
Name = "mnuDeleteProfile"
|
||||
Text = ("Remove") & "..."
|
||||
Picture = Picture["icon:/small/delete"]
|
||||
Shortcut = "Del"
|
||||
}
|
||||
{ mnuRemoveAllProfile Menu
|
||||
Action = "remove-all-profile"
|
||||
Text = ("Remove all profile files") & "..."
|
||||
Picture = Picture["icon:/small/delete"]
|
||||
}
|
||||
{ Menu57 Menu
|
||||
}
|
||||
{ mnuInfoProfile Menu
|
||||
Action = "info-profile"
|
||||
Text = ("Properties") & "..."
|
||||
Picture = Picture["icon:/small/info"]
|
||||
Shortcut = "Ctrl+I"
|
||||
}
|
||||
}
|
||||
{ mnuMenu Menu
|
||||
|
@ -1830,6 +1852,11 @@
|
|||
Shortcut = "Ctrl+Shift+I"
|
||||
Picture = "icon:/small/info"
|
||||
}
|
||||
{ Action info-profile
|
||||
Text = "Properties"
|
||||
Shortcut = "Ctrl+I"
|
||||
Picture = "icon:/small/info"
|
||||
}
|
||||
{ Action info-vc
|
||||
Text = "Version control"
|
||||
Shortcut = ""
|
||||
|
@ -1964,7 +1991,7 @@
|
|||
Shortcut = ""
|
||||
}
|
||||
{ Action refresh-project
|
||||
Text = "Refresh"
|
||||
Text = "Refresh project"
|
||||
Shortcut = ""
|
||||
Picture = "icon:/small/refresh"
|
||||
}
|
||||
|
|
|
@ -4791,6 +4791,12 @@ Public Sub IsConnectionPath(sPath As String) As Boolean
|
|||
|
||||
End
|
||||
|
||||
Public Sub IsProfilePath(sPath As String) As Boolean
|
||||
|
||||
Return sPath Begins Project.Dir &/ ".profile/"
|
||||
|
||||
End
|
||||
|
||||
Public Sub IsHiddenPath(sPath As String) As Boolean
|
||||
|
||||
Return sPath Begins Project.Dir &/ ".hidden" &/ "/"
|
||||
|
@ -7101,7 +7107,7 @@ End
|
|||
Public Sub GetMessagePrefix(sPath As String) As String
|
||||
|
||||
If sPath Begins Project.Dir & "/" Then sPath = Mid$(sPath, Len(Project.Dir) + 2)
|
||||
Return "<tt><b>" & Html(sPath) & "</b></tt>\n\n"
|
||||
Return "<tt><b>" & Html(sPath) & "</b></tt>\n"
|
||||
|
||||
End
|
||||
|
||||
|
|
Loading…
Reference in a new issue