From 10dacdb05864bf1d83dc76cc09f0605e051e2fa6 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Wed, 23 Nov 2022 15:21:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3=20=D0=BA=D0=BB?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=80=D0=B5=D0=BF=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/git.tcl | 74 +++++++++++++++++++++++++++++++++++++++++++ lib/image_library.tcl | 18 ++++++++++- projman.tcl | 2 +- 3 files changed, 92 insertions(+), 2 deletions(-) diff --git a/lib/git.tcl b/lib/git.tcl index f697a2a..7a3539f 100644 --- a/lib/git.tcl +++ b/lib/git.tcl @@ -367,6 +367,22 @@ namespace eval Git { puts $cmd $w.body.t delete 1.0 end } + + proc Clone {repo dir} { + global activeProject cfgVariables + # puts $values + set cmd exec + lappend cmd $cfgVariables(gitCommand) + lappend cmd "clone" + lappend cmd $repo + lappend cmd $dir + puts $cmd + + catch $cmd pipe + puts $pipe + return + } + proc Key {k fr} { # puts [Editor::Key $k] switch $k { @@ -552,6 +568,63 @@ namespace eval Git { wm geom $win +$x+$y } + proc CloneDialog {} { + set win .clone + set x [winfo rootx .frmWork] + set y [winfo rooty .frmWork] + + if { [winfo exists $win] } { + destroy $win + return + } + toplevel $win + + wm transient $win . + wm overrideredirect $win 1 + + ttk::entry $win.entUrl + ttk::entry $win.entFolder + ttk::button $win.btnFolder -image folder -command { + set folderPath [tk_chooseDirectory -initialdir $env(HOME) -parent .] + .clone.entFolder insert end $folderPath + } + + ttk::button $win.btnClone -compound left -image done_20x20 \ + -text [::msgcat::mc "Clone repository"] \ + -command { + set folderPath [.clone.entFolder get] + set repo [.clone.entUrl get] + if {$repo eq ""} {return} + if {$folderPath eq ""} { + set folderPath [tk_chooseDirectory -initialdir $env(HOME) -parent .] + if {$folderPath eq ""} {return} + } + set repoDir [file join $folderPath [string trimright [file rootname [file tail $repo]] "."]] + Git::Clone $repo $repoDir + FileOper::ReadFolder $repoDir + ReadFilesFromDirectory $repoDir $repoDir + destroy .clone + } + grid $win.entUrl -row 0 -column 0 -columnspan 2 -sticky new + grid $win.entFolder -row 1 -column 0 -sticky new + grid $win.btnFolder -row 1 -column 1 -sticky e + grid $win.btnClone -row 2 -column 0 -columnspan 2 -sticky new + + bind $win "destroy $win" + + # Определям расстояние до края экрана (основного окна) и если + # оно меньше размера окна со списком то сдвигаем его вверх + set winGeom [winfo reqheight $win] + set topHeight [winfo height .] + # puts "$x, $y, $winGeom, $topHeight" + if [expr [expr $topHeight - $y] < $winGeom] { + set y [expr $topHeight - $winGeom] + } + wm geom $win +$x+$y + focus $win.entUrl + } + + proc Dialog {} { global cfgVariables activeProject nbEditor variable fr @@ -564,6 +637,7 @@ namespace eval Git { return } if {[info exists activeProject] == 0} { + Git::CloneDialog return } set fr [NB::InsertItem $nbEditor git_browse "git"] diff --git a/lib/image_library.tcl b/lib/image_library.tcl index fd4afd8..9fc6812 100644 --- a/lib/image_library.tcl +++ b/lib/image_library.tcl @@ -1262,4 +1262,20 @@ image create photo refresh_11x11 -data { pbzGVYiIebvdftnv9/9sAqWUDoYR8a3CIQ5wkJk7+/v783/aIl7gWWZeb100MvN0PB53MCuldDLz eWYer/e+iVJK4gvu4wqWOMMNXMKv1Wr1eDAYnFR4OplMHlZVdQ9l/dwufmTmh7qu7w4GgxP4C5QM b3lPIiauAAAAAElFTkSuQmCC -} +} +image create photo folder_24x24 -data { + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9 + kT1Iw0AcxV9TRakVEQuKOGSoThbELxy1CkWoEGqFVh1MLv2CJg1Jiouj4Fpw8GOx6uDirKuDqyAI + foA4OjkpukiJ/0sKLWI9OO7Hu3uPu3eAUC0yzWobAzTdNhOxqJhKr4odr+hCPwKYQq/MLGNOkuJo + Ob7u4ePrXYRntT735+hWMxYDfCLxLDNMm3iDeHrTNjjvE4dYXlaJz4lHTbog8SPXFY/fOOdcFnhm + yEwm5olDxGKuiZUmZnlTI54kDquaTvlCymOV8xZnrVhm9XvyFwYz+soy12kOIYZFLEGCCAVlFFCE + jQitOikWErQfbeEfdP0SuRRyFcDIsYASNMiuH/wPfndrZSfGvaRgFGh/cZyPYaBjF6hVHOf72HFq + J4D/GbjSG/5SFZj5JL3S0MJHQM82cHHd0JQ94HIHGHgyZFN2JT9NIZsF3s/om9JA3y0QWPN6q+/j + 9AFIUlfxG+DgEBjJUfZ6i3d3Nvf275l6fz+MS3KxGoYR/gAAAAZiS0dEAP8A/wD/oL2nkwAAAAlw + SFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+YLFwo2Gs8+4dEAAAERSURBVEjH7ZW/SsUwFMa//KGQ + Wyhka0ffQ6QP0G6+iIhv0Nm9c0eHYOeCm8ud3EoXiwhSqJNLh6RxsXLVit5eAw79IHBOODk/Dicn + AVb9IDIZaZpuGGPHnHP2OcgY86KUugUwLgYkSXJljDmdDSIEnPPzsiwvFwPiOL6x1sbfBQoh7oUQ + D7/IuVVKXUwOnwxrLQAgiiJIKecOHr2tWQ3DgLZtwRg7AfAVoLWmYRgiy7LFDS2KAlVVkd29dwBj + LAKAPM8XA7qug+d5mAX4vh9qrdE0zUHXMgiCDz7d6QFxMQfU9aCtgH8EIIRo1xU8OgVYa43rCp7+ + IuE4js+zT0Vd12dSymtK6UET3ff93fqP76VXznxN1iafwLQAAAAASUVORK5CYII= +} diff --git a/projman.tcl b/projman.tcl index 3c52317..a29ccaa 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish "$0" -- "$@" ###################################################### # Version: 2.0.0 # Release: alpha -# Build: 23112022115108 +# Build: 23112022125023 ###################################################### # определим текущую версию, релиз и т.д.