Hi,
this patch refactor some Smalltalk commands, they were not really undoable (a simple workspace evaluation could break them), thus I remove the undo side. Also that make the whole undo/redo stack more fragile (ctrl+z would undo the text and after a command). I also add a mit licence on the touched files Cheers, Gwen _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk Refactor-Smalltalk-commands.patch (72K) Download Attachment |
On 02/06/2013 19:31, Gwenaël Casaccio wrote:
> Hi, > > this patch refactor some Smalltalk commands, they were not really > undoable > (a simple workspace evaluation could break them), thus I remove the > undo side. > Also that make the whole undo/redo stack more fragile (ctrl+z would > undo the text > and after a command). I also add a mit licence on the touched files > > Cheers, > Gwen > Gwen _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk 0001-Refactor-some-Smalltalk-undo-commands-make-them-subc.patch (74K) Download Attachment |
On Mon, Jun 17, 2013 at 02:20:01PM +0200, Gwenaël Casaccio wrote:
> > Here is the new version of it (without the copyright header changes). Thanks. For renames like these you might also want to help git format-patch and pass the -M option to it. And the patch starts to be easily reviewable. You have replaced precondition with valid.. removed the undo.. and renamed the redo to execute. > diff --git a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st > index 996669e..f7c06a2 100644 > --- a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st > +++ b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st > @@ -74,11 +74,11 @@ Command subclass: AcceptItCommand [ > <category: 'command'> > > target state hasSelectedCategory ifFalse: [ ^ self acceptClassDefinition ]. > - (AddMethodUndoCommand > + SysAddMethodCommand > add: target sourceCode > classified: target state category > in: target state classOrMeta > - browser: target) push > + browser: target when/how is this command executed now? > + execute [ > + <category: 'events'> > + > + newClass := parentClass subclass: newClassName environment: namespace. > + namespace at: newClass name put: newClass. > + newClass category: classCategory fullname. mixing tabs and spaces? > diff --git a/packages/visualgst/Gtk/GtkEntry.st b/packages/visualgst/Gtk/GtkEntry.st > new file mode 100644 > index 0000000..fc34fdb > --- /dev/null > +++ b/packages/visualgst/Gtk/GtkEntry.st > @@ -0,0 +1,9 @@ > +GTK.GtkEntry extend [ > + > + getText [ > + > + ^ self getBuffer getText > + ] > + > +] > + > diff --git a/packages/visualgst/Gtk/GtkEntryBuffer.st b/packages/visualgst/Gtk/GtkEntryBuffer.st > new file mode 100644 > index 0000000..eceb980 > --- /dev/null > +++ b/packages/visualgst/Gtk/GtkEntryBuffer.st > @@ -0,0 +1,9 @@ > +GTK.GtkEntryBuffer extend [ > + > + getText [ > + > + <cCall: 'gtk_entry_buffer_get_text' returning: #string args: #( #self #cObject )> > + ] > + > +] I think these belong to another patch? _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk |
On 17/06/2013 17:28, Holger Hans Peter Freyther wrote:
> On Mon, Jun 17, 2013 at 02:20:01PM +0200, Gwenaël Casaccio wrote: >> Here is the new version of it (without the copyright header changes). > Thanks. For renames like these you might also want to help git format-patch > and pass the -M option to it. And the patch starts to be easily reviewable. > You have replaced precondition with valid.. removed the undo.. and renamed > the redo to execute. > >> diff --git a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st >> index 996669e..f7c06a2 100644 >> --- a/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st >> +++ b/packages/visualgst/Commands/SmalltalkMenus/AcceptItCommand.st >> @@ -74,11 +74,11 @@ Command subclass: AcceptItCommand [ >> <category: 'command'> >> >> target state hasSelectedCategory ifFalse: [ ^ self acceptClassDefinition ]. >> - (AddMethodUndoCommand >> + SysAddMethodCommand >> add: target sourceCode >> classified: target state category >> in: target state classOrMeta >> - browser: target) push >> + browser: target > > when/how is this command executed now? > >> + execute [ >> + <category: 'events'> >> + >> + newClass := parentClass subclass: newClassName environment: namespace. >> + namespace at: newClass name put: newClass. >> + newClass category: classCategory fullname. > > mixing tabs and spaces? > > >> diff --git a/packages/visualgst/Gtk/GtkEntry.st b/packages/visualgst/Gtk/GtkEntry.st >> new file mode 100644 >> index 0000000..fc34fdb >> --- /dev/null >> +++ b/packages/visualgst/Gtk/GtkEntry.st >> @@ -0,0 +1,9 @@ >> +GTK.GtkEntry extend [ >> + >> + getText [ >> + >> + ^ self getBuffer getText >> + ] >> + >> +] >> + >> diff --git a/packages/visualgst/Gtk/GtkEntryBuffer.st b/packages/visualgst/Gtk/GtkEntryBuffer.st >> new file mode 100644 >> index 0000000..eceb980 >> --- /dev/null >> +++ b/packages/visualgst/Gtk/GtkEntryBuffer.st >> @@ -0,0 +1,9 @@ >> +GTK.GtkEntryBuffer extend [ >> + >> + getText [ >> + >> + <cCall: 'gtk_entry_buffer_get_text' returning: #string args: #( #self #cObject )> >> + ] >> + >> +] > > I think these belong to another patch? Cheers, Gwen _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk 0001-Refactor-some-Smalltalk-undo-commands-make-them-subc.patch (32K) Download Attachment 0002-Add-a-primitive-for-retrieving-the-GtkEntryBuffer-te.patch (2K) Download Attachment |
Free forum by Nabble | Edit this page |