Bug 92994

Summary: class and other dialogues update model before pressing OK or apply
Product: [Applications] umbrello Reporter: Marcos Mayorga <drmay_en>
Component: generalAssignee: Lays Rodrigues <laysrodriguessilva>
Status: CONFIRMED ---    
Severity: normal CC: erikanderson3, greatbunzinni, laysrodriguessilva, ralf.habacker
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: attachment-26376-0.html

Description Marcos Mayorga 2004-11-09 19:29:28 UTC
Version:           1.3.90 (using KDE 3.3.89 (CVS >= 20040820), compiled sources)
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-13)
OS:                Linux (i686) release 2.6.8.1

When 'Delete' in the 'Templates' section of the class dialog properties dialog is pressed, the model is updated instantly, instead of applying changes when the 'apply' button is pressed.
Comment 1 Olivier Vitrat 2007-03-09 14:36:12 UTC
Also found in version 3.5.5-3
see http://bugs.debian.org/348941
Comment 2 FiNeX 2009-08-08 21:29:03 UTC
*** Bug 126469 has been marked as a duplicate of this bug. ***
Comment 3 Ralf Habacker 2015-02-27 22:56:38 UTC
*** Bug 191399 has been marked as a duplicate of this bug. ***
Comment 4 Lays Rodrigues 2016-04-27 21:48:44 UTC
I guess that this bug is because when you insert a new attribute/template/operations, a slot apply inside the class(umlattributedialog.cpp) is already called. Isn't a slot addNewFoo, the slot apply is called automatically, so that's why the file is automatically updated in add or remove this features.
I think that the best way is remove the button "apply", because we have two ways of include new attribute/template/operations, by the dialog of properties or using direct access, and since the dialogs of this features have his own "Ok" button that already update the file, the button "apply" lost his purpose.
Comment 5 Ralf Habacker 2016-05-05 02:58:05 UTC
(In reply to Lays Rodrigues from comment #4)
> I guess that this bug is because when you insert a new
> attribute/template/operations, a slot apply inside the
> class(umlattributedialog.cpp) is already called. Isn't a slot addNewFoo, the
> slot apply is called automatically, so that's why the file is automatically
> updated in add or remove this features.
yes. 
Many property items are hold only in the widget and are written back to the related object on pressing okay or apply. Pressing cancel simply do not write back the data into the object.

> I think that the best way is remove the button "apply", because we have two
> ways of include new attribute/template/operations, by the dialog of
> properties or using direct access, and since the dialogs of this features
> have his own "Ok" button that already update the file, the button "apply"
> lost his purpose.
But cancel button also looses its purpose. After adding new operations you cannot undo these adds yet. There may be a way to use the Qt undo framework (http://doc.qt.io/qt-4.8/qundo.html) on which umbrello undo support is based to revert changes after pressing cancel.
Comment 6 Ralf Habacker 2016-05-05 03:24:39 UTC
(In reply to Ralf Habacker from comment #5)
> (In reply to Lays Rodrigues from comment #4)
> > I guess that this bug is because when you insert a new
> > attribute/template/operations, a slot apply inside the
> > class(umlattributedialog.cpp) is already called. Isn't a slot addNewFoo, the
> > slot apply is called automatically, so that's why the file is automatically
> > updated in add or remove this features.

A quick check shows that QUndoStack::beginMacro() (see http://doc.qt.io/qt-4.8/qundostack.html#beginMacro) may help here.
Comment 7 Lays Rodrigues 2016-05-09 18:50:46 UTC
Created attachment 98862 [details]
attachment-26376-0.html

Ralf, just to refresh my memory, in this bug I will make the queue and
remove the button apply?
I'm working in the others bugs right now.
Cheers,


On Thu, May 5, 2016 at 12:24 AM, Ralf Habacker via KDE Bugzilla <
bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=92994
>
> --- Comment #6 from Ralf Habacker <ralf.habacker@freenet.de> ---
> (In reply to Ralf Habacker from comment #5)
> > (In reply to Lays Rodrigues from comment #4)
> > > I guess that this bug is because when you insert a new
> > > attribute/template/operations, a slot apply inside the
> > > class(umlattributedialog.cpp) is already called. Isn't a slot
> addNewFoo, the
> > > slot apply is called automatically, so that's why the file is
> automatically
> > > updated in add or remove this features.
>
> A quick check shows that QUndoStack::beginMacro() (see
> http://doc.qt.io/qt-4.8/qundostack.html#beginMacro) may help here.
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
> _______________________________________________
> umbrello-devel mailing list
> umbrello-devel@kde.org
> https://mail.kde.org/mailman/listinfo/umbrello-devel
>
Comment 8 Lays Rodrigues 2016-05-10 12:42:45 UTC
BTW yesterday I had discovered that the changes in the general menu aren't updated automatically. But with that, I have doubt in remove the "apply" button.
Comment 9 Ralf Habacker 2016-05-29 20:54:35 UTC
(In reply to Lays Rodrigues from comment #8)
> BTW yesterday I had discovered that the changes in the general menu aren't
> updated automatically. But with that, I have doubt in remove the "apply"
> button.
Agreed.