def __init__(self, path): InterfaceNonView.__init__(self) self.register_gtk_quit() self.vcs = rabbitvcs.vcs.VCS() self.path = path if not os.path.exists(self.path): MessageBox(_("The requested file or folder does not exist.")) self.close() return dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path) (result, new_path) = dialog.run() if result != Gtk.ResponseType.OK: self.close() return if not new_path: MessageBox(_("The new name field is required")) self.new_path = new_path self.DO_RENAME = True
def __init__(self, path): InterfaceNonView.__init__(self) self.register_gtk_quit() self.vcs = rabbitvcs.vcs.VCS() self.path = path if not os.path.exists(self.path): MessageBox(_("The requested file or folder does not exist.")) self.close() return dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path) (result, new_path) = dialog.run() if result != gtk.RESPONSE_OK: self.close() return if not new_path: MessageBox(_("The new name field is required")) self.new_path = new_path self.DO_RENAME = True
def __init__(self, path): InterfaceNonView.__init__(self) self.register_gtk_quit() self.vcs = rabbitvcs.vcs.VCS() self.path = path if not os.path.exists(self.path): MessageBox(_("The requested file or folder does not exist.")) sys.exit(-1) return dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path) label2 = dialog.get_widget("label2") orgtext = dialog.get_widget("org_text") orgtext.set_text(self.path) label2.set_property("visible", True) orgtext.set_property("visible", True) (result, new_path) = dialog.run() if result != Gtk.ResponseType.OK: sys.exit(-1) return if not new_path: MessageBox(_("The new name field is required")) self.new_path = new_path self.DO_RENAME = True
def browser_copy_to(self, data=None, user_data=None): from rabbitvcs.ui.dialog import OneLineTextChange dialog = OneLineTextChange( _("Where do you want to copy the selection?"), _("New Location:"), self.caller.get_url()) result = dialog.run() if result is None: return (response, new_url) = result if response == Gtk.ResponseType.CANCEL: return sources = self.__generate_sources_list() self.caller.action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False) self.caller.action.append(self.svn.copy_all, sources, new_url, copy_as_child=True) self.caller.action.append(self.svn.list, self.caller.get_url(), recurse=False) self.caller.action.append(self.caller.populate_table, 1) self.caller.action.schedule()
def browser_move_to(self, data=None, user_data=None): from rabbitvcs.ui.dialog import OneLineTextChange dialog = OneLineTextChange( _("Where do you want to move the selection?"), _("New Location:"), self.caller.get_url() ) result = dialog.run() if result is None: return (response, new_url) = result if response == gtk.RESPONSE_CANCEL: return self.caller.action = rabbitvcs.ui.action.SVNAction( self.svn, notification=False ) self.caller.action.append(self.svn.move_all, self.paths, new_url, move_as_child=True) self.caller.action.append(self.svn.list, self.caller.get_url(), recurse=False) self.caller.action.append(self.caller.populate_table, 1) self.caller.action.start()
def rename(self, data=None, user_data=None): (base, filename) = os.path.split(self.paths[0]) from rabbitvcs.ui.dialog import OneLineTextChange dialog = OneLineTextChange(_("Rename"), _("New Name:"), filename) (result, new_name) = dialog.run() if result == Gtk.ResponseType.CANCEL: return new_url = base.rstrip("/") + "/" + new_name path_to_refresh = self.caller.get_url() if self.paths[0] == path_to_refresh: path_to_refresh = new_url self.__update_browser_url(path_to_refresh) self.caller.action = rabbitvcs.ui.action.SVNAction(self.svn, notification=False) self.caller.action.append(self.svn.move, self.paths[0], new_url) self.caller.action.append(self.svn.list, path_to_refresh, recurse=False) self.caller.action.append(self.caller.populate_table, 1) self.caller.action.schedule()