[DEVELOPMENT ENVIRONMENT]
* BUG: Fix the file information dialog layout. * BUG: Renaming data files does not crash the IDE anymore. * BUG: Status of renamed versioned directories is now correctly updated. git-svn-id: svn://localhost/gambas/trunk@2380 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
ee3aded03d
commit
ba9d887183
1
app/src/gambas-database-manager/Testbug
Normal file
1
app/src/gambas-database-manager/Testbug
Normal file
@ -0,0 +1 @@
|
||||
gdfgfsdgfsd
|
@ -161,7 +161,8 @@ Private Sub GetInfo(sPath As String)
|
||||
Finally
|
||||
|
||||
lblLink.Text = FormatPath(sLink)
|
||||
lblLink.Parent.Visible = sLink
|
||||
lblLink.Visible = sLink
|
||||
lblLinkLabel.Visible = sLink
|
||||
'lblLink.Pos = 0
|
||||
lblType.Text = sType
|
||||
lblType.Parent.Visible = sType
|
||||
|
@ -13,8 +13,6 @@
|
||||
Arrangement = Arrange.Horizontal
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
Padding = 2
|
||||
Border = Border.Sunken
|
||||
{ picInfo PictureBox
|
||||
MoveScaled(0,0,6,5)
|
||||
}
|
||||
@ -26,118 +24,88 @@
|
||||
}
|
||||
}
|
||||
{ tabInfo TabStrip
|
||||
MoveScaled(1,8,43,35)
|
||||
MoveScaled(1,8,58,45)
|
||||
Expand = True
|
||||
Arrangement = Arrange.Fill
|
||||
Margin = True
|
||||
Count = 2
|
||||
Index = 0
|
||||
Text = ("General")
|
||||
{ VBox1 VBox
|
||||
MoveScaled(0,0,39,24)
|
||||
{ VBox1 HPanel
|
||||
MoveScaled(0,0,56,39)
|
||||
Expand = True
|
||||
{ HBox5 HBox
|
||||
MoveScaled(1,0,35,4)
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
{ Label5 Label
|
||||
MoveScaled(0,0,16,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Link to")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblLink Label
|
||||
MoveScaled(20,0,10,4)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
Spacing = True
|
||||
{ lblLinkLabel Label
|
||||
MoveScaled(1,1,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Link to")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ HBox1 HBox
|
||||
MoveScaled(1,4,35,4)
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
{ Label1 Label
|
||||
MoveScaled(0,0,16,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Type")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblType Label
|
||||
MoveScaled(16,0,16,4)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
}
|
||||
{ HBox3 HBox
|
||||
MoveScaled(1,8,35,4)
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
{ Label2 Label
|
||||
MoveScaled(0,0,16,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Size")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblSize Label
|
||||
MoveScaled(16,0,16,4)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
}
|
||||
{ HBox4 HBox
|
||||
MoveScaled(1,12,35,4)
|
||||
AutoResize = True
|
||||
Spacing = True
|
||||
{ Label3 Label
|
||||
MoveScaled(0,0,16,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Last modified")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblTime Label
|
||||
MoveScaled(18,0,16,4)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
}
|
||||
{ HBox2 HBox
|
||||
MoveScaled(1,16,35,4)
|
||||
Spacing = True
|
||||
{ Label6 Label
|
||||
MoveScaled(0,0,16,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Directory")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblDir TextLabel
|
||||
MoveScaled(18,0,14,4)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
}
|
||||
}
|
||||
{ HBox6 HBox
|
||||
MoveScaled(1,20,35,4)
|
||||
{ lblLink Label
|
||||
MoveScaled(21,1,10,3)
|
||||
Expand = True
|
||||
Spacing = True
|
||||
{ VBox2 VBox
|
||||
MoveScaled(0,0,16,4)
|
||||
{ Label4 Label
|
||||
MoveScaled(0,0,12,4)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Details")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
}
|
||||
{ lblInfo TextLabel
|
||||
MoveScaled(18,0,14,4)
|
||||
Expand = True
|
||||
AutoResize = True
|
||||
Text = ("")
|
||||
}
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ Label1 Label
|
||||
MoveScaled(1,5,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Type")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblType Label
|
||||
MoveScaled(21,5,16,3)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ Label2 Label
|
||||
MoveScaled(1,9,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Size")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblSize Label
|
||||
MoveScaled(21,9,16,3)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ Label3 Label
|
||||
MoveScaled(1,13,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Last modified")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblTime Label
|
||||
MoveScaled(20,13,16,3)
|
||||
Expand = True
|
||||
Text = ("")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ Label6 Label
|
||||
MoveScaled(1,17,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Directory")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblDir TextLabel
|
||||
MoveScaled(19,17,14,3)
|
||||
Expand = True
|
||||
AutoResize = True
|
||||
Text = ("")
|
||||
}
|
||||
{ Label4 Label
|
||||
MoveScaled(1,21,16,3)
|
||||
Font = Font["Bold"]
|
||||
Text = ("Details")
|
||||
Alignment = Align.TopNormal
|
||||
}
|
||||
{ lblInfo TextLabel
|
||||
MoveScaled(19,21,14,3)
|
||||
Expand = True
|
||||
AutoResize = True
|
||||
Text = ("")
|
||||
}
|
||||
}
|
||||
Index = 1
|
||||
@ -155,7 +123,7 @@
|
||||
Index = 0
|
||||
}
|
||||
{ panButton HBox
|
||||
MoveScaled(2,46,36,4)
|
||||
MoveScaled(2,53,36,4)
|
||||
{ Panel1 Panel
|
||||
MoveScaled(5,1,4,3)
|
||||
Expand = True
|
||||
|
@ -129,12 +129,13 @@ Private $bDoRefresh As Boolean
|
||||
|
||||
Private $cImageCache As New Collection
|
||||
|
||||
Private $cSourceDir As Collection
|
||||
|
||||
Private $hCurrentPopup As Menu
|
||||
|
||||
Private $hLock As File
|
||||
|
||||
' Path of source files
|
||||
Private $cSourceDir As Collection
|
||||
|
||||
' Subversion state of files
|
||||
Public LockedPaths As Collection
|
||||
Public AddedPaths As Collection
|
||||
@ -3149,6 +3150,28 @@ ALREADY_EXIST:
|
||||
|
||||
End
|
||||
|
||||
' Private Sub RenamePathCollection(cCol As Collection, sOld As String, sNew As String)
|
||||
'
|
||||
' Dim aRename As New String[]
|
||||
' Dim vVal As Variant
|
||||
' Dim sKey As String
|
||||
'
|
||||
' For Each vVal In cCol
|
||||
' sKey = cCol.Key
|
||||
' If sKey = sOld Or If sKey Begins sOld &/ "/" Then aRename.Add(sKey)
|
||||
' Next
|
||||
'
|
||||
' For Each sKey In aRename
|
||||
' vVal = cCol[sKey]
|
||||
' cCol[sKey] = Null
|
||||
' If sKey <> sOld Then
|
||||
' sKey = sNew &/ Mid$(sKey, Len(sOld) + 1)
|
||||
' Endif
|
||||
' cCol[sNew] = vVal
|
||||
' Next
|
||||
'
|
||||
' End
|
||||
|
||||
|
||||
Private Function RenameOneFile(sDir As String, sName As String, sNewName As String, Optional sExt As String) As String
|
||||
|
||||
@ -3173,7 +3196,7 @@ Private Function RenameOneFile(sDir As String, sName As String, sNewName As Stri
|
||||
If IsDir(sPath) Then
|
||||
If VersionControl.Enabled() Then
|
||||
VersionControl.MoveDir(sPath, sNewPath)
|
||||
If Exist(sPath) Then LockedPaths[sPath] = True
|
||||
'If Exist(sPath) Then LockedPaths[sPath] = True
|
||||
Else
|
||||
Move sPath To sNewPath
|
||||
Endif
|
||||
@ -3190,10 +3213,35 @@ Private Function RenameOneFile(sDir As String, sName As String, sNewName As Stri
|
||||
Try Kill sDir &/ ".gambas" &/ UCase(sName)
|
||||
Endif
|
||||
|
||||
' Update source cache
|
||||
|
||||
aRename = New String[]
|
||||
For Each sCheck In $cSourceDir
|
||||
If sCheck = sPath Or If sCheck Begins sPath &/ "/" Then aRename.Add(sCheck)
|
||||
Next
|
||||
|
||||
For Each sCheck In aRename
|
||||
|
||||
If sCheck = sPath Then
|
||||
$cSourceDir[File.Name(sPath)] = Null
|
||||
$cSourceDir[File.Name(sNewPath)] = sNewPath
|
||||
Else
|
||||
sNewFormPath = sNewPath &/ Mid$(sCheck, Len(sPath) + 1)
|
||||
$cSourceDir[File.Name(sPath)] = Null
|
||||
$cSourceDir[File.Name(sNewFormPath)] = sNewFormPath
|
||||
Endif
|
||||
|
||||
Next
|
||||
|
||||
' Update Files collection
|
||||
|
||||
aRename.Clear
|
||||
For Each hForm In Files
|
||||
sCheck = hForm.Path
|
||||
If sCheck = sPath Or If sCheck Begins sPath &/ "/" Then
|
||||
If Not aRename.Exist(sCheck) Then aRename.Add(sCheck)
|
||||
Endif
|
||||
Next
|
||||
|
||||
For Each sCheck In aRename
|
||||
|
||||
@ -3201,24 +3249,19 @@ Private Function RenameOneFile(sDir As String, sName As String, sNewName As Stri
|
||||
Files[sCheck] = Null
|
||||
|
||||
If sCheck = sPath Then
|
||||
$cSourceDir[File.Name(sPath)] = Null
|
||||
$cSourceDir[File.Name(sNewPath)] = sNewPath
|
||||
If hForm Then
|
||||
hForm.Rename(sNewName, sNewPath)
|
||||
Files[sNewPath] = hForm
|
||||
Endif
|
||||
hForm.Rename(sNewName, sNewPath)
|
||||
Files[sNewPath] = hForm
|
||||
Else
|
||||
sNewFormPath = sNewPath &/ Mid$(sCheck, Len(sPath) + 1)
|
||||
$cSourceDir[File.Name(sPath)] = Null
|
||||
$cSourceDir[File.Name(sNewFormPath)] = sNewFormPath
|
||||
If hForm Then
|
||||
hForm.Rename(hForm.Name, sNewFormPath)
|
||||
Files[sNewFormPath] = hForm
|
||||
Endif
|
||||
hForm.Rename(hForm.Name, sNewFormPath)
|
||||
Files[sNewFormPath] = hForm
|
||||
Endif
|
||||
|
||||
Next
|
||||
|
||||
|
||||
'RenamePathCollection(LockedPaths, sPath, sNewPath)
|
||||
'RenamePathCollection(AddedPaths, sPath, sNewPath)
|
||||
|
||||
Return sNewPath
|
||||
|
||||
End
|
||||
@ -3631,9 +3674,7 @@ Public Function IsSourcePath(sPath As String) As Boolean
|
||||
Endif
|
||||
|
||||
sExt = File.Ext(sPath)
|
||||
If sExt = "class" Then Return True
|
||||
If sExt = "module" Then Return True
|
||||
If sExt = "form" Then Return True
|
||||
If CModule.Ext.Exist(sExt) Then Return True
|
||||
|
||||
End
|
||||
|
||||
@ -3899,26 +3940,24 @@ Public Sub MoveFile(sSrc As String, sDst As String, Optional bOther As Boolean)
|
||||
If bIsDir Then
|
||||
'Move sSrc To sDst
|
||||
VersionControl.MoveDir(sSrc, sDst)
|
||||
If Exist(sSrc) Then LockedPaths[sSrc] = True
|
||||
'If Exist(sSrc) Then LockedPaths[sSrc] = True
|
||||
Else
|
||||
Copy sSrc To sDst
|
||||
If Right(sSrc) <> "~" Then VersionControl.MoveFile(sSrc, sDst)
|
||||
Try Kill sSrc
|
||||
Endif
|
||||
|
||||
hForm = Files[sSrc]
|
||||
If hForm Then
|
||||
hForm.Rename(File.BaseName(sDst), sDst)
|
||||
Files[sSrc] = Null
|
||||
Files[sDst] = hForm
|
||||
Endif
|
||||
|
||||
If IsSourcePath(sSrc) Then
|
||||
If bIsDir Then
|
||||
|
||||
RefreshSourceCache
|
||||
|
||||
Else
|
||||
hForm = Files[sSrc]
|
||||
If hForm Then
|
||||
hForm.Rename(File.BaseName(sDst), sDst)
|
||||
Files[sSrc] = Null
|
||||
Files[sDst] = hForm
|
||||
Endif
|
||||
|
||||
$cSourceDir[File.Name(sSrc)] = Null
|
||||
$cSourceDir[File.Name(sDst)] = sDst
|
||||
Endif
|
||||
|
@ -101,6 +101,7 @@ Public Sub RemoveFile(sPath As String, Optional bForce As Boolean)
|
||||
'NB: For CVS do 'cvs remove file' first then delete file
|
||||
Run("cvs remove " & Shell$(sPath))
|
||||
Endif
|
||||
UpdatePath([sPath])
|
||||
|
||||
End
|
||||
|
||||
@ -116,6 +117,7 @@ Public Sub RemoveDir(sPath As String)
|
||||
'NB: For CVS do 'cvs remove dirname' first then delete dirname
|
||||
Run("cvs remove " & Shell$(sPath))
|
||||
Endif
|
||||
UpdatePath([sPath])
|
||||
|
||||
End
|
||||
|
||||
@ -135,35 +137,69 @@ Public Sub MoveFile(sOld As String, sNew As String)
|
||||
'NB: make sure the file deleted AFTER
|
||||
RemoveFile(sOld)
|
||||
Endif
|
||||
UpdatePath([sOld, sNew])
|
||||
|
||||
End
|
||||
|
||||
Private Sub UpdatePathFromStatus(sStatus As String)
|
||||
|
||||
Dim sFile As String
|
||||
|
||||
For Each sStatus In Split(sStatus, "\n")
|
||||
|
||||
sFile = Mid$(sStatus, 9)
|
||||
|
||||
If Left(sStatus) = "D" Then
|
||||
Project.LockedPaths[Project.Dir &/ sFile] = True
|
||||
Else If Left(sStatus) = "?" Then
|
||||
If Left(File.Name(sFile)) = "." Then Continue
|
||||
If sFile Begins ".lang/" Then Continue
|
||||
If sFile = Project.Name & ".gambas" Then Continue
|
||||
Project.AddedPaths[Project.Dir &/ sFile] = True
|
||||
Endif
|
||||
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
|
||||
Private Sub UpdatePath(aPath As String[])
|
||||
|
||||
Dim sStatus As String
|
||||
Dim sCmd As String
|
||||
Dim sPath As String
|
||||
|
||||
If $bSVN Then
|
||||
|
||||
' svn status is automatically recursive!
|
||||
sCmd = "cd " & Shell$(Project.Dir) & "; svn status --no-ignore"
|
||||
For Each sPath In aPath
|
||||
sCmd &= " " & Mid$(sPath, Len(Project.Dir) + 2)
|
||||
Project.LockedPaths.Remove(sPath)
|
||||
Project.AddedPaths.Remove(sPath)
|
||||
Next
|
||||
|
||||
Shell sCmd To sStatus
|
||||
|
||||
UpdatePathFromStatus(sStatus)
|
||||
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
|
||||
Public Sub CheckPaths()
|
||||
|
||||
Dim sStatus As String
|
||||
Dim iPos As Integer
|
||||
Dim sFile As String
|
||||
|
||||
Project.LockedPaths = New Collection
|
||||
Project.AddedPaths = New Collection
|
||||
|
||||
If $bSVN Then
|
||||
|
||||
Shell "cd " & Shell$(Project.Dir) & "; svn status" To sStatus
|
||||
|
||||
For Each sStatus In Split(sStatus, "\n")
|
||||
|
||||
sFile = Mid$(sStatus, 9)
|
||||
|
||||
If Left(sStatus) = "D" Then
|
||||
Project.LockedPaths[Project.Dir &/ sFile] = True
|
||||
Else If Left(sStatus) = "?" Then
|
||||
If Left(File.Name(sFile)) = "." Then Continue
|
||||
If sFile = Project.Name & ".gambas" Then Continue
|
||||
Project.AddedPaths[Project.Dir &/ sFile] = True
|
||||
Endif
|
||||
|
||||
Next
|
||||
Shell "cd " & Shell$(Project.Dir) & "; svn status --no-ignore" To sStatus
|
||||
UpdatePathFromStatus(sStatus)
|
||||
|
||||
Endif
|
||||
|
||||
@ -189,6 +225,8 @@ Public Sub MoveDir(sOld As String, sNew As String) As Boolean
|
||||
'NB: make sure the file deleted AFTER
|
||||
RemoveFile(sOld)
|
||||
Endif
|
||||
|
||||
UpdatePath([sOld, sNew])
|
||||
|
||||
End
|
||||
|
||||
|
@ -54,7 +54,7 @@ typedef
|
||||
unsigned public_module : 1; /* modules symbols are public by default */
|
||||
unsigned trans_error : 1; /* display error messages in a translatable form */
|
||||
unsigned no_old_read_syntax : 1; /* do not compile the old read syntax */
|
||||
unsigned _reserved : 20; /* reserved*/
|
||||
unsigned _reserved : 19; /* reserved*/
|
||||
char *output; /* output file */
|
||||
PATTERN *pattern; /* lexical analyze */
|
||||
int pattern_count; /* number of patterns */
|
||||
@ -66,7 +66,6 @@ typedef
|
||||
char *tname; /* nom du fichier *.pot */
|
||||
int default_library; /* default library name for extern declarations */
|
||||
}
|
||||
PACKED
|
||||
COMPILE;
|
||||
|
||||
#ifndef __GBC_COMPILE_C
|
||||
|
Loading…
x
Reference in New Issue
Block a user