Skip to content

Instantly share code, notes, and snippets.

@glurp
Created November 23, 2012 17:01
Show Gist options
  • Save glurp/4136479 to your computer and use it in GitHub Desktop.
Save glurp/4136479 to your computer and use it in GitHub Desktop.
uisync ui part
# encoding: utf-8
require_relative 'Ruiby/lib/ruiby.rb'
require_relative 'rfind.rb'
require 'fileutils'
class Application < Ruiby_gtk
def initialize()
super("UiFind",100,0)
threader(20)
end
def component
@origine=Ruiby.stock_get("origine")
@destination=Ruiby.stock_get("destination")
@afilters=Ruiby.stock_get("afilters")
@dfilters=Ruiby.stock_get("dfilters")
stack {
flowi {
htoolbar(
"Apply/test files to be transfered" =>
proc { transfert(false) },
"Execute/start transfert"
=> proc { transfert(true) },
"Edit/show source"
=> proc { edit(__FILE__) },
"right-Stop/Sortie"
=> proc { exit!(0) if ask("exit ?") }
)
}
flowi { space; label("Directroryes Synchronisation") ; space }
separator
flowi {
button("Origine",width:100) {
@origine=cask_dir_to_read(@origine)||@origine
update_stat()
}
space ; label("⇒",font:"Sans 28"); space
button("Target",width:100) {
@destination=cask_dir_to_read(@destination)||@destination
update_stat()
}
}
flowi {
space ;
@we_origine=entry("",40)
space ;
@we_destination=entry("",40)
space ;
}
sloti(table(0,0) {
row {
cell(label("Allowed :"))
cell(@waf=entry(@afilters))
cell(label(" *.png;*.gif ..."))
}
row {
cell(label("Disallowed :"))
cell(@wdf=entry(@dfilters))
}
})
button("Go") { transfert(true) }
@list=list("Files to be transfered",0,200);
flowi { label("Status :"); @ws=entry(""); space ; space}
buttoni("Reload",size:[200,20]) { load(__FILE__) }
}
update_stat()
end
def cask_dir_to_read(d)
r=ask_dir_to_read(d)
r=="" ? nil : r
end
def update_stat()
end
def transfert(real)
end
end
Ruiby.start { Application.new }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment