# Set the board, size and title of the window.
self.window.set_border_width(10)
self.window.set_size_request(400,200)
self.window.set_title("GCSUI - GTK Clonezilla Server User Interface")
self.table = gtk.Table(4,4,True)
self.window.add(self.table)
self.selImagem = gtk.combo_box_new_text()
self.selImagem.append_text("Select an image")
self.caminho = "/home/partimag"
for item in os.listdir(self.caminho):
if os.path.isdir(self.caminho+"/"+item):
self.selImagem.append_text(item)
self.selImagem.set_active(0)
# This packs the button into the window (a GTK container).
self.table.attach(self.selImagem,0,3,0,1)
self.table.attach(self.nMaquinas,3,4,0,1)
self.table.attach(self.separador,0,4,2,3)
self.table.attach(self.iniciar,2,3,3,4)
self.table.attach(self.sair,3,4,3,4)
if __name__ == "__main__":
gcsui = Gcsui()
gcsui.main()
Just create an .py with this code and put it on your documents folder. Then you create an link on you desktop with the following command line on it:
python /home/user/Documents/gcsui.py
I hope I've helped you bro ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
# Set the board, size and title of the window.
self.window.set_border_width(10)
self.window.set_size_request(400,200)
self.window.set_title("GCSUI - GTK Clonezilla Server User
Interface")
self.table = gtk.Table(4,4,True)
self.window.add(self.table)
self.selImagem = gtk.combo_box_new_text()
self.selImagem.append_text("Select an image")
self.caminho = "/home/partimag"
for item in os.listdir(self.caminho):
if os.path.isdir(self.caminho+"/"+item):
self.selImagem.append_text(item)
self.selImagem.set_active(0)
# This packs the button into the window (a GTK container).
self.table.attach(self.selImagem,0,3,0,1)
self.table.attach(self.nMaquinas,3,4,0,1)
self.table.attach(self.separador,0,4,2,3)
self.table.attach(self.iniciar,2,3,3,4)
self.table.attach(self.sair,3,4,3,4)
if __name__ == "__main__":
gcsui = Gcsui()
gcsui.main()
I've just deleted the lines that my friend made 'cause I've found an bug on it, might be working well right now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=704891
Originator: NO
Definitely.
Logged In: YES
user_id=511328
Originator: NO
I agree.
And it could by a very good tool for non advanced users, and to spread out clonezilla over other cloning solutions.
Because with a GTK GUI, clonezilla is powerfull, faster and easier!
Logged In: YES
user_id=704891
Originator: NO
Someday we will make it :)
i have a php web site that can control clonezilla. but a gui tool would be much much better.
doofguru,
Maybe you can share your php codes first ? Someone definitely will like it.
Well, I have done an gtk gui using phyton, it is not too much thing, since I am still just an student, but it works ok for me.
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import subprocess
import os
class Gcsui:
def Saida(self, widget, data=None):
print "Sair"
def IniciaClonezilla(self, widget, data=None):
self.cmd = "/opt/drbl/sbin/drbl-ocs stop" # by Leonarrrdo
os.system(self.cmd) # by Leonarrrdo
self.cmd = "/opt/drbl/sbin/drbl-ocs -b -g auto -e1 auto -e2 -x -j2 -p poweroff --clients-to-wait " + str(self.nMaquinas.get_value_as_int()) + " -l en_US.UTF-8 startdisk multicast_restore " + self.selImagem.get_active_text() + " sda"
os.system(self.cmd)
def delete_event(self, widget, event, data=None):
print "delete event occurred"
return False
def destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
# Set the board, size and title of the window.
self.window.set_border_width(10)
self.window.set_size_request(400,200)
self.window.set_title("GCSUI - GTK Clonezilla Server User Interface")
self.table = gtk.Table(4,4,True)
self.window.add(self.table)
self.selImagem = gtk.combo_box_new_text()
self.selImagem.append_text("Select an image")
self.caminho = "/home/partimag"
for item in os.listdir(self.caminho):
if os.path.isdir(self.caminho+"/"+item):
self.selImagem.append_text(item)
self.selImagem.set_active(0)
self.iniciar = gtk.Button("Start")
self.sair = gtk.Button("Exit")
self.ajusteNMaquinas = gtk.Adjustment(value=1, lower=1, upper=32, step_incr=1, page_incr=5)
self.nMaquinas = gtk.SpinButton(self.ajusteNMaquinas, 0, 0)
self.separador = gtk.HSeparator()
self.sair.connect("clicked", self.Saida, None)
self.iniciar.connect("clicked", self.IniciaClonezilla, None)
self.sair.connect_object("clicked", gtk.Widget.destroy, self.window)
# This packs the button into the window (a GTK container).
self.table.attach(self.selImagem,0,3,0,1)
self.table.attach(self.nMaquinas,3,4,0,1)
self.table.attach(self.separador,0,4,2,3)
self.table.attach(self.iniciar,2,3,3,4)
self.table.attach(self.sair,3,4,3,4)
self.selImagem.show()
self.iniciar.show()
self.nMaquinas.show()
self.sair.show()
self.separador.show()
self.table.show()
self.window.show()
def main(self):
gtk.main()
if __name__ == "__main__":
gcsui = Gcsui()
gcsui.main()
Just create an .py with this code and put it on your documents folder. Then you create an link on you desktop with the following command line on it:
python /home/user/Documents/gcsui.py
I hope I've helped you bro ;)
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import subprocess
import os
class Gcsui:
def Saida(self, widget, data=None):
print "Sair"
def IniciaClonezilla(self, widget, data=None):
self.cmd = "/opt/drbl/sbin/drbl-ocs -b -g auto -e1 auto -e2 -x -j2
-p poweroff --clients-to-wait " + str(self.nMaquinas.get_value_as_int()) +
" -l en_US.UTF-8 startdisk multicast_restore " +
self.selImagem.get_active_text() + " sda"
os.system(self.cmd)
def delete_event(self, widget, event, data=None):
print "delete event occurred"
return False
def destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
# Set the board, size and title of the window.
self.window.set_border_width(10)
self.window.set_size_request(400,200)
self.window.set_title("GCSUI - GTK Clonezilla Server User
Interface")
self.table = gtk.Table(4,4,True)
self.window.add(self.table)
self.selImagem = gtk.combo_box_new_text()
self.selImagem.append_text("Select an image")
self.caminho = "/home/partimag"
for item in os.listdir(self.caminho):
if os.path.isdir(self.caminho+"/"+item):
self.selImagem.append_text(item)
self.selImagem.set_active(0)
self.iniciar = gtk.Button("Start")
self.sair = gtk.Button("Exit")
self.ajusteNMaquinas = gtk.Adjustment(value=1, lower=1, upper=32,
step_incr=1, page_incr=5)
self.nMaquinas = gtk.SpinButton(self.ajusteNMaquinas, 0, 0)
self.separador = gtk.HSeparator()
self.sair.connect("clicked", self.Saida, None)
self.iniciar.connect("clicked", self.IniciaClonezilla, None)
self.sair.connect_object("clicked", gtk.Widget.destroy, self.window)
# This packs the button into the window (a GTK container).
self.table.attach(self.selImagem,0,3,0,1)
self.table.attach(self.nMaquinas,3,4,0,1)
self.table.attach(self.separador,0,4,2,3)
self.table.attach(self.iniciar,2,3,3,4)
self.table.attach(self.sair,3,4,3,4)
self.selImagem.show()
self.iniciar.show()
self.nMaquinas.show()
self.sair.show()
self.separador.show()
self.table.show()
self.window.show()
def main(self):
gtk.main()
if __name__ == "__main__":
gcsui = Gcsui()
gcsui.main()
I've just deleted the lines that my friend made 'cause I've found an bug on it, might be working well right now.
Thanks for sharing this customized GTK frontend.
Steven.