commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8488 - in trunk/gnue-designer: images src/base src/base/tools


From: jcater
Subject: [gnue] r8488 - in trunk/gnue-designer: images src/base src/base/tools
Date: Tue, 30 May 2006 00:09:43 -0500 (CDT)

Author: jcater
Date: 2006-05-30 00:09:42 -0500 (Tue, 30 May 2006)
New Revision: 8488

Added:
   trunk/gnue-designer/images/schnav-connected.ico
   trunk/gnue-designer/images/schnav-connected.xpm
   trunk/gnue-designer/images/schnav-error.ico
   trunk/gnue-designer/images/schnav-error.xpm
   trunk/gnue-designer/images/schnav-unconnected.ico
   trunk/gnue-designer/images/schnav-unconnected.xpm
   trunk/gnue-designer/images/schnav-warning.ico
   trunk/gnue-designer/images/schnav-warning.xpm
Modified:
   trunk/gnue-designer/src/base/Icons.py
   trunk/gnue-designer/src/base/tools/SchemaNavigator.py
Log:
added green/yellow/red status icons to the Schema Navigator tool to show open 
connections or connections that could not instantiate

Added: trunk/gnue-designer/images/schnav-connected.ico
===================================================================
(Binary files differ)


Property changes on: trunk/gnue-designer/images/schnav-connected.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/gnue-designer/images/schnav-connected.xpm
===================================================================
--- trunk/gnue-designer/images/schnav-connected.xpm     2006-05-30 04:19:14 UTC 
(rev 8487)
+++ trunk/gnue-designer/images/schnav-connected.xpm     2006-05-30 05:09:42 UTC 
(rev 8488)
@@ -0,0 +1,26 @@
+/* XPM */
+static char *schnav-connected[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 12 1",
+"  c black",
+". c #085E00",
+"X c #0A6E00",
+"o c #0C7E00",
+"O c #12BF00",
+"+ c #15DF00",
+"@ c #19FF00",
+"# c #4CCE3F",
+"$ c #4DCE3F",
+"% c #7CFF6E",
+"& c #FBFFFB",
+"* c None",
+/* pixels */
+"*      *",
+" X$@@OX ",
+" $&%@@O ",
+" @%@@@@ ",
+" @@@@@o ",
+" O@@@+. ",
+" address@hidden ",
+"*      *"
+};

Added: trunk/gnue-designer/images/schnav-error.ico
===================================================================
(Binary files differ)


Property changes on: trunk/gnue-designer/images/schnav-error.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/gnue-designer/images/schnav-error.xpm
===================================================================
--- trunk/gnue-designer/images/schnav-error.xpm 2006-05-30 04:19:14 UTC (rev 
8487)
+++ trunk/gnue-designer/images/schnav-error.xpm 2006-05-30 05:09:42 UTC (rev 
8488)
@@ -0,0 +1,25 @@
+/* XPM */
+static char *schnav-error[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 11 1",
+"  c black",
+". c #5E2300",
+"X c #702900",
+"o c #7E2E00",
+"O c #BF4700",
+"+ c #DF5300",
+"@ c #CE743F",
+"# c #FF5F00",
+"$ c #FFA46E",
+"% c #FFFCFB",
+"& c None",
+/* pixels */
+"&      &",
+" address@hidden ",
+" @%$##O ",
+" #$#### ",
+" #####o ",
+" O###+. ",
+" XO#o.X ",
+"&      &"
+};

Added: trunk/gnue-designer/images/schnav-unconnected.ico
===================================================================
(Binary files differ)


Property changes on: trunk/gnue-designer/images/schnav-unconnected.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/gnue-designer/images/schnav-unconnected.xpm
===================================================================
--- trunk/gnue-designer/images/schnav-unconnected.xpm   2006-05-30 04:19:14 UTC 
(rev 8487)
+++ trunk/gnue-designer/images/schnav-unconnected.xpm   2006-05-30 05:09:42 UTC 
(rev 8488)
@@ -0,0 +1,26 @@
+/* XPM */
+static char *schnav-unconnected[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 12 1",
+"  c black",
+". c #053900",
+"X c #064300",
+"o c #074D00",
+"O c #0B7500",
+"+ c #0D8900",
+"@ c #0F9D00",
+"# c #47963F",
+"$ c #47973F",
+"% c #76C76E",
+"& c #FBFDFB",
+"* c None",
+/* pixels */
+"*      *",
+" X$@@OX ",
+" $&%@@O ",
+" @%@@@@ ",
+" @@@@@o ",
+" O@@@+. ",
+" address@hidden ",
+"*      *"
+};

Added: trunk/gnue-designer/images/schnav-warning.ico
===================================================================
(Binary files differ)


Property changes on: trunk/gnue-designer/images/schnav-warning.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/gnue-designer/images/schnav-warning.xpm
===================================================================
--- trunk/gnue-designer/images/schnav-warning.xpm       2006-05-30 04:19:14 UTC 
(rev 8487)
+++ trunk/gnue-designer/images/schnav-warning.xpm       2006-05-30 05:09:42 UTC 
(rev 8488)
@@ -0,0 +1,25 @@
+/* XPM */
+static char *schnav-warning[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 11 1",
+"  c black",
+". c #5E5E00",
+"X c #707000",
+"o c #7E7E00",
+"O c #BFBF00",
+"+ c #DFDF00",
+"@ c #CECE3F",
+"# c yellow",
+"$ c #FFFF6E",
+"% c #FFFFFB",
+"& c None",
+/* pixels */
+"&      &",
+" address@hidden ",
+" @%$##O ",
+" #$#### ",
+" #####o ",
+" O###+. ",
+" XO#o.X ",
+"&      &"
+};

Modified: trunk/gnue-designer/src/base/Icons.py
===================================================================
--- trunk/gnue-designer/src/base/Icons.py       2006-05-30 04:19:14 UTC (rev 
8487)
+++ trunk/gnue-designer/src/base/Icons.py       2006-05-30 05:09:42 UTC (rev 
8488)
@@ -25,16 +25,11 @@
 
 import os, sys
 import wx
-from wxPython import __version__
 from gnue.common.apps import GConfig
 
-# Nasty hack to get around wxPython bug (still in 2.3.1)
-class myImageList(wx.ImageList):
-    def __del__(self):
-        pass
 
 treeIconMap = {}
-treeIconList = myImageList(18,18,False)
+treeIconList = wx.ImageList(18,18,False)
 
 iconlocation = 
os.path.join(GConfig.getInstalledBase('designer_images','common_images'),'designer')
 
@@ -45,11 +40,6 @@
     icontype = wx.BITMAP_TYPE_ICO
     iconextension = 'ico'
 
-if __version__ < '2.3.0': # TODO: wxPython 2.2.x seems to segfault with icons
-    iconextension = ''      #       this is a hack to make it not find icons
-                            #       and thus not segfault.  We should never
-                            #       build a win version w/ that old a wxPython
-
 for f in ('block','datasource','entry','import','pagewidget',
           'page','trigger','properties'):
     if os.path.isfile('%s/destree_%s.%s' % (iconlocation, f,iconextension)):
@@ -58,3 +48,16 @@
                  icontype))
     else:
         treeIconMap[f] = treeIconList.AddIcon(wx.NullIcon)
+
+
+schemaNavIconMap = {}
+schemaNavIconList = wx.ImageList(8,8,False)
+for f in ('connected','unconnected','error', 'warning'):
+    if os.path.isfile('%s/schnav-%s.%s' % (iconlocation, f,iconextension)):
+        schemaNavIconMap[f] = schemaNavIconList.AddIcon(
+            wx.Icon('%s/schnav-%s.%s' % (iconlocation, f,iconextension),
+                 icontype))
+    else:
+        schemaNavIconMap[f] = schemaNavIconList.AddIcon(wx.NullIcon)
+
+

Modified: trunk/gnue-designer/src/base/tools/SchemaNavigator.py
===================================================================
--- trunk/gnue-designer/src/base/tools/SchemaNavigator.py       2006-05-30 
04:19:14 UTC (rev 8487)
+++ trunk/gnue-designer/src/base/tools/SchemaNavigator.py       2006-05-30 
05:09:42 UTC (rev 8488)
@@ -53,12 +53,15 @@
 import wx
 from wx.gizmos import *
 from wx import __version__ as wxversion
-from gnue.common.apps import GDebug
 from gnue.common.datasources import GDataSource
-from gnue.common.apps import RuntimeSettings
+
+from gnue.common.apps import errors
+from gnue.common.datasources import Exceptions
+
 from gnue.common import events
 from gnue.designer.base.ToolBase import *
 from gnue.designer.base.ToolBar import *
+from gnue.designer.base.Icons import schemaNavIconMap, schemaNavIconList
 
 class SchemaNavigator(ToolBase):
 
@@ -79,6 +82,8 @@
 
         self.tree = tree = TreeCtrl(self, self)
         self.tree.SetFont(wx.SMALL_FONT)
+        tree.SetImageList(schemaNavIconList)
+
         root = tree.AddRoot('Schema')
         tree.SetItemHasChildren(root, 1)
         for connection in self.connectionNames:
@@ -239,7 +244,9 @@
         self.expanded = 0
         self.navigator = navigator
         self.tree = tree
+
         self.node = node = tree.AppendItem(parent, self.getLabel())
+        ####tree.SetItemImage(node, schemaNavIconMap['unconnected'])
         tree.SetItemHasChildren(node, not self.isleaf)
         tree.SetPyData(node, self)
 
@@ -247,10 +254,32 @@
 
     def expand(self):
         self.expanded = 1
-        connection = self.navigator.connections.getConnection(self.connection, 
login=1)
 
-        schema = connection.readSchema ()
+        connection = None
+        try:
+            connection = self.navigator.connections.getConnection(
+                  self.connection, login=True)
+            icon = 'connected'
+        except errors.AdminError, mesg:
+            icon = 'error'
+            print "Unable to connect to %s: %s" % (self.connection, mesg)
+        except Exceptions.LoginError, mesg:
+            icon = 'warning'
+            print "Unable to connect to %s: %s" % (self.connection, mesg)
+        except errors.gException, mesg:
+            icon = 'error'
+            print "Unable to connect to %s: %s" % (self.connection, mesg)
+        except:
+            icon = 'error'
 
+
+        self.tree.SetItemImage(self.node, schemaNavIconMap[icon])
+
+        if not connection:
+            return
+
+        schema = connection.readSchema()
+
         if schema is None:
             return
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]