Normal Chainsaw log panels can be hidden or shown as the user needs. But this feature is not working with 'Welcome' and 'Drag & Drop' panels. Hiding these panels also can be useful for some users to concentrate only one one panel.
Created attachment 20501 [details] Adding ability to hide 'Welcome' and 'Drag & Drop' panels This patch contains the modifications in LogUI to hide and show 'Welcome' and 'Drag & Drop' panels panels whenever needed.
Created attachment 20502 [details] New version of the previous patch with no comments Commented lines are removed in this patch
This patch has already been applied, but it would be nice if this feature could be enhanced to remember if these tabs were hidden on app exit and hide them if appropriate (with menu options to view them again?) This is also serving as a reminder to myself if you don't get to it.
Created attachment 20661 [details] Adding ability to remember previous tab settings after restarts In this patch, I have implemented the feature of saving the tab setting (what are hidden and what are shown) at closing and loading it back at restarting Chainsaw. I used an XML file to save the setting. Methods to save and load this setting is included in the "ChainsawTabbedPane" class. I wonder whether it is the correct place to include that code. But I couldn't fine somewhere more suitable. I have used a separate class called "SavableTabSetting" to represent the tab setting that should saved. "Welcome", "Drag & Drop" and "chainsaw-log" are the main log panels which are always running in Chainsaw. Existence of other log panels depends on the situation. For example, the user may load a receiver once and close Chainsaw and later restart and load some other receiver. I think saving the state of such panels will be useless. So I have made Chainsaw remember only the state of the above mentioned main log panels. There may be some adjustments to be done. Hope this will help as an initial work to get the job done.So please check this and comment...
1) SavableTabSetting - Can this be a normal Java bean with getters/settings? It's stylistic, and I know this is a simple class but I'd prefer it with getters/setters 2) ChainsawTabbedPane - Can this implement the SettingsListener interface and use the standard save/load call backs that provides? 3) This patch might now be slightly out of date, it's not applying cleanly at all. The LogUI file has 2 patch chunks that don't apply cleanly: @@ -2055,8 +2073,10 @@ if ( getTabbedPane().getSelectedIndex() == getTabbedPane() .indexOfTab(ident)) { - getTabbedPane().setIconAt( - getTabbedPane().indexOfTab(ident), SELECTED); + if(getTabbedPane().indexOfTab(ident) > 0){ + getTabbedPane().setIconAt( + getTabbedPane().indexOfTab(ident), SELECTED); + } newEvents = false; seenEvents = true; } else if (getTabbedPane().indexOfTab(ident) > -1) { and @@ -2094,7 +2114,7 @@ public void stateChanged(ChangeEvent event) { if ( - getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()) { + getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex() && getTabbedPane().indexOfTab(ident) > 0) { getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED); } } I'm not really sure why.. Can you double check ? Does it apply cleanly for you?
Created attachment 20689 [details] Adding ability to remember tab settings improved version This patch includes all the improvements proposed by paul.
(In reply to comment #5) > > 1) SavableTabSetting - Can this be a normal Java bean with getters/settings? > It's stylistic, and I know this is a simple class but I'd prefer it with > getters/setters OK. Done in the new patch... > 2) ChainsawTabbedPane - Can this implement the SettingsListener interface and > use the standard save/load call backs that provides? Yes. Done in the new patch.. > 3) This patch might now be slightly out of date, it's not applying cleanly at > all. The LogUI file has 2 patch chunks that don't apply cleanly: > > > @@ -2055,8 +2073,10 @@ > if ( > getTabbedPane().getSelectedIndex() == getTabbedPane() > .indexOfTab(ident)) { > - getTabbedPane().setIconAt( > - getTabbedPane().indexOfTab(ident), SELECTED); > + if(getTabbedPane().indexOfTab(ident) > 0){ > + getTabbedPane().setIconAt( > + getTabbedPane().indexOfTab(ident), SELECTED); > + } > newEvents = false; > seenEvents = true; > } else if (getTabbedPane().indexOfTab(ident) > -1) { > > and > > @@ -2094,7 +2114,7 @@ > > public void stateChanged(ChangeEvent event) { > if ( > - getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex()) { > + getTabbedPane().indexOfTab(ident) == getTabbedPane().getSelectedIndex() > && getTabbedPane().indexOfTab(ident) > 0) { > getTabbedPane().setIconAt(getTabbedPane().indexOfTab(ident), SELECTED); > } > } > > > I'm not really sure why.. Can you double check ? Does it apply cleanly for you? There was a bug in those two statements and I had fixed it in the previous patch. But after that someone has committed that fix. So that why it was conflicting. These two statements are not included in the new patch as it is already fixed. New patch applies without any problem. Please check it...
Fixed in revision 568858. THX
I'm seeing quite weird behaviour with this feature now. It did look ok when I tested this yesterday but I tried the following: 1) Start Chainsaw, run the tutorial and get the 3 tabs from the generators 2) Hide all 3 of the generator tabs 3) exit and restart Chainsaw 5) Run the tutorial again with generators, they come back to life. So, the restore logic does hide any hidden tab that appears at app startup time, but does not hide any new tabs that turn up.
(In reply to comment #10) > I'm seeing quite weird behaviour with this feature now. It did look ok when I > tested this yesterday but I tried the following: > 1) Start Chainsaw, run the tutorial and get the 3 tabs from the generators > 2) Hide all 3 of the generator tabs > 3) exit and restart Chainsaw > 5) Run the tutorial again with generators, they come back to life. > So, the restore logic does hide any hidden tab that appears at app startup time, > but does not hide any new tabs that turn up. Yes. I didn't try to save the configuration of tabs other than Welcome, Drag and Drop and chainsaw-log. This is because we don't know whether the user will start exactly the same tabs when chainsaw is restarted. This was done as an intial step for this feature. We can work on saving any tab's setting in the future. But there will be some problems comming up. I'll try it..