예제 #1
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        log.debug("incoming path: %s"%path)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        action = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            ancestor, theirs = self.get_revisioned_paths(path)
            shutil.copyfile(theirs, path)
            self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            working = self.get_working_path(path)
            ancestor, theirs = self.get_revisioned_paths(path)
            
            log.debug("launching merge tool with base: %s, mine: %s, theirs: %s, merged: %s"%(ancestor, working, theirs, path))
            rabbitvcs.util.helper.launch_merge_tool(base=ancestor, mine=working, theirs=theirs, merged=path)

            dialog = rabbitvcs.ui.dialog.MarkResolvedPrompt()
            mark_resolved = dialog.run()
            dialog.destroy()

            if mark_resolved == 1:
                self.svn.resolve(path)

        self.close()
예제 #2
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        log.debug("incoming path: %s"%path)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        action = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            ancestor, theirs = self.get_revisioned_paths(path)
            shutil.copyfile(theirs, path)
            self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            working = self.get_working_path(path)
            ancestor, theirs = self.get_revisioned_paths(path)
            
            log.debug("launching merge tool with base: %s, mine: %s, theirs: %s, merged: %s"%(ancestor, working, theirs, path))
            rabbitvcs.util.helper.launch_merge_tool(base=ancestor, mine=working, theirs=theirs, merged=path)

            dialog = rabbitvcs.ui.dialog.MarkResolvedPrompt()
            mark_resolved = dialog.run()
            dialog.destroy()

            if mark_resolved == 1:
                self.svn.resolve(path)

        self.close()
예제 #3
0
    def get_log_message(self):
        """
        A callback method that retrieves a supplied log message.

        Returns a list where the first element is True/False.  Returning true
        tells the action to continue, false tells it to cancel.  The second
        element is the log message, which is specified by self.message.
        self.message is set by calling the self.set_log_message() method from
        the UI interface class.

        @rtype:  (boolean, string)
        @return: (True=continue/False=cancel, log message)

        """

        if self.message is None:
            gtk.gdk.threads_enter()
            dialog = rabbitvcs.ui.dialog.TextChange(_("Log Message"))
            result = dialog.run()
            gtk.gdk.threads_leave()

            should_continue = (result[0] == gtk.RESPONSE_OK)
            return should_continue, result[1].encode("utf-8")
        else:
            return True, self.message.encode("utf-8")
예제 #4
0
    def get_client_cert(self, realm, may_save):
        """
        A callback method that is used to get an ssl certificate.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   realm:      string
        @param  realm:      The certificate realm.

        @type   may_save:   boolean
        @param  may_save:   Whether or not the passphrase can be saved.

        @rtype:             (boolean, string, boolean)
        @return:            (True=continue/False=cancel, password, may save)

        """

        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.SSLClientCertPrompt(
            realm,
            may_save
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        return result
예제 #5
0
    def get_user(self):
        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.NameEmailPrompt()
        result = dialog.run()
        gtk.gdk.threads_leave()

        return result
예제 #6
0
    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()
예제 #7
0
    def get_user(self):
        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.NameEmailPrompt()
        result = dialog.run()
        gtk.gdk.threads_leave()

        return result
예제 #8
0
    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()
예제 #9
0
    def get_log_message(self):
        """
        A callback method that retrieves a supplied log message.

        Returns a list where the first element is True/False.  Returning true
        tells the action to continue, false tells it to cancel.  The second
        element is the log message, which is specified by self.message.
        self.message is set by calling the self.set_log_message() method from
        the UI interface class.

        @rtype:  (boolean, string)
        @return: (True=continue/False=cancel, log message)

        """

        if self.message is None:
            gtk.gdk.threads_enter()
            dialog = rabbitvcs.ui.dialog.TextChange(_("Log Message"))
            result = dialog.run()
            gtk.gdk.threads_leave()

            should_continue = (result[0] == gtk.RESPONSE_OK)
            return should_continue, result[1].encode("utf-8")
        else:
            return True, self.message.encode("utf-8")
예제 #10
0
    def get_client_cert(self, realm, may_save):
        """
        A callback method that is used to get an ssl certificate.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   realm:      string
        @param  realm:      The certificate realm.

        @type   may_save:   boolean
        @param  may_save:   Whether or not the passphrase can be saved.

        @rtype:             (boolean, string, boolean)
        @return:            (True=continue/False=cancel, password, may save)

        """

        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.SSLClientCertPrompt(
            realm,
            may_save
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        return result
예제 #11
0
파일: action.py 프로젝트: zwr8/rabbitvcs
    def saveas(self, path=None):
        if path is None:
            from rabbitvcs.ui.dialog import FileSaveAs
            dialog = FileSaveAs()
            path = dialog.run()

        if path is not None:
            fh = open(path, "w")
            fh.write(self.table.generate_string_from_data())
            fh.close()
예제 #12
0
    def saveas(self, path=None):
        if path is None:
            from rabbitvcs.ui.dialog import FileSaveAs
            dialog = FileSaveAs()
            path = dialog.run()

        if path is not None:
            fh = open(path, "w")
            fh.write(self.table.generate_string_from_data())
            fh.close()
예제 #13
0
    def delete_properties(self, names):

        recursive = False

        if (os.path.isdir(self.path)):
            dialog = rabbitvcs.ui.dialog.Confirmation(RECURSIVE_DELETE_MSG)
            recursive = dialog.run()

        for name in names:
            self.svn.propdel(self.path, name, recurse=recursive)

        self.refresh()
    def delete_properties(self, names):
        
        recursive = False

        if(os.path.isdir(self.path)):
            dialog = rabbitvcs.ui.dialog.Confirmation(RECURSIVE_DELETE_MSG)
            recursive = dialog.run()
        
        for name in names:
            self.svn.propdel(self.path, name, recurse=recursive)

        self.refresh()
예제 #15
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        (action, mark_resolved) = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            head = self.get_head_path(path)
            shutil.copyfile(head, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            head = self.get_head_path(path)
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            
            rabbitvcs.util.helper.launch_merge_tool(path, head)

            if mark_resolved:
                self.svn.resolve(path)

        self.close()
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        (action, mark_resolved) = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            head = self.get_head_path(path)
            shutil.copyfile(head, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            head = self.get_head_path(path)
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            
            rabbitvcs.util.helper.launch_merge_tool(path, head)

            if mark_resolved:
                self.svn.resolve(path)

        self.close()
 def edit_property(self, name=""):
     
     value = self.svn.propget(self.path, name)
     
     dialog = rabbitvcs.ui.dialog.Property(name, value)
     
     name,value,recurse = dialog.run()
     if name:
         success = self.svn.propset(self.path, name, value, overwrite=True, recurse=False)
         if not success:
             rabbitvcs.ui.dialog.MessageBox(_("Unable to set new value for property."))
         
     self.refresh()
예제 #18
0
    def create_repository_folder(self, data=None, user_data=None):
        from rabbitvcs.ui.dialog import NewFolder
        dialog = NewFolder()
        result = dialog.run()
        if result is None:
            return

        (folder_name, log_message) = result
        new_url = self.paths[0].rstrip("/") + "/" + folder_name

        self.caller.action = rabbitvcs.ui.action.SVNAction(self.svn,
                                                           notification=False)
        self.caller.action.append(self.svn.mkdir, new_url, log_message)
        self.caller.action.append(self.svn.list, self.paths[0], recurse=False)
        self.caller.action.append(self.caller.populate_table, 1)
        self.caller.action.start()
예제 #19
0
    def create_folder(self, where):
        from rabbitvcs.ui.dialog import NewFolder
        dialog = NewFolder()
        result = dialog.run()
        if result is None:
            return

        (folder_name, log_message) = result
        new_url = where.rstrip("/") + "/" + folder_name

        self.action = rabbitvcs.ui.action.SVNAction(self.svn,
                                                    notification=False)
        self.action.append(self.svn.mkdir, new_url, log_message)
        self.action.append(self.svn.list, where, recurse=False)
        self.action.append(self.populate_table, 1)
        self.action.schedule()
예제 #20
0
    def edit_property(self, name=""):

        value = self.svn.propget(self.path, name)

        dialog = rabbitvcs.ui.dialog.Property(name, value)

        name, value, recurse = dialog.run()
        if name:
            success = self.svn.propset(self.path,
                                       name,
                                       value,
                                       overwrite=True,
                                       recurse=False)
            if not success:
                rabbitvcs.ui.dialog.MessageBox(
                    _("Unable to set new value for property."))

        self.refresh()
예제 #21
0
    def create_repository_folder(self, data=None, user_data=None):
        from rabbitvcs.ui.dialog import NewFolder
        dialog = NewFolder()
        result = dialog.run()
        if result is None:
            return

        (folder_name, log_message) = result
        new_url = self.paths[0].rstrip("/") + "/" + folder_name

        self.caller.action = rabbitvcs.ui.action.SVNAction(
            self.svn,
            notification=False
        )
        self.caller.action.append(self.svn.mkdir, new_url, log_message)
        self.caller.action.append(self.svn.list, self.paths[0], recurse=False)
        self.caller.action.append(self.caller.populate_table, 1)
        self.caller.action.schedule()
예제 #22
0
    def get_ssl_trust(self, data):
        """
        A callback method that requires the user to either accept or deny
        a certificate from an ssl secured repository.  It opens a dialog that
        shows the user information about the ssl certificate and then gives
        them the option of denying, accepting, or accepting once.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   data:   dictionary
        @param  data:   A dictionary with SSL certificate info.

        @rtype:         (boolean, int, boolean)
        @return:        (True=Accept/False=Deny, number of accepted failures, remember)

        """

        gtk.gdk.threads_enter()

        if not data:
            return (False, 0, False)

        dialog = rabbitvcs.ui.dialog.Certificate(
            data["realm"],
            data["hostname"],
            data["issuer_dname"],
            data["valid_from"],
            data["valid_until"],
            data["finger_print"]
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        if result == 0:
            #Deny
            return (False, 0, False)
        elif result == 1:
            #Accept Once
            return (True, data["failures"], False)
        elif result == 2:
            #Accept Forever
            return (True, data["failures"], True)
예제 #23
0
    def get_ssl_trust(self, data):
        """
        A callback method that requires the user to either accept or deny
        a certificate from an ssl secured repository.  It opens a dialog that
        shows the user information about the ssl certificate and then gives
        them the option of denying, accepting, or accepting once.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   data:   dictionary
        @param  data:   A dictionary with SSL certificate info.

        @rtype:         (boolean, int, boolean)
        @return:        (True=Accept/False=Deny, number of accepted failures, remember)

        """

        gtk.gdk.threads_enter()

        if not data:
            return (False, 0, False)

        dialog = rabbitvcs.ui.dialog.Certificate(
            data["realm"],
            data["hostname"],
            data["issuer_dname"],
            data["valid_from"],
            data["valid_until"],
            data["finger_print"]
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        if result == 0:
            #Deny
            return (False, 0, False)
        elif result == 1:
            #Accept Once
            return (True, data["failures"], False)
        elif result == 2:
            #Accept Forever
            return (True, data["failures"], True)
예제 #24
0
    def choose_patch_path(self):
        path = ""

        dialog = gtk.FileChooserDialog(_("Create Patch"), None,
                                       gtk.FILE_CHOOSER_ACTION_SAVE,
                                       (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                        gtk.STOCK_SAVE, gtk.RESPONSE_OK))
        dialog.set_do_overwrite_confirmation(True)
        dialog.set_default_response(gtk.RESPONSE_OK)
        dialog.set_current_folder_uri(
            get_common_directory(self.paths).replace("file://", ""))
        response = dialog.run()

        if response == gtk.RESPONSE_OK:
            path = dialog.get_filename()

        dialog.destroy()

        return path
    def choose_patch_path(self):
        path = ""

        dialog = Gtk.FileChooserDialog(title=_("Create Patch"),
                                       parent=None,
                                       action=Gtk.FileChooserAction.SAVE)
        dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
        dialog.add_button(_("_Create"), Gtk.ResponseType.OK)
        dialog.set_do_overwrite_confirmation(True)
        dialog.set_default_response(Gtk.ResponseType.OK)
        dialog.set_current_folder_uri(
            helper.get_common_directory(self.paths).replace("file://", ""))
        response = dialog.run()

        if response == Gtk.ResponseType.OK:
            path = dialog.get_filename()

        dialog.destroy()

        return path
예제 #26
0
    def get_login(self, realm, username, may_save):
        """
        A callback method that requests a username/password to login to a
        password-protected repository.  This method runs the Authentication
        dialog, which provides a username, password, and saving widget.  The
        dialog returns a tuple, which is returned directly to the VCS caller.

        If the login fails greater than three times, cancel the action.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   realm:      string
        @param  realm:      The realm of the repository.

        @type   username:   string
        @param  username:   Username passed by the vcs caller.

        @type   may_save:   boolean
        @param  may_save:   Whether or not the authentication can be saved.

        @rtype:             (boolean, string, string, boolean)
        @return:            (True=continue/False=cancel, username,password, may_save)

        """

        if self.login_tries >= 3:
            return (False, "", "", False)

        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.Authentication(
            realm,
            may_save
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        if result is not None:
            self.login_tries += 1

        return result
예제 #27
0
    def get_login(self, realm, username, may_save):
        """
        A callback method that requests a username/password to login to a
        password-protected repository.  This method runs the Authentication
        dialog, which provides a username, password, and saving widget.  The
        dialog returns a tuple, which is returned directly to the VCS caller.

        If the login fails greater than three times, cancel the action.

        The dialog must be called from within a threaded block, otherwise it
        will not be responsive.

        @type   realm:      string
        @param  realm:      The realm of the repository.

        @type   username:   string
        @param  username:   Username passed by the vcs caller.

        @type   may_save:   boolean
        @param  may_save:   Whether or not the authentication can be saved.

        @rtype:             (boolean, string, string, boolean)
        @return:            (True=continue/False=cancel, username,password, may_save)

        """

        if self.login_tries >= 3:
            return (False, "", "", False)

        gtk.gdk.threads_enter()
        dialog = rabbitvcs.ui.dialog.Authentication(
            realm,
            may_save
        )
        result = dialog.run()
        gtk.gdk.threads_leave()

        if result is not None:
            self.login_tries += 1

        return result
예제 #28
0
 def choose_patch_path(self):
     path = ""
     
     dialog = gtk.FileChooserDialog(
         _("Create Patch"),
         None,
         gtk.FILE_CHOOSER_ACTION_SAVE,(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                       gtk.STOCK_SAVE, gtk.RESPONSE_OK))
     dialog.set_do_overwrite_confirmation(True)
     dialog.set_default_response(gtk.RESPONSE_OK)
     dialog.set_current_folder_uri(
         get_common_directory(self.paths).replace("file://", "")
     )
     response = dialog.run()
     
     if response == gtk.RESPONSE_OK:
         path = dialog.get_filename()
         
     dialog.destroy()
     
     return path
예제 #29
0
    def choose_patch_path(self):
        path = ""

        dialog = Gtk.FileChooserDialog(
            title = _("Create Patch"),
            parent = None,
            action = Gtk.FileChooserAction.SAVE)
        dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
        dialog.add_button(_("_Create"), Gtk.ResponseType.OK)
        dialog.set_do_overwrite_confirmation(True)
        dialog.set_default_response(Gtk.ResponseType.OK)
        dialog.set_current_folder_uri(
            helper.get_common_directory(self.paths).replace("file://", "")
        )
        response = dialog.run()

        if response == Gtk.ResponseType.OK:
            path = dialog.get_filename()

        dialog.destroy()

        return path
예제 #30
0
    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()
예제 #31
0
    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()
예제 #32
0
    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()
예제 #33
0
    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()
예제 #34
0
 def on_new_clicked(self, widget):
     dialog = rabbitvcs.ui.dialog.Property()
     name, value, recurse = dialog.run()
     if name:
         self.table.append([recurse, name, value])
예제 #35
0
 def on_edit_clicked(self, widget):
     (recurse, name, value) = self.get_selected_name_value()
     dialog = rabbitvcs.ui.dialog.Property(name, value)
     name, value, recurse = dialog.run()
     if name:
         self.set_selected_name_value(name, value, recurse)
예제 #36
0
파일: import.py 프로젝트: kuznetz/rabbitvcs
 def on_previous_messages_clicked(self, widget, data=None):
     dialog = rabbitvcs.ui.dialog.PreviousMessages()
     message = dialog.run()
     if message is not None:
         self.message.set_text(message)
예제 #37
0
 def on_new_clicked(self, widget):
     dialog = rabbitvcs.ui.dialog.Property()
     name,value,recurse = dialog.run()
     if name:
         self.table.append([recurse,name,value])
예제 #38
0
 def on_previous_messages_clicked(self, widget, data=None):
     dialog = rabbitvcs.ui.dialog.PreviousMessages()
     message = dialog.run()
     if message is not None:
         self.message.set_text(message)
예제 #39
0
 def on_edit_clicked(self, widget):
     (recurse,name,value) = self.get_selected_name_value()
     dialog = rabbitvcs.ui.dialog.Property(name, value)
     name,value,recurse = dialog.run()
     if name:
         self.set_selected_name_value(name, value, recurse)