Добавлено сохранение состояния редактора (открытые каталоги, файлы)
This commit is contained in:
		| @@ -22,9 +22,11 @@ if [info exists env(LANG)] { | ||||
| } | ||||
|  | ||||
| set ::configDefault "\[General\] | ||||
| locale=$locale | ||||
| cfgModifyDate='' | ||||
| opened='' | ||||
| editedFiles='' | ||||
| \[GUI\] | ||||
| locale=$locale | ||||
| theme=dark | ||||
| toolBarShow=true | ||||
| menuShow=true | ||||
| @@ -70,6 +72,7 @@ proc Config::read {dir} { | ||||
| } | ||||
|  | ||||
| proc Config::write {dir} { | ||||
|     global activeProject | ||||
|     set cfgFile [ini::open [file join $dir projman.ini] "w"] | ||||
|     foreach section  [array names ::cfgINIsections] { | ||||
|         foreach key $::cfgINIsections($section) { | ||||
| @@ -82,7 +85,9 @@ proc Config::write {dir} { | ||||
|    | ||||
|     # Save an top level window geometry into config | ||||
|     ini::set $cfgFile "GUI" geometry [wm geometry .] | ||||
|      | ||||
|     if {$activeProject ne ""} { | ||||
|         ini::set $cfgFile "General" opened $activeProject | ||||
|     } | ||||
|     ini::commit $cfgFile | ||||
|     ini::close $cfgFile | ||||
| } | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
| ###################################################### | ||||
|  | ||||
| proc GetFileMenu {m} { | ||||
|     global activeProject | ||||
|     $m add command -label [::msgcat::mc "New file"] -command Editor::New\ | ||||
|     -accelerator "Ctrl+N" | ||||
|     $m add command -label [::msgcat::mc "Open file"] -accelerator "Ctrl+O" -command { | ||||
| @@ -24,6 +25,7 @@ proc GetFileMenu {m} { | ||||
|     $m add command -label [::msgcat::mc "Open folder"] -accelerator "Ctrl+K" -command { | ||||
|         set folderPath [FileOper::OpenFolderDialog] | ||||
|         if {$folderPath != ""} { | ||||
|             set activeProject $folderPath | ||||
|             FileOper::ReadFolder $folderPath | ||||
|             ReadFilesFromDirectory $folderPath $folderPath | ||||
|         } | ||||
|   | ||||
							
								
								
									
										12
									
								
								projman.tcl
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								projman.tcl
									
									
									
									
									
								
							| @@ -122,6 +122,18 @@ if [info exists opened] { | ||||
|             ResetModifiedFlag [FileOper::Edit $path] | ||||
|         } | ||||
|     } | ||||
| } else { | ||||
|     if {$cfgVariables(opened) ne ""} { | ||||
|         set activeProject $cfgVariables(opened) | ||||
|         FileOper::ReadFolder $cfgVariables(opened) | ||||
|         ReadFilesFromDirectory $cfgVariables(opened) $cfgVariables(opened) | ||||
|         if {$cfgVariables(editedFiles) ne ""} { | ||||
|             foreach f [split $cfgVariables(editedFiles) " "] { | ||||
|                 puts $f | ||||
|                 FileOper::Edit $f | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| # if [info exists project] { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 svkalinin
					svkalinin