oregano icon indicating copy to clipboard operation
oregano copied to clipboard

New features: undo and redo historial

Open ddwek opened this issue 2 years ago • 3 comments

Hello everyone! A long long time ago I opened an issue about lacking features features such as undo and redo historial to be introduced on this software, but I could not make it real so far.

In fact, here is the solution that all of you expected from me. I'm sorry for having took too long and thank you for your patience.

Back to the point of this commit, you can now make changes like part creation on canvas, parts moved, rotated and deleted ones, as well as you can do the same operations with wires. Operation with textboxes are not currently supported. Everything before mentioned has undo and redo support.

Last but not least, you can watch the .ogv video which will show you the way things work alternating such commands from the toolbar.

Nothing else by now, so... best regards, folks!!!

ddwek avatar Jan 12 '23 16:01 ddwek

Hi Bernhard, of course it does. I've seen many issues from different people related to double trailing slash and things have gone wrong for them. Everyone points to the same question. Note the attached file in this email: it's a light switch schematic generated with netlist and works fine for me and maybe for you too.

Pay special attention to the ".include /usr/local/share/oregano/models/Switch.model" line. If you don't fix the "src/engines/gnucap.c" file, you're going to get a double slash after "models/" dir, that is, ".include /usr/local/share/oregano/models//Switch.model".

Yours sincerely,

Daniel Dwek

On Fri, Jan 13, 2023 at 6:07 AM Bernhard Schuster @.***> wrote:

@.**** commented on this pull request.

In src/engines/gnucap.c https://github.com/drahnr/oregano/pull/255#discussion_r1069115647:

@@ -231,7 +231,7 @@ static gboolean gnucap_generate_netlist (OreganoEngine *engine, const gchar *fil for (iter = output.models; iter; iter = iter->next) { gchar *model; model = (gchar *)iter->data;

  • g_fprintf (file, ".include %s/%s.model\n", OREGANO_MODELDIR, model);
    

Is the OREGANO_MODEL dir guaranteed to have a trailiing backslash?

— Reply to this email directly, view it on GitHub https://github.com/drahnr/oregano/pull/255#pullrequestreview-1247165212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPNXRFI62QOH7BTZXFB5IDWSELNHANCNFSM6AAAAAATZNTJDA . You are receiving this because you authored the thread.Message ID: @.***>

ddwek avatar Jan 13 '23 11:01 ddwek

Hi again, It was always my intention let the vast majority of the code unchanged. As far as I remember, signal handlers are unsigned long type and public members of the "struct _ItemData" structure, so that you can check for values different than zero and make sure that there's a handler connected to be used as a function pointer with optional data passed as argument. In my humble opinion, I wouldn't do that way, but once again, I only focused on stack operations and I tried to not change work done for anyone else. Keep in mind that eliminate all of those handlers will require lot of grepping but after all there's no warranty that software runs properly. Finally, If you still think on getting rid such longs, just let me know and I'm going to do it for you.

On Fri, Jan 13, 2023, 9:56 AM Bernhard Schuster @.***> wrote:

@.**** commented on this pull request.

In src/model/item-data.c https://github.com/drahnr/oregano/pull/255#discussion_r1069409344:

cairo_matrix_init_translate (&(priv->translate), pos->x, pos->y);
  • handler_connected =
  • g_signal_handler_is_connected (G_OBJECT (item_data), item_data->moved_handler_id);
    
  • if (handler_connected) {
  • g_signal_emit_by_name (G_OBJECT (item_data), "moved", pos);
    
  • }
  • handler_connected =
  • g_signal_handler_is_connected (G_OBJECT (item_data), item_data->changed_handler_id);
    
  • if (handler_connected) {
  • g_signal_emit_by_name (G_OBJECT (item_data), "changed");
    
  • }
  • if (signals & EMIT_SIGNAL_CREATED)
  • if (g_signal_handler_is_connected (G_OBJECT (item_data), item_data->created_handler_id))
    
  • 	g_signal_emit_by_name (G_OBJECT (item_data), "created", pos);
    
  • if (signals & EMIT_SIGNAL_MOVED)
  • if (g_signal_handler_is_connected (G_OBJECT (item_data), item_data->moved_handler_id))
    

Why do we need to check if the signal handler is connected?

— Reply to this email directly, view it on GitHub https://github.com/drahnr/oregano/pull/255#pullrequestreview-1247592686, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPNXRE2CVIQWGIWW7ENUP3WSFGGXANCNFSM6AAAAAATZNTJDA . You are receiving this because you authored the thread.Message ID: @.***>

ddwek avatar Jan 13 '23 13:01 ddwek

Awesome, thanks! While I was writing this patch I noticed that "recently opened files" submenu did not work as well as zoom in and out adjusted with the mouse wheel doesn't have a counterpart function to update different values in the "zoom" menu. I think that I can solve it in just a few couple of days if you agree, of course.

Have a great day!

Daniel Dwek

On Tue, Jan 17, 2023, 6:11 AM Bernhard Schuster @.***> wrote:

@.**** approved this pull request.

Thank you! It'll take a few days until I enable CI again

— Reply to this email directly, view it on GitHub https://github.com/drahnr/oregano/pull/255#pullrequestreview-1251163425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPNXRABK2I3CTDLHURYL5DWSZO2NANCNFSM6AAAAAATZNTJDA . You are receiving this because you authored the thread.Message ID: @.***>

ddwek avatar Jan 17 '23 09:01 ddwek