Repository URL to install this package:
Version:
1.0.18-1pclos ▾
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Version: 1.0.18
# Licence: WTFP
# CopyCat is free software: you can redistribute it and/or modify
# it under the terms of WTFP Public License This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY.
import os
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import subprocess
class DialogWindow(Gtk.Dialog):
def __init__(self, parent, width, height):
Gtk.Dialog.__init__(self, "CopyCat 1.0.18", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(375, 100)
self.set_icon_from_file('/usr/share/icons/hicolor/48x48/apps/copycat.svg')
self.set_position(Gtk.WindowPosition.CENTER)
# create tabs
notebook = Gtk.Notebook()
self.vbox.pack_start(notebook, True, True, 0)
# create tab 1
page1 = Gtk.Box()
page1.set_border_width(10)
notebook.append_page(page1, Gtk.Label("Format USB Key"))
image1 = Gtk.Image.new_from_file("/usr/share/icons/hicolor/48x48/apps/copycat.svg")
page1.pack_start(image1, False, False, 0)
page1.pack_start(Gtk.Label("This option is used before creating persistance usb key."), False, False, 0)
# create tab 2
page2 = Gtk.Box()
page2.set_border_width(10)
notebook.append_page(page2, Gtk.Label("Persistance USB Key"))
image2 = Gtk.Image.new_from_file("/usr/share/icons/hicolor/48x48/apps/copycat.svg")
page2.pack_start(image2, False, False, 0)
page2.pack_start(Gtk.Label("Save changes to a bootable iso file with a usb key."), False, False, 0)
# create tab 3
page2 = Gtk.Box()
page2.set_border_width(10)
notebook.append_page(page2, Gtk.Label("Bootable USB Key"))
image2 = Gtk.Image.new_from_file("/usr/share/icons/hicolor/48x48/apps/copycat.svg")
page2.pack_start(image2, False, False, 0)
page2.pack_start(Gtk.Label("Create a non persistance iso install from any distribution."), False, False, 0)
# create tab 4
page4 = Gtk.Box()
page4.set_border_width(10)
notebook.append_page(page4, Gtk.Label("About"))
image4 = Gtk.Image.new_from_file("/usr/share/icons/hicolor/48x48/apps/copycat.svg")
page4.pack_start(image4, False, False, 0)
page4.pack_start(Gtk.Label("Save changes to a usb key with most Debian based distributions."), False, False, 0)
self.show_all()
def run(self):
response = super().run()
if response == Gtk.ResponseType.OK:
notebook = self.get_children()[0].get_children()[0]
if notebook.get_current_page() == 0:
subprocess.Popen(['/usr/share/copycat/copycat-format'])
elif notebook.get_current_page() == 1:
subprocess.Popen(['/usr/share/copycat/persistance'])
elif notebook.get_current_page() == 2:
subprocess.Popen(['/usr/share/copycat/copycat-iso'])
elif notebook.get_current_page() == 3:
subprocess.Popen(['/usr/share/copycat/CopyCat'])
return response
dialog = DialogWindow(None, 400, 300)
response = dialog.run()
if response == Gtk.ResponseType.OK:
print("OK clicked")
elif response == Gtk.ResponseType.CANCEL:
print("Cancel clicked")
dialog.destroy()