This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231105 - Terminal Window Options changes not accepted
Summary: Terminal Window Options changes not accepted
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Terminalemulator (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-11 20:56 UTC by infonaut
Modified: 2013-06-22 02:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (12.26 KB, patch)
2013-06-19 15:11 UTC, Andrew Krasny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description infonaut 2013-06-11 20:56:19 UTC
changes in Terminal Window Options does not enable the Apply Button.
Comment 1 infonaut 2013-06-11 20:58:26 UTC
[ BUILD # : 201306100004 ]
[ JDK VERSION : 1.7.0_21 ]
Comment 2 markiewb 2013-06-12 23:15:29 UTC
Some how related to https://netbeans.org/bugzilla/show_bug.cgi?id=230356 ?
Comment 3 infonaut 2013-06-18 21:23:51 UTC
The whole Option Dialog is a real mess.
sometimes a option change is recognized by Apply, sometimes not.
sometimes a change does not enable Apply but is recognized by OK.
sometimes nothing, frustating.
Comment 4 Leonid Lenyashin 2013-06-19 09:49:38 UTC
Andrew, pls evaluate.
Comment 5 Andrew Krasny 2013-06-19 10:12:54 UTC
Confirmed.
Comment 6 Andrew Krasny 2013-06-19 15:11:47 UTC
Created attachment 136036 [details]
Proposed patch
Comment 7 Andrew Krasny 2013-06-20 19:29:06 UTC
OK, patch was reviewed and we came to an agreement ;)

So.. to keep record:

'Apply' button appeared just recently - before that only 'OK' button  was in the dialog. And that worked.
Now, after the 'Apply' button was implemented we are in the following situation:

- there are two 'models'  - the first one is an 'effective' and the second one is it's copy that is passed to the dialog and is modified on changes.
(all this is correct, no changes here)

- the first thing that happens when dialog is created is that 'effective' model is copied; the copy is passed to the dialog; it is registered as dialog's listener and, because of notifications that come from the dialog's controls, immediately becomes 'dirty'.
(this is fixed by introducing 'inApplyingModel' boolean)

- in 500 ms model is asked if it is modified - the answer is 'yes'

- the problem is that in isChanged() method another copy of 'effective' model is created (THIS is the main cause) and at this point TermAdvancedOption forgets about the model (copy) that was passed to a dialog.
(this copying is removed in the fix)

- then infrastructure calls save(), which takes the 'wrong fresh' copy of the 'effective' model and stores it on disk...

+ patch contains some minor changes (like introducing markDirty() method and adding additional TermOptions copy constructor that doesn't perform resetToDefault())
Comment 8 Andrew Krasny 2013-06-21 10:02:28 UTC
http://hg.netbeans.org/cnd-main/rev/235104742904
Comment 9 Quality Engineering 2013-06-22 02:05:53 UTC
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/235104742904
User: Andrew Krasny <akrasny@netbeans.org>
Log: Bug #231105 - Terminal Window Options changes not accepted