Change 14650

jmistry
jmistry committed this change into //guest/perforce_software/p4ruby/main
Request Review
Download .zip
Progress indicator for P4Ruby.

There is a new class P4::Progress that is set up to be subclassed by a user.
It has the following interface and P4Ruby expects the following class methods to
be defined by the user (even if it's an empty implementation):

    class Progress:
        def init(type)
        end

        def description(description, units )
        end

        def total( total )
        end

        def update( position )
        end

        def done( fail )
        end
    end

Users need to create a subclass of P4::Progress and assign an instance to P4
to enable the progress indicator:

class MyProgress < P4::Progress
    def update(pos):
       # do something with the value here

    # other methods

p4 = P4.new
p4.progress = MyProgress.new

New feature to be documented in the release notes.
  • Files 9
  • Comments 0
6 edited 3 added 0 deleted
clientprogressruby.cpp#1
Loading...
clientprogressruby.h#1
Loading...
clientuserruby.cpp#24
Loading...
clientuserruby.h#12
Loading...
lib/P4.rb#22
Loading...
p4.cpp#45
Loading...
p4clientapi.cpp#42
Loading...
p4clientapi.h#31
Loading...
test/21_progress.rb#1
Loading...
Tip: Use n and p to cycle through the changes.