Add a menu button to the main toolbar to choose the debug browser.
[DEVELOPMENT ENVIRONMENT] * NEW: Add a menu button to the main toolbar to choose the debug browser. * NEW: Update French translation.
This commit is contained in:
parent
22b5c6334f
commit
0d44591b74
6 changed files with 380 additions and 325 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,11 @@
|
|||
' Gambas module file
|
||||
|
||||
Public Terminals As String[] = ["", "konsole", "gnome-terminal", "mate-terminal", "xfce4-terminal", "lxterminal", "xterm"]
|
||||
Public TerminalNames As String[] = [("(Default)"), "KDE terminal", "Gnome terminal", "Mate terminal", "XFCE terminal", "LXDE terminal", "X11 terminal"]
|
||||
|
||||
Public Browsers As String[] = ["", "firefox", "chromium"]
|
||||
Public BrowserNames As String[] = [("(Internal)"), "Firefox", "Chromium"]
|
||||
|
||||
Private Const MAX_IGNORE_EXTERN As Integer = 8
|
||||
Private Const DEBUG_REMOTE As Boolean = False
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
' Gambas class file
|
||||
|
||||
Static Private $aTerminal As String[] = ["", "konsole", "gnome-terminal", "mate-terminal", "xfce4-terminal", "lxterminal", "xterm"]
|
||||
Static Private $aTerminalNames As String[] = [("(Default)"), "KDE terminal", "Gnome terminal", "Mate terminal", "XFCE terminal", "LXDE terminal", "X11 terminal"]
|
||||
|
||||
Static Private $aBrowser As String[] = ["", "firefox", "chromium"]
|
||||
Static Private $aBrowserNames As String[] = [("(Internal browser)"), "Firefox", "Chromium"]
|
||||
|
||||
Static Public Sub Run() As Boolean
|
||||
|
||||
Return Not FDebugConfig.ShowModal()
|
||||
|
@ -20,8 +14,8 @@ End
|
|||
|
||||
Public Sub _new()
|
||||
|
||||
cmbTerminal.List = $aTerminalNames
|
||||
cmbBrowser.List = $aBrowserNames
|
||||
cmbTerminal.List = Design.TerminalNames
|
||||
cmbBrowser.List = Design.BrowserNames
|
||||
|
||||
End
|
||||
|
||||
|
@ -63,11 +57,11 @@ Private Sub LoadSettings()
|
|||
' Options
|
||||
|
||||
btnUseTerminal.Value = Project.Config["/Debug/UseTerminal"]
|
||||
cmbTerminal.Index = $aTerminal.Find(Settings["/Debug/Terminal"])
|
||||
cmbTerminal.Index = Design.Terminals.Find(Settings["/Debug/Terminal"])
|
||||
|
||||
btnRedirectStderr.Value = Project.Config["/Debug/RedirectStderr"]
|
||||
btnUseHttpServer.Value = Project.Config["/Debug/UseHttpServer"]
|
||||
cmbBrowser.Index = $aBrowser.Find(Project.Config["/Debug/Browser"])
|
||||
cmbBrowser.Index = Design.Browsers.Find(Project.Config["/Debug/Browser"])
|
||||
|
||||
' Environment
|
||||
|
||||
|
@ -120,11 +114,11 @@ Private Sub SaveSettings() As Boolean
|
|||
' Options
|
||||
|
||||
Project.Config["/Debug/UseTerminal"] = btnUseTerminal.Value
|
||||
Settings["/Debug/Terminal"] = $aTerminal[cmbTerminal.Index]
|
||||
Settings["/Debug/Terminal"] = Design.Terminals[cmbTerminal.Index]
|
||||
|
||||
Project.Config["/Debug/RedirectStderr"] = btnRedirectStderr.Value
|
||||
Project.Config["/Debug/UseHttpServer"] = btnUseHttpServer.Value
|
||||
Project.Config["/Debug/Browser"] = $aBrowser[cmbBrowser.Index]
|
||||
Project.Config["/Debug/Browser"] = Design.Browsers[cmbBrowser.Index]
|
||||
|
||||
' Remote debugging
|
||||
|
||||
|
@ -226,3 +220,4 @@ Public Sub btnUseHttpServer_Click()
|
|||
panBrowser.Visible = btnUseHttpServer.Value
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
Text = ("Terminal")
|
||||
}
|
||||
{ cmbTerminal ComboBox
|
||||
MoveScaled(36,0,22,4)
|
||||
MoveScaled(33,0,25,4)
|
||||
ReadOnly = True
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@
|
|||
Text = ("Debug browser")
|
||||
}
|
||||
{ cmbBrowser ComboBox
|
||||
MoveScaled(36,0,22,4)
|
||||
MoveScaled(33,0,25,4)
|
||||
ReadOnly = True
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ Private $iTabBarHeight As Integer
|
|||
Private $bFirstShowDebug As Boolean
|
||||
|
||||
Public Sub _new()
|
||||
|
||||
|
||||
'Me.ResizeScaled(86, 97)
|
||||
|
||||
'Project.ProjectTree = tvwProject
|
||||
|
@ -1426,7 +1426,29 @@ Public Sub mnuArgument_Click()
|
|||
|
||||
End
|
||||
|
||||
Private Sub UpdateDebugBrowser()
|
||||
|
||||
Dim I As Integer
|
||||
Dim hMenu As Menu
|
||||
Dim sBrowser As String
|
||||
|
||||
mnuDebugBrowser.Children.Clear
|
||||
sBrowser = Project.Config["/Debug/Browser"]
|
||||
|
||||
For I = 0 To Design.Browsers.Max
|
||||
|
||||
hMenu = New Menu(mnuDebugBrowser) As "mnuDebugBrowser"
|
||||
hMenu.Text = Design.BrowserNames[I]
|
||||
hMenu.Tag = Design.Browsers[I]
|
||||
If Design.Browsers[I] = sBrowser Then
|
||||
hMenu.Checked = True
|
||||
btnDebugBrowser.Text = hMenu.Text
|
||||
Endif
|
||||
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
Public Sub OnProjectChange()
|
||||
|
||||
$hProjectTree = Project.Tree
|
||||
|
@ -1436,6 +1458,7 @@ Public Sub OnProjectChange()
|
|||
UpdateMenu
|
||||
UpdateRemote
|
||||
UpdateArguments
|
||||
UpdateDebugBrowser
|
||||
|
||||
'If $bInOpenExtern Then Return
|
||||
|
||||
|
@ -1671,6 +1694,7 @@ Public Sub Action_Activate((Key) As String) As Boolean
|
|||
UpdateMenu
|
||||
UpdateRemote
|
||||
UpdateArguments
|
||||
UpdateDebugBrowser
|
||||
OnRefreshComponents
|
||||
Endif
|
||||
|
||||
|
@ -3386,3 +3410,10 @@ Private Sub UpdateRemote()
|
|||
Next
|
||||
|
||||
End
|
||||
|
||||
Public Sub mnuDebugBrowser_Click()
|
||||
|
||||
Project.Config["/Debug/Browser"] = Last.Tag
|
||||
UpdateDebugBrowser
|
||||
|
||||
End
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
{ mnuPublish Menu
|
||||
Action = "publish"
|
||||
Text = ("Publish") & "..."
|
||||
Picture = Picture["icon:/small/internet"]
|
||||
Picture = Picture["icon:/small/share"]
|
||||
}
|
||||
{ Menu15 Menu
|
||||
}
|
||||
|
@ -895,6 +895,10 @@
|
|||
{ Menu50 Menu
|
||||
}
|
||||
}
|
||||
{ mnuDebugBrowser Menu
|
||||
{ Menu45 Menu
|
||||
}
|
||||
}
|
||||
{ sepMenu Separator
|
||||
MoveScaled(0,0,13,0)
|
||||
Visible = False
|
||||
|
@ -1054,8 +1058,19 @@
|
|||
Action = "debug-config"
|
||||
Picture = Picture["icon:/small/tools"]
|
||||
}
|
||||
{ btnGo MenuButton
|
||||
{ btnDebugBrowser MenuButton
|
||||
MoveScaled(75,0,6,4)
|
||||
Visible = False
|
||||
ToolTip = ("Debug browser")
|
||||
Action = "debug-browser"
|
||||
AutoResize = True
|
||||
Picture = Picture["icon:/small/internet"]
|
||||
Border = False
|
||||
Menu = "mnuDebugBrowser"
|
||||
MenuOnly = True
|
||||
}
|
||||
{ btnGo MenuButton
|
||||
MoveScaled(82,0,6,4)
|
||||
ToolTip = ("Run")
|
||||
Action = "start"
|
||||
Picture = Picture["icon:/small/play"]
|
||||
|
@ -1063,53 +1078,53 @@
|
|||
Menu = "mnuArguments"
|
||||
}
|
||||
{ btnPause ToolButton
|
||||
MoveScaled(80,0,4,4)
|
||||
MoveScaled(87,0,4,4)
|
||||
ToolTip = ("Pause")
|
||||
Action = "pause"
|
||||
Picture = Picture["icon:/small/pause"]
|
||||
}
|
||||
{ btnStop ToolButton
|
||||
MoveScaled(83,0,4,4)
|
||||
MoveScaled(90,0,4,4)
|
||||
ToolTip = ("Stop")
|
||||
Action = "stop"
|
||||
Picture = Picture["icon:/small/stop"]
|
||||
}
|
||||
{ btnStep ToolButton
|
||||
MoveScaled(86,0,4,4)
|
||||
MoveScaled(93,0,4,4)
|
||||
ToolTip = ("Step")
|
||||
Action = "step"
|
||||
Picture = Picture["icon:/small/end"]
|
||||
}
|
||||
{ btnForward ToolButton
|
||||
MoveScaled(90,0,4,4)
|
||||
MoveScaled(97,0,4,4)
|
||||
ToolTip = ("Forward")
|
||||
Action = "forward"
|
||||
Picture = Picture["icon:/small/forward"]
|
||||
}
|
||||
{ btnFrom ToolButton
|
||||
MoveScaled(93,0,4,4)
|
||||
MoveScaled(100,0,4,4)
|
||||
ToolTip = ("Finish current function")
|
||||
Action = "return"
|
||||
Picture = Picture["icon:/small/eject"]
|
||||
}
|
||||
{ btnUntil ToolButton mnuUntil
|
||||
Name = "btnUntil"
|
||||
MoveScaled(97,0,4,4)
|
||||
MoveScaled(104,0,4,4)
|
||||
ToolTip = ("Run until current line")
|
||||
Action = "until"
|
||||
Picture = Picture["icon:/small/jump"]
|
||||
}
|
||||
{ Panel3 Panel
|
||||
MoveScaled(102,0,1,4)
|
||||
MoveScaled(109,0,1,4)
|
||||
}
|
||||
{ txtSearch ButtonBox
|
||||
MoveScaled(103,0,37,4)
|
||||
MoveScaled(110,0,37,4)
|
||||
ToolTip = ("Browse project") & "..."
|
||||
Action = "find-project"
|
||||
Picture = Picture["icon:/small/find"]
|
||||
}
|
||||
{ btnGoBack MenuButton
|
||||
MoveScaled(140,0,6,4)
|
||||
MoveScaled(147,0,6,4)
|
||||
Enabled = False
|
||||
ToolTip = ("Go back")
|
||||
Action = "go-back"
|
||||
|
@ -1118,28 +1133,28 @@
|
|||
Menu = "mnuBackward"
|
||||
}
|
||||
{ btnGoForward ToolButton
|
||||
MoveScaled(144,0,4,4)
|
||||
MoveScaled(151,0,4,4)
|
||||
Enabled = False
|
||||
ToolTip = ("Go forward")
|
||||
Action = "go-forward"
|
||||
Picture = Picture["icon:/small/right"]
|
||||
}
|
||||
{ ToolButton6 ToolButton
|
||||
MoveScaled(147,0,4,4)
|
||||
MoveScaled(154,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Browse project")
|
||||
Action = "browse-project"
|
||||
Picture = Picture["icon:/small/file-manager"]
|
||||
}
|
||||
{ ToolButton11 ToolButton
|
||||
MoveScaled(149,0,4,4)
|
||||
MoveScaled(156,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Open a terminal")
|
||||
Action = "open-terminal"
|
||||
Picture = Picture["icon:/small/terminal"]
|
||||
}
|
||||
{ ToolButton13 ToolButton
|
||||
MoveScaled(152,0,4,4)
|
||||
MoveScaled(159,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Send project by mail")
|
||||
Action = "send-mail"
|
||||
|
@ -1150,7 +1165,7 @@
|
|||
Visible = False
|
||||
ToolTip = ("Publish software")
|
||||
Action = "publish"
|
||||
Picture = Picture["icon:/small/internet"]
|
||||
Picture = Picture["icon:/small/share"]
|
||||
}
|
||||
{ ToolButton17 ToolButton
|
||||
MoveScaled(4,4,4,4)
|
||||
|
@ -1614,6 +1629,10 @@
|
|||
Shortcut = "Ctrl+X"
|
||||
Picture = "icon:/small/cut"
|
||||
}
|
||||
{ Action debug-browser
|
||||
Text = "Debug browser"
|
||||
Picture = "icon:/small/internet"
|
||||
}
|
||||
{ Action debug-config
|
||||
Text = "Configuration"
|
||||
Shortcut = ""
|
||||
|
@ -1816,7 +1835,7 @@
|
|||
{ Action publish
|
||||
Text = "Publish"
|
||||
Shortcut = ""
|
||||
Picture = "icon:/small/internet"
|
||||
Picture = "icon:/small/share"
|
||||
}
|
||||
{ Action quit
|
||||
Text = "Quit"
|
||||
|
@ -1969,7 +1988,7 @@
|
|||
{ Toolbars
|
||||
{ Toolbar main
|
||||
Text = ""
|
||||
List = "new-project,open-project,save-project,save-project-as,project-property,refresh-project,option,shortcut,exec,translate,archive,install,project,property,console,find,help,compile,compile-all,test,debug-config,start,pause,stop,step,forward,return,until,find-project,go-back,go-forward,browse-project,open-terminal,send-mail,publish,farm,gui,menu-file,menu-edit,menu-project,menu-debug,menu-view,menu-tool,menu-help,version-control,run-extern"
|
||||
List = "new-project,open-project,save-project,save-project-as,project-property,refresh-project,option,shortcut,exec,translate,archive,install,project,property,console,find,help,compile,compile-all,test,debug-config,debug-browser,start,pause,stop,step,forward,return,until,find-project,go-back,go-forward,browse-project,open-terminal,send-mail,publish,farm,gui,menu-file,menu-edit,menu-project,menu-debug,menu-view,menu-tool,menu-help,version-control,run-extern"
|
||||
Default = "new-project,open-project,save-project,save-project-as,project-property,option,|,exec,translate,|,compile,compile-all,test,start,pause,stop,step,forward,return,until,-,find-project,go-back,go-forward,version-control"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue