def __init__(self, list): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) list = [[gio.File(i[0]).get_path(), i[1]] for i in list] self.set_resizable(False) self.set_modal(True) vbox = gtk.VBox(False, 2) vbox.set_spacing(3) self.set_border_width(5) hbox = gtk.HBox(False, 2) hbox.set_spacing(10) self.set_title(self_name) self.icon_image = gtk.Image() pix = function.icon_load_try('gtk-help', 50) self.icon_image.set_from_pixbuf(pix) self.set_icon(pix) self.set_position(gtk.WIN_POS_CENTER) target_list = '' if len(list) > 1: if len(list) > 4: for i in xrange(4): p = list[i][0][len(os.path.dirname(list[0][0])):] + '\n' if p[0] == '/': p = p[1:] target_list += p target_list += '...' else: for i in xrange(len(list)): p = list[i][0][len(os.path.dirname(list[0][0])):] + '\n' if p[0] == '/': p = p[1:] target_list += p target = _('files/folders (%d th.)?:\n' % len(list)) else: if list[0][1]: target = _('file') + ' ' else: target = _('folder') + ' ' p = list[0][0][len(os.path.dirname(list[0][0])):] if p[0] == '/': p = p[1:] target_list += p + '?' text = _('You want to delete') + '\n%s%s' % ( target, unicode(target_list, 'utf8')) self.label_question = gtk.Label(text) self.label_question.set_alignment(0.0, 0.0) hbbox = gtk.HButtonBox() hbbox.set_layout(gtk.BUTTONBOX_SPREAD) #hbbox.set_spacings(10) self.butt_ok = gtk.Button(stock='gtk-ok') self.butt_cancel = gtk.Button(stock='gtk-cancel') self.butt_ok.connect('clicked', self.ok_button_click, list) self.butt_cancel.connect('clicked', self.destr) hbbox.pack_start(self.butt_ok) hbbox.pack_start(self.butt_cancel) hbox.pack_start(self.icon_image) hbox.pack_start(self.label_question) vbox.pack_start(hbox) vbox.pack_start(hbbox) self.add(vbox) self.show_all()
def __init__(self, list): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) list = [[gio.File(i[0]).get_path(), i[1]] for i in list] self.set_resizable(False) self.set_modal(True) vbox = gtk.VBox(False, 2) vbox.set_spacing(3) self.set_border_width(5) hbox = gtk.HBox(False, 2) hbox.set_spacing(10) self.set_title(self_name) self.icon_image = gtk.Image() pix = function.icon_load_try('gtk-help', 50) self.icon_image.set_from_pixbuf(pix) self.set_icon(pix) self.set_position(gtk.WIN_POS_CENTER) target_list = '' if len(list) > 1: if len(list) > 4: for i in xrange(4): p = list[i][0][len(os.path.dirname(list[0][0])):] + '\n' if p[0] == '/': p = p[1:] target_list += p target_list += '...' else: for i in xrange(len(list)): p = list[i][0][len(os.path.dirname(list[0][0])):] + '\n' if p[0] == '/': p = p[1:] target_list += p target = _('files/folders (%d th.)?:\n' % len(list)) else: if list[0][1]: target = _('file') + ' ' else: target = _('folder') + ' ' p = list[0][0][len(os.path.dirname(list[0][0])):] if p[0] == '/': p = p[1:] target_list += p + '?' text = _('You want to delete') + '\n%s%s' % (target, unicode(target_list, 'utf8')) self.label_question = gtk.Label(text) self.label_question.set_alignment(0.0, 0.0) hbbox = gtk.HButtonBox() hbbox.set_layout(gtk.BUTTONBOX_SPREAD) #hbbox.set_spacings(10) self.butt_ok = gtk.Button(stock='gtk-ok') self.butt_cancel = gtk.Button(stock='gtk-cancel') self.butt_ok.connect('clicked', self.ok_button_click, list) self.butt_cancel.connect('clicked', self.destr) hbbox.pack_start(self.butt_ok) hbbox.pack_start(self.butt_cancel) hbox.pack_start(self.icon_image) hbox.pack_start(self.label_question) vbox.pack_start(hbox) vbox.pack_start(hbbox) self.add(vbox) self.show_all()
def __init__(self, dest, list): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.set_resizable(False) self.set_modal(True) vbox = gtk.VBox(False, 5) self.set_border_width(5) self.Exit = False self.Pause = False self.set_title(_('Delete')) self.set_icon(function.icon_load_try('gtk-clear', 20)) self.set_position(gtk.WIN_POS_CENTER) self.dest = dest self.list = list self.list.reverse() self.n = len(list) + len(dest) self.count = 0 self.progress1 = gtk.ProgressBar() self.progress1.set_text('0') self.progress1.set_size_request(450, -1) self.label_progres = gtk.Label() self.label_src = gtk.Label() self.label_src.set_size_request(450, -1) tab = gtk.Table(1, 3, True) tab.set_col_spacings(30) self.butt_cen = gtk.Button(stock='gtk-cancel') self.butt_cen.connect('clicked', self.but_destr) self.butt_ps = gtk.Button(_('_Pause')) self.butt_ps.connect('clicked', self.restart) tab.attach(gtk.Label(), 0, 1, 0, 1) tab.attach(self.butt_cen, 1, 2, 0, 1) tab.attach(self.butt_ps, 2, 3, 0, 1) vbox.pack_start(self.label_progres) vbox.pack_start(gtk.HSeparator()) vbox.pack_start(self.label_src) vbox.pack_start(self.progress1) vbox.pack_start(tab) self.timer = threading.Timer(0, self.copy_timer) self.add(vbox) self.show_all() self.timer.start()
def __init__(self, dest, list): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.set_resizable(False) self.set_modal(True) vbox = gtk.VBox(False, 5) self.set_border_width(5) self.Exit = False self.Pause = False self.set_title(_('Delete')) self.set_icon(function.icon_load_try('gtk-clear', 20)) self.set_position(gtk.WIN_POS_CENTER) self.dest = dest self.list = list self.list.reverse() self.n = len(list) + len(dest) self.count = 0 self.progress1 = gtk.ProgressBar() self.progress1.set_text('0') self.progress1.set_size_request(450, -1) self.label_progres = gtk.Label() self.label_src = gtk.Label() self.label_src.set_size_request(450, -1) tab = gtk.Table(1, 3, True) tab.set_col_spacings(30) self.butt_cen = gtk.Button(stock='gtk-cancel') self.butt_cen.connect('clicked', self.but_destr) self.butt_ps = gtk.Button(_('_Pause')) self.butt_ps.connect('clicked', self.restart) tab.attach(gtk.Label(), 0, 1, 0, 1) tab.attach(self.butt_cen, 1, 2, 0, 1) tab.attach(self.butt_ps, 2, 3, 0, 1) vbox.pack_start(self.label_progres) vbox.pack_start(gtk.HSeparator()) vbox.pack_start(self.label_src) vbox.pack_start(self.progress1) vbox.pack_start(tab) self.timer = threading.Timer(0, self.copy_timer) self.add(vbox) self.show_all() self.timer.start()
def __init__(self, text): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.set_resizable(False) self.set_border_width(5) self.set_modal(True) self.set_icon(function.icon_load_try('gtk-dialog-info', 20)) self.set_position(gtk.WIN_POS_CENTER) self.set_title(_('Error! I not can read file')) if os.path.exists(text): f1 = _('Exists') f2 = function.get_file_size(text) f3 = function.get_file_attr(text) f4 = function.get_custom_mimetype(path) if os.path.islink(text): f5 = _('Link') f6 = os.readlink(text) else: f5 = _('Not link') f6 = '--' else: f1 = _('Not exists') f2 = '--' f3 = '--' f4 = '--' f5 = '--' f6 = '--' vbox = gtk.VBox(False, 8) hbox1 = gtk.HBox(False) vbox2 = gtk.VBox(False, 2) vbox3 = gtk.VBox(False, 2) hbox2 = gtk.HBox(False) hbox3 = gtk.HBox(False) hbox4 = gtk.HBox(False) hbox5 = gtk.HBox(False) hbox6 = gtk.HBox(False) hbox7 = gtk.HBox(False) bbox = gtk.HButtonBox() bbox.set_border_width(5) bbox.set_layout(gtk.BUTTONBOX_SPREAD) bbox.set_spacing(0) self.butt_miss = gtk.Button(_('_Miss')) self.butt_again = gtk.Button(_('_Repeat')) self.butt_miss_all = gtk.Button(_('Miss _All')) self.butt_cancel = gtk.Button(stock='gtk-cancel') bbox.add(self.butt_miss) bbox.add(self.butt_again) bbox.add(self.butt_miss_all) bbox.add(self.butt_cancel) self.label_mesage = gtk.Label() self.label_mesage.set_text(_('Error! I not can read file')) self.label_mesage.set_alignment(0.0, 0.5) self.label_mesage.set_size_request(350, -1) self.label_file = gtk.Label() self.label_file.set_text(text) self.label_file.set_alignment(0.0, 0.5) self.label_file.set_size_request(350, -1) hbox2.pack_start(self.labe_s(_('File'), 0.0)) hbox2.pack_start(gtk.VSeparator()) hbox2.pack_start(self.labe_s(f1, 1.0)) hbox3.pack_start(self.labe_s(_('Size'), 0.0)) hbox3.pack_start(gtk.VSeparator()) hbox3.pack_start(self.labe_s(f2, 1.0)) hbox4.pack_start(self.labe_s(_('Attributes'), 0.0)) hbox4.pack_start(gtk.VSeparator()) hbox4.pack_start(self.labe_s(f3, 1.0)) hbox5.pack_start(self.labe_s(_('Type'), 0.0)) hbox5.pack_start(gtk.VSeparator()) hbox5.pack_start(self.labe_s(f4, 1.0)) hbox6.pack_start(self.labe_s(f5, 0.0)) hbox7.pack_start(self.labe_s(f6, 0.5)) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox2) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox3) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox4) vbox3.pack_start(gtk.HSeparator()) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox5) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox6) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox7) vbox2.pack_start(gtk.HSeparator()) l = gtk.Label() l.set_size_request(30, -1) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(vbox3, False) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(l, False) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(vbox2, True) hbox1.pack_start(gtk.VSeparator(), False) vbox.pack_start(self.label_mesage) vbox.pack_start(self.label_file) vbox.pack_start(hbox1) vbox.pack_start(bbox) self.add(vbox)
def __init__(self, dest, list, destpath, current_path, siz, remove_after): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.Exit = False self.Pause = False self.Miss = False self.set_modal(True) self.set_resizable(False) vbox = gtk.VBox(False, 2) self.set_border_width(5) self.remove_after = remove_after if self.remove_after: self.set_icon(function.icon_load_try('gtk-cut', 20)) else: self.set_icon(function.icon_load_try('gtk-copy', 20)) self.set_position(gtk.WIN_POS_CENTER) self.current_path = current_path self.destpath = destpath self.dest = dest self.list = list self.list.reverse() self.n = len(list) + len(dest) self.count = 0 self.siz = siz self.siz_count = 0 self.s_count = 0 self.progress1 = gtk.ProgressBar() self.progress1.set_text('0') self.progress1.set_size_request(450, -1) if len(self.dest) > 1 or os.path.isdir(self.dest[0][0]): self.multi = True self.progress2 = gtk.ProgressBar() self.progress2.set_text('0') self.progress2.set_size_request(450, -1) else: self.multi = False self.label_progres = gtk.Label() self.label_progres.set_size_request(450, -1) self.label_src = gtk.Label() self.label_src.set_alignment(0.0, 0.5) self.label_src.set_size_request(450, -1) self.label_dest = gtk.Label() self.label_dest.set_alignment(0.0, 0.5) self.label_dest.set_size_request(450, -1) tab = gtk.Table(1, 3, True) tab.set_col_spacings(30) self.butt_cen = gtk.Button(stock='gtk-cancel') self.butt_cen.connect('clicked', self.but_destr) self.butt_ps = gtk.Button(_('Pause')) self.butt_ps.connect('clicked', self.restart) tab.attach(gtk.Label(), 0, 1, 0, 1) tab.attach(self.butt_cen, 1, 2, 0, 1) tab.attach(self.butt_ps, 2, 3, 0, 1) vbox.pack_start(self.label_progres) vbox.pack_start(gtk.HSeparator()) vbox.pack_start(self.label_src) vbox.pack_start(self.label_dest) vbox.pack_start(self.progress1) if self.multi: vbox.pack_start(self.progress2) vbox.pack_start(tab) self.add(vbox) self.show_all() self.timer = threading.Timer(0, self.copy_timer) self.timer.start()
def __init__(self, text): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.set_resizable(False) self.set_border_width(5) self.set_modal(True) self.set_icon(function.icon_load_try('gtk-dialog-info', 20)) self.set_position(gtk.WIN_POS_CENTER) self.set_title(_('Error! I not can read file')) if os.path.exists(text): f1 = _('Exists') f2 = function.get_file_size(text) f3 = function.get_file_attr(text) f4 = function.get_custom_mimetype(path) if os.path.islink(text): f5 = _('Link') f6 = os.readlink(text) else: f5 = _('Not link') f6 = '--' else: f1 = _('Not exists') f2 = '--' f3 = '--' f4 = '--' f5 = '--' f6 = '--' vbox = gtk.VBox(False, 8) hbox1 = gtk.HBox(False) vbox2 = gtk.VBox(False, 2) vbox3 = gtk.VBox(False, 2) hbox2 = gtk.HBox(False) hbox3 = gtk.HBox(False) hbox4 = gtk.HBox(False) hbox5 = gtk.HBox(False) hbox6 = gtk.HBox(False) hbox7 = gtk.HBox(False) bbox = gtk.HButtonBox() bbox.set_border_width(5) bbox.set_layout(gtk.BUTTONBOX_SPREAD) bbox.set_spacing(0) self.butt_miss = gtk.Button(_('_Miss')) self.butt_again = gtk.Button(_('_Repeat')) self.butt_miss_all = gtk.Button(_('Miss _All')) self.butt_cancel = gtk.Button(stock='gtk-cancel') bbox.add(self.butt_miss) bbox.add(self.butt_again) bbox.add(self.butt_miss_all) bbox.add(self.butt_cancel) self.label_mesage = gtk.Label() self.label_mesage.set_text(_('Error! I not can read file')) self.label_mesage.set_alignment(0.0, 0.5) self.label_mesage.set_size_request(350, -1) self.label_file = gtk.Label() self.label_file.set_text(text) self.label_file.set_alignment(0.0, 0.5) self.label_file.set_size_request(350, -1) hbox2.pack_start(self.labe_s(_('File'), 0.0)) hbox2.pack_start(gtk.VSeparator()) hbox2.pack_start(self.labe_s(f1, 1.0)) hbox3.pack_start(self.labe_s(_('Size'), 0.0)) hbox3.pack_start(gtk.VSeparator()) hbox3.pack_start(self.labe_s(f2, 1.0)) hbox4.pack_start(self.labe_s(_('Attributes'), 0.0)) hbox4.pack_start(gtk.VSeparator()) hbox4.pack_start(self.labe_s(f3, 1.0)) hbox5.pack_start(self.labe_s(_('Type'), 0.0)) hbox5.pack_start(gtk.VSeparator()) hbox5.pack_start(self.labe_s(f4, 1.0)) hbox6.pack_start(self.labe_s(f5, 0.0)) hbox7.pack_start(self.labe_s(f6, 0.5)) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox2) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox3) vbox3.pack_start(gtk.HSeparator()) vbox3.pack_start(hbox4) vbox3.pack_start(gtk.HSeparator()) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox5) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox6) vbox2.pack_start(gtk.HSeparator()) vbox2.pack_start(hbox7) vbox2.pack_start(gtk.HSeparator()) l = gtk.Label() l.set_size_request(30, -1) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(vbox3, False) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(l, False) hbox1.pack_start(gtk.VSeparator(), False) hbox1.pack_start(vbox2, True) hbox1.pack_start(gtk.VSeparator(), False) vbox.pack_start(self.label_mesage) vbox.pack_start(self.label_file) vbox.pack_start(hbox1) vbox.pack_start(bbox) self.add(vbox)
def __init__(self, dest, list, destpath, current_path, siz, remove_after): gtk.Window.__init__(self) self.connect('destroy', self.destr) self.connect('key-release-event', self.key_event) self.Exit = False self.Pause = False self.Miss = False self.set_modal(True) self.set_resizable(False) vbox = gtk.VBox(False, 2) self.set_border_width(5) self.remove_after = remove_after if self.remove_after: self.set_icon(function.icon_load_try('gtk-cut', 20)) else: self.set_icon(function.icon_load_try('gtk-copy', 20)) self.set_position(gtk.WIN_POS_CENTER) self.current_path = current_path self.destpath = destpath self.dest = dest self.list = list self.list.reverse() self.n = len(list) + len(dest) self.count = 0 self.siz = siz self.siz_count = 0 self.s_count = 0 self.progress1 = gtk.ProgressBar() self.progress1.set_text('0') self.progress1.set_size_request(450, -1) if len(self.dest) > 1 or os.path.isdir(self.dest[0][0]): self.multi = True self.progress2 = gtk.ProgressBar() self.progress2.set_text('0') self.progress2.set_size_request(450, -1) else: self.multi = False self.label_progres = gtk.Label() self.label_progres.set_size_request(450, -1) self.label_src = gtk.Label() self.label_src.set_alignment(0.0, 0.5) self.label_src.set_size_request(450, -1) self.label_dest = gtk.Label() self.label_dest.set_alignment(0.0, 0.5) self.label_dest.set_size_request(450, -1) tab = gtk.Table(1, 3, True) tab.set_col_spacings(30) self.butt_cen = gtk.Button(stock='gtk-cancel') self.butt_cen.connect('clicked', self.but_destr) self.butt_ps = gtk.Button(_('Pause')) self.butt_ps.connect('clicked', self.restart) tab.attach(gtk.Label(), 0, 1, 0, 1) tab.attach(self.butt_cen, 1, 2, 0, 1) tab.attach(self.butt_ps, 2, 3, 0, 1) vbox.pack_start(self.label_progres) vbox.pack_start(gtk.HSeparator()) vbox.pack_start(self.label_src) vbox.pack_start(self.label_dest) vbox.pack_start(self.progress1) if self.multi: vbox.pack_start(self.progress2) vbox.pack_start(tab) self.add(vbox) self.show_all() self.timer = threading.Timer(0, self.copy_timer) self.timer.start()