From 0bf674be1f2dc912727aea1b64e62c49da4618a6 Mon Sep 17 00:00:00 2001
From: Gwenael Casaccio <mrgwen@gmail.com>
Date: Mon, 2 Dec 2013 10:52:38 +0100
Subject: [PATCH] Remove GtkAbstractConcreteWidget the class name is unlogical,
 the class was not needed and that was a poor design choice. Worst the class
 was not really abstract because it was instantiated by GtkSidebarWidget.

---
 packages/visualgst/ChangeLog                      | 14 ++++++++
 packages/visualgst/GtkAbstractConcreteWidget.st   | 41 -----------------------
 packages/visualgst/GtkConcreteWidget.st           |  2 +-
 packages/visualgst/GtkSidebarWidget.st            |  3 +-
 packages/visualgst/Tests/GtkConcreteWidgetTest.st |  6 ----
 packages/visualgst/package.xml                    |  2 --
 6 files changed, 16 insertions(+), 52 deletions(-)
 delete mode 100644 packages/visualgst/GtkAbstractConcreteWidget.st

diff --git a/packages/visualgst/ChangeLog b/packages/visualgst/ChangeLog
index d0d8499..ed475dd 100644
--- a/packages/visualgst/ChangeLog
+++ b/packages/visualgst/ChangeLog
@@ -1,3 +1,10 @@
+2013-12-02  Gwenael Casaccio  <gwenael.casaccio@gmail.com>
+
+       * GtkConcreteWidget.st: Object is the superclass.
+       * GtkAbstractConcreteWidget.st: Remove it.
+       * GtkSidebarWidget.st: Doesn't rely on GtkAbstractConcreteWidget.
+       * Tests/GtkConcreteWidgetTest.st: Remove GtkAbstractConcreteWidget test.
+
 2013-11-13  Gwenael Casaccio  <gwenael.casaccio@gmail.com>
 
 	* GtkLauncher.st: Initialize KeySnooper.
@@ -12,6 +19,13 @@
 
 2013-10-21  Gwenael Casaccio  <gwenael.casaccio@gmail.com>
 
+	* GtkConcreteWidget.st: Object is the superclass.
+	* GtkAbstractConcreteWidget.st: Remove it.
+	* GtkSidebarWidget.st: Doesn't rely on GtkAbstractConcreteWidget.
+	* Tests/GtkConcreteWidgetTest.st: Remove GtkAbstractConcreteWidget test.
+
+2013-10-21  Gwenael Casaccio  <gwenael.casaccio@gmail.com>
+
 	* Debugger/GtkDebugger.st: Makes the debugger non-blocking and fix the continue back into GTK/Event-Loop/C-code.
 	* Debugger/GtkTextWidget.st: Makes the debugger non-blocking and fix the continue back into GTK/Event-Loop/C-code.
 	* Misc/TaskQueue.st : Add a queue of tasks.
diff --git a/packages/visualgst/GtkAbstractConcreteWidget.st b/packages/visualgst/GtkAbstractConcreteWidget.st
deleted file mode 100644
index e4f934f..0000000
--- a/packages/visualgst/GtkAbstractConcreteWidget.st
+++ /dev/null
@@ -1,41 +0,0 @@
-"======================================================================
-|
-| GtkAbstractConcreteWidget class definition
-|
-======================================================================"
-
-"======================================================================
-|
-| Copyright (c) 2013
-| Gwenael Casaccio <gwenael.casaccio@gmail.com>,
-|
-|
-| This file is part of VisualGST.
-|
-| Permission is hereby granted, free of charge, to any person obtaining
-| a copy of this software and associated documentation files (the
-| 'Software'), to deal in the Software without restriction, including
-| without limitation the rights to use, copy, modify, merge, publish,
-| distribute, sublicense, and/or sell copies of the Software, and to
-| permit persons to whom the Software is furnished to do so, subject to
-| the following conditions:
-|
-| The above copyright notice and this permission notice shall be
-| included in all copies or substantial portions of the Software.
-|
-| THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-|
-======================================================================"
-
-Smalltalk.Object subclass: GtkAbstractConcreteWidget [
-
-    hideAll [
-    ]
-]
-
diff --git a/packages/visualgst/GtkConcreteWidget.st b/packages/visualgst/GtkConcreteWidget.st
index 8a5e0d2..26973ec 100644
--- a/packages/visualgst/GtkConcreteWidget.st
+++ b/packages/visualgst/GtkConcreteWidget.st
@@ -33,7 +33,7 @@
 |
 ======================================================================"
 
-GtkAbstractConcreteWidget subclass: GtkConcreteWidget [
+Object subclass: GtkConcreteWidget [
     | child parentWindow popupMenu |
 
     GtkConcreteWidget class >> parentWindow: aGtkWindow [
diff --git a/packages/visualgst/GtkSidebarWidget.st b/packages/visualgst/GtkSidebarWidget.st
index 8f577e5..86e3592 100644
--- a/packages/visualgst/GtkSidebarWidget.st
+++ b/packages/visualgst/GtkSidebarWidget.st
@@ -45,7 +45,6 @@ GtkConcreteWidget subclass: GtkSidebarWidget [
 				yourself.
 	self mainWidget: paned.
 	widgetEvents := Dictionary new.
-	activeWidget := GtkAbstractConcreteWidget new.
 	widgets := OrderedCollection new
     ]
 
@@ -72,7 +71,7 @@ GtkConcreteWidget subclass: GtkSidebarWidget [
     show: anIndex [
 	<category: 'notebook'>
 
-	activeWidget hideAll.
+	activeWidget ifNotNil: [ :aWidget | aWidget hideAll ].
 	self mainWidget showAll.
 	self mainWidget setCurrentPage: anIndex - 1.
 	activeWidget := (widgets at: anIndex)
diff --git a/packages/visualgst/Tests/GtkConcreteWidgetTest.st b/packages/visualgst/Tests/GtkConcreteWidgetTest.st
index 963c81f..9afb2fe 100644
--- a/packages/visualgst/Tests/GtkConcreteWidgetTest.st
+++ b/packages/visualgst/Tests/GtkConcreteWidgetTest.st
@@ -52,12 +52,6 @@ TestCase subclass: GtkConcreteWidgetTest [
 	^ false
     ]
 
-    testAbstractWidget [
-	<category: 'testing'>
-
-	self should: [ GtkAbstractConcreteWidget new hideAll. true ]
-    ]
-
     testConcreteWidget [
 	<category: 'testing'>
 
diff --git a/packages/visualgst/package.xml b/packages/visualgst/package.xml
index 8cd2db1..f2c37d2 100644
--- a/packages/visualgst/package.xml
+++ b/packages/visualgst/package.xml
@@ -163,7 +163,6 @@
   <filein>Category/ClassCategory.st</filein>
   <filein>Category/AbstractNamespace.st</filein>
   <filein>Category/Class.st</filein>
-  <filein>GtkAbstractConcreteWidget.st</filein>
   <filein>GtkConcreteWidget.st</filein>
   <filein>GtkScrollTreeWidget.st</filein>
   <filein>GtkSimpleListWidget.st</filein>
@@ -392,7 +391,6 @@
   <file>Category/ClassCategory.st</file>
   <file>Category/AbstractNamespace.st</file>
   <file>Category/Class.st</file>
-  <file>GtkAbstractConcreteWidget.st</file>
   <file>GtkConcreteWidget.st</file>
   <file>GtkScrollTreeWidget.st</file>
   <file>GtkSimpleListWidget.st</file>
-- 
1.8.3.2

