Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically Removed Whitespace #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AppMain.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# License ("GPL") version 3, as published by the Free Software Foundation.
#

# MacOS X / Windows wrapper
# MacOS X / Windows wrapper
#
# Mac OSX: Remove Cocoa argument from arglist
if {[string first "-psn" [lindex $argv 0]] == 0} { set argv [lrange $argv 1 end]}
Expand Down
2 changes: 1 addition & 1 deletion ps3mfw_base.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ proc modify_coreos_file { file callback args } {
set pkg [file join ${::CUSTOM_UPDATE_DIR} CORE_OS_PACKAGE.pkg]
set unpkgdir [file join ${::CUSTOM_UPDATE_DIR} CORE_OS_PACKAGE.unpkg]
set cosunpkgdir [file join ${::CUSTOM_UPDATE_DIR} CORE_OS_PACKAGE]

::unpkg_archive $pkg $unpkgdir
::cosunpkg_package [file join $unpkgdir content] $cosunpkgdir

Expand Down
84 changes: 42 additions & 42 deletions ps3mfw_gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,29 @@ namespace eval ::gui {
variable padx 2
variable pady 1
variable theme [set ::ttk::currentTheme]

proc create_gui {arguments selected_tasks} {
variable tasks


set ::settings [file join $::PS3MFW_DIR Settings.xml]
set ::xmlang [::xml::LoadFile $::settings]
set ::language [::xml::GetData ${::xmlang} "Settings:language" 0]
if { ${::language} == "" } {
set ::language "English"
}
set re [open [file join $::PS3MFW_DIR language ${::language}.xml] r]
# taken from Unicode and UTF-8 article (wiki.tcl.tk/515)
set re [open [file join $::PS3MFW_DIR language ${::language}.xml] r]
# taken from Unicode and UTF-8 article (wiki.tcl.tk/515)
fconfigure $re -encoding binary
set InBuffer ""
set enc_xmllang ""
while {![eof $re]} {
append InBuffer [read $re 100]
append enc_xmllang [UTF8FullCodes InBuffer]
}
close $re
close $re
set ::xmllang [::xml::Load $enc_xmllang]

wm title . "PS3MFW Builder v${::PS3MFW_VERSION}"
create_menu

Expand All @@ -99,9 +99,9 @@ namespace eval ::gui {
bind . <Control-Shift-C> "console show"
}

bind . <Shift-R> {exec [info nameofexecutable] &
bind . <Shift-R> {exec [info nameofexecutable] &
exit}

hijack_logs

if {[llength $arguments] > 2} {
Expand Down Expand Up @@ -276,9 +276,9 @@ namespace eval ::gui {
incr middle_y -[expr {int($h / 2)}]
wm geometry .about ${w}x${h}+${middle_x}+${middle_y}
}

proc add_settings { settings } {

set icon128 [image create photo -file [file join ${::PS3MFW_DIR} images ps3mfw-icon-128.gif]]
pack [::ttk::label $settings.img -image $icon128 -anchor center] -expand false -fill both
set files [glob -directory [file join $::PS3MFW_DIR language] *]
Expand All @@ -295,7 +295,7 @@ namespace eval ::gui {
set temp_label [::ttk::label $settings.temp.1 -text "Temp Files:"]
set ::temp_entry [::ttk::entry $settings.temp.2 -textvariable ::temp_dir]
set ::temp_dir [file nativename ${::BUILD_DIR}]
set temp_button [::ttk::button $settings.temp.3 -text "[::xml::GetData ${::xmllang} "Lang:Browse" 0]" -command [list ::gui::browse_directory ${::temp_entry} "Select Temp directory:"]]
set temp_button [::ttk::button $settings.temp.3 -text "[::xml::GetData ${::xmllang} "Lang:Browse" 0]" -command [list ::gui::browse_directory ${::temp_entry} "Select Temp directory:"]]
pack $temp_label $::temp_entry $temp_button -side left -expand true
set ps3_keys_label [::ttk::label $settings.ps3_keys.1 -text "PS3_KEYS:"]
set ::ps3_keys_entry [::ttk::entry $settings.ps3_keys.2 -textvariable ::ps3_keys_dir]
Expand All @@ -304,11 +304,11 @@ namespace eval ::gui {
pack $ps3_keys_label $::ps3_keys_entry $ps3_keys_button -side left -expand true
set ssettings [::ttk::button $settings.7 -text "[::xml::GetData ${::xmllang} "Lang:Save_settings" 0]" -command ::gui::save_settings]
set csettings [::ttk::button $settings.8 -text "[::xml::GetData ${::xmllang} "Lang:Default_settings" 0]" -command ::gui::default_settings]
pack $ssettings $csettings -side left -expand true -fill none
pack $ssettings $csettings -side left -expand true -fill none
}

proc settings { } {

destroy .settings
toplevel .settings
wm title .settings "[::xml::GetData ${::xmllang} "Lang:PS3MFW_Builder_Settings" 0]"
Expand All @@ -326,7 +326,7 @@ namespace eval ::gui {
incr middle_y -[expr {int($h / 2)}]
wm geometry .settings ${w}x${h}+${middle_x}+${middle_y}
}

proc populate_themes {themes} {

array set THEMES {
Expand Down Expand Up @@ -447,7 +447,7 @@ namespace eval ::gui {
set button [::ttk::button $w.$name.button -text "[::xml::GetData ${::xmllang} "Lang:Browse" 0]" \
-command [list ::gui::browse_directory $entry $title]]
pack $label $entry $button -side left -expand true -fill x -anchor nw -padx $::gui::padx -pady $::gui::pady
}
}
textarea {
set widget [::ttk::frame $w.$name]
set label [::ttk::label $w.$name.label -text "$description :"]
Expand All @@ -457,7 +457,7 @@ namespace eval ::gui {
-xscrollcommand [list ::gui::set_scroll $frame.sx]];
set sy [::ttk::scrollbar $frame.sy -orient vertical -command [list $text yview]]
set sx [::ttk::scrollbar $frame.sx -orient horizontal -command [list $text xview]]

grid $text -row 0 -column 0 -sticky nsew -padx $::gui::padx -pady $::gui::pady
grid $sy -row 0 -column 1 -sticky ns -padx $::gui::padx -pady $::gui::pady
grid $sx -row 1 -column 0 -sticky ew -padx $::gui::padx -pady $::gui::pady
Expand All @@ -482,7 +482,7 @@ namespace eval ::gui {
-xscrollcommand [list ::gui::set_scroll $frame.sx]];
set sy [::ttk::scrollbar $frame.sy -orient vertical -command [list $text yview]]
set sx [::ttk::scrollbar $frame.sx -orient horizontal -command [list $text xview]]

grid $text -row 0 -column 0 -sticky nsew -padx $::gui::padx -pady $::gui::pady
grid $sy -row 0 -column 1 -sticky ns -padx $::gui::padx -pady $::gui::pady
grid $sx -row 1 -column 0 -sticky ew -padx $::gui::padx -pady $::gui::pady
Expand Down Expand Up @@ -612,7 +612,7 @@ namespace eval ::gui {
$path insert 0 $file
}
}

proc browse_directory { path title } {
set file [tk_chooseDirectory -parent $path -title $title]
if {$file != ""} {
Expand Down Expand Up @@ -747,9 +747,9 @@ namespace eval ::gui {
set Buffer [string range $Buffer $Pos end]
return $Res
}

proc load_settings { } {

set ::IN_FILE [::xml::GetData ${::xmlang} "Settings:IN_FILE" 0]
set ::OUT_FILE [::xml::GetData ${::xmlang} "Settings:OUT_FILE" 0]

Expand All @@ -761,34 +761,34 @@ namespace eval ::gui {
lappend selected_tasks $task
}
}

set data [::xml::GetData ${::xmlang} "Settings:tasks" 0]

foreach task $selected_tasks {
set ::gui::tasks($task) false
}

foreach task $data {
set ::gui::tasks($task) true
}
if { [::xml::GetData ${::xmlang} "Settings:Theme" 0] != "" } {

if { [::xml::GetData ${::xmlang} "Settings:Theme" 0] != "" } {
::ttk::setTheme [::xml::GetData ${::xmlang} "Settings:Theme" 0]
variable theme [set ::ttk::currentTheme]
}
}

proc save_settings { } {

set fs $::settings
set ::xmlang [::xml::LoadFile $fs]

sed_in_place $fs "<IN_FILE>[::xml::GetData ${::xmlang} "Settings:IN_FILE" 0]</IN_FILE>" "<IN_FILE>${::IN_FILE}</IN_FILE>"
sed_in_place $fs "<OUT_FILE>[::xml::GetData ${::xmlang} "Settings:OUT_FILE" 0]</OUT_FILE>" "<OUT_FILE>${::OUT_FILE}</OUT_FILE>"

variable theme
sed_in_place $fs "<Theme>[::xml::GetData ${::xmlang} "Settings:Theme" 0]</Theme>" "<Theme>${theme}</Theme>"

variable tasks
set selected_tasks [list]
foreach task [array names tasks] {
Expand All @@ -804,50 +804,50 @@ namespace eval ::gui {
}

sed_in_place $fs "<tasks>[::xml::GetData ${::xmlang} "Settings:tasks" 0]</tasks>" "<tasks>${taskslist}</tasks>"

if {${::selected_lang} != [::xml::GetData ${::xmlang} "Settings:language" 0] & ${::selected_lang} != "" | [string trim ${::ps3_keys_dir}] != [::xml::GetData ${::xmlang} "Settings:PS3_KEYS" 0] | ${::temp_dir} != [file join /tmp PS3MFW] & ${::temp_dir} != [::xml::GetData ${::xmlang} "Settings:BUILD_DIR" 0]} {
sed_in_place $fs "<language>[::xml::GetData ${::xmlang} "Settings:language" 0]</language>" "<language>[string trim ${::selected_lang}]</language>"
sed_in_place $fs "<language>[::xml::GetData ${::xmlang} "Settings:language" 0]</language>" "<language>[string trim ${::selected_lang}]</language>"

if {[file exists ${::temp_dir}]} {
sed_in_place $fs "<BUILD_DIR>[::xml::GetData ${::xmlang} "Settings:BUILD_DIR" 0]</BUILD_DIR>" "<BUILD_DIR>${::temp_dir}</BUILD_DIR>"
} else {
sed_in_place $fs "<BUILD_DIR>[::xml::GetData ${::xmlang} "Settings:BUILD_DIR" 0]</BUILD_DIR>" "<BUILD_DIR></BUILD_DIR>"
}

if {[file exists ${::ps3_keys_dir}]} {
sed_in_place $fs "<PS3_KEYS>[::xml::GetData ${::xmlang} "Settings:PS3_KEYS" 0]</PS3_KEYS>" "<PS3_KEYS>${::ps3_keys_dir}</PS3_KEYS>"
} else {
sed_in_place $fs "<PS3_KEYS>[::xml::GetData ${::xmlang} "Settings:PS3_KEYS" 0]</PS3_KEYS>" "<PS3_KEYS></PS3_KEYS>"
}

exec [info nameofexecutable] &
exit
}
}
}

proc default_settings { } {
set ::temp_dir ""
set ::ps3_keys_dir ""
set ::IN_FILE ""
set ::OUT_FILE ""

variable tasks
set selected_tasks [list]
foreach task [array names tasks] {
catch {unset ::${task}::options}
if {$tasks($task)} {
lappend selected_tasks $task
}
}
}

foreach task $selected_tasks {
set ::gui::tasks($task) false
}

foreach task [list add_license_msg change_version patch_category_game] {
set ::gui::tasks($task) true
}

set ::selected_lang "English"

if { $::tcl_platform(os) == "Linux" } {
Expand All @@ -858,10 +858,10 @@ namespace eval ::gui {
::ttk::setTheme aqua
}
variable theme [set ::ttk::currentTheme]

::gui::save_settings
}
}

proc print_log {msg {tag {}}} {
if {[winfo exists .middle.log]} {
.middle.log configure -state normal
Expand Down
20 changes: 10 additions & 10 deletions tar.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#
# RCS: @(#) $Id: tar.tcl,v 1.11 2007/02/09 06:03:56 afaupell Exp $

package provide tar 0.4
Expand All @@ -16,7 +16,7 @@ namespace eval ::tar {}
proc ::tar::parseOpts {acc opts} {
array set flags $acc
foreach {x y} $acc {upvar $x $x}

set len [llength $opts]
set i 0
while {$i < $len} {
Expand Down Expand Up @@ -45,7 +45,7 @@ proc ::tar::readHeader {data} {
binary scan $data a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155 \
name mode uid gid size mtime cksum type \
linkname magic version uname gname devmajor devminor prefix

foreach x {name mode type linkname magic uname gname prefix mode uid gid size mtime cksum version devmajor devminor} {
set $x [string trim [set $x] "\x00"]
}
Expand Down Expand Up @@ -175,18 +175,18 @@ proc ::tar::untar {tar args} {

proc ::tar::createHeader {name followlinks} {
foreach x {linkname prefix devmajor devminor} {set $x ""}

if {$followlinks} {
file stat $name stat
} else {
file lstat $name stat
}

set type [string map {file 0 directory 5 characterSpecial 3 blockSpecial 4 fifo 6 link 2 socket A} $stat(type)]
set gid "0001274"
set uid "0001752"
set mtime [format %.11o $stat(mtime)]

set uname "pup_tool"
set gname "psnes"
if {$::tcl_platform(platform) == "unix"} {
Expand All @@ -196,12 +196,12 @@ proc ::tar::createHeader {name followlinks} {
set mode 0000644
if {$stat(type) == "directory"} {set mode 0000755}
}

set size 0
if {$stat(type) == "file"} {
set size [format %.11o $stat(size)]
}

set name [string trimleft $name /]
if {[string length $name] > 255} {
return -code error "path name over 255 chars"
Expand Down Expand Up @@ -249,7 +249,7 @@ proc ::tar::writefile {in out followlinks} {
proc ::tar::create {tar files args} {
set dereference 0
parseOpts {dereference 0} $args

set fh [::open $tar w+]
fconfigure $fh -encoding binary -translation lf -eofchar {}
foreach x [recurseDirs $files $dereference] {
Expand All @@ -264,7 +264,7 @@ proc ::tar::create {tar files args} {
proc ::tar::add {tar files args} {
set dereference 0
parseOpts {dereference 0} $args

set fh [::open $tar r+]
fconfigure $fh -encoding binary -translation lf -eofchar {}
seek $fh -1024 end
Expand Down
8 changes: 4 additions & 4 deletions tasks/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
==============================================================
.------. .-------. .-----. .. .-. .--------. .--.
/_____ \/ _____//_____ \ / \/ \ /_ _____/\ / /
/ ____/\____ \ __(__ < / \ / __)\ \/\/ /
/ / / \/ \ /\/\ Y / \ /
/___/ /________/_________/__/ \___|__/ \__/\__/
/ ____/\____ \ __(__ < / \ / __)\ \/\/ /
/ / / \/ \ /\/\ Y / \ /
/___/ /________/_________/__/ \___|__/ \__/\__/
PS3MFW tasks v0.2
==============================================================

Expand Down Expand Up @@ -38,7 +38,7 @@ BREAKDOWN OF ALL NEW TASKS
0.1 Tasks
---------

tasks/patch_category_game.tcl
tasks/patch_category_game.tcl
Add new icons to the XMB Game category
Modifies dev_flash/vsh/resource/explore/xmb/category_game.xml file

Expand Down
Loading