[GRASS-SVN] r44794 - in grass/branches/develbranch_6/gui: icons/grass2 wxpython wxpython/icons

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 29 18:27:11 EST 2010


Author: martinl
Date: 2010-12-29 15:27:11 -0800 (Wed, 29 Dec 2010)
New Revision: 44794

Added:
   grass/branches/develbranch_6/gui/icons/grass2/layer-import.png
Modified:
   grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py
   grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py
   grass/branches/develbranch_6/gui/wxpython/icons/icon.py
   grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: add import raster/vector data to the main toolbar


Copied: grass/branches/develbranch_6/gui/icons/grass2/layer-import.png (from rev 44793, grass/trunk/gui/icons/grass2/layer-import.png)
===================================================================
(Binary files differ)

Modified: grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py	2010-12-29 23:23:41 UTC (rev 44793)
+++ grass/branches/develbranch_6/gui/wxpython/icons/grass2_icons.py	2010-12-29 23:27:11 UTC (rev 44794)
@@ -68,6 +68,7 @@
     "fileLoad"   : 'layer-open.png',
     "fileOpen"   : 'open.png',
     "fileSave"   : 'save.png',
+    "fileImport" : 'layer-import.png',
     "addrast"    : 'layer-raster-add.png',
     "rastmisc"   : 'layer-raster-more.png',
     "addrast3d"  : 'layer-raster3d-add.png',

Modified: grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py	2010-12-29 23:23:41 UTC (rev 44793)
+++ grass/branches/develbranch_6/gui/wxpython/icons/grass_icons.py	2010-12-29 23:27:11 UTC (rev 44794)
@@ -53,9 +53,10 @@
     # layer manager
     "newdisplay" : 'gui-startmon.gif',
     "fileNew"    : 'file-new.gif',
-    "fileLoad"   : 'file-new.gif', # change the icon if possible
+    "fileLoad"   : 'file-new.gif', 
     "fileOpen"   : 'file-open.gif',
     "fileSave"   : 'file-save.gif',
+    "fileImport" : 'file-new.gif',
     "addrast"    : 'element-cell.gif',
     "rastmisc"   : 'module-d.shadedmap.gif',
     "addrast3d"  : 'element-grid3.gif',

Modified: grass/branches/develbranch_6/gui/wxpython/icons/icon.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-12-29 23:23:41 UTC (rev 44793)
+++ grass/branches/develbranch_6/gui/wxpython/icons/icon.py	2010-12-29 23:27:11 UTC (rev 44794)
@@ -186,6 +186,10 @@
                                 label=_("Open existing workspace file (Ctrl+O)")),
     "workspaceSave" : MetaIcon (img=Icons["fileSave"],
                                 label=_("Save current workspace to file (Ctrl+S)")),
+    "rastImport" : MetaIcon (img=Icons["fileImport"],
+                             label=_("Import raster data")),
+    "vectImport" : MetaIcon (img=Icons["fileImport"],
+                             label=_("Import vector data")),
     "addrast"    : MetaIcon (img=Icons["addrast"],
                              label=_("Add raster map layer (Ctrl+R)")),
     "rastmisc" : MetaIcon (img=Icons["rastmisc"],

Modified: grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py	2010-12-29 23:23:41 UTC (rev 44793)
+++ grass/branches/develbranch_6/gui/wxpython/icons/silk_icons.py	2010-12-29 23:27:11 UTC (rev 44794)
@@ -71,6 +71,7 @@
     "fileLoad"   : 'page_white_get.png',
     "fileOpen"   : 'folder.png',
     "fileSave"   : 'page_save.png',
+    "fileImport" : 'page_white_get.png',
     "addrast"    : 'image_add.png',
     "rastmisc"   : 'picture_empty.png',
     "addrast3d"  : 'bricks.png',

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-12-29 23:23:41 UTC (rev 44793)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-12-29 23:27:11 UTC (rev 44794)
@@ -515,21 +515,23 @@
         win.Show(True)  
         
     def OnWorkspace(self, event):
-        """!Workspace menu (new, load)"""
+        """!Workspace menu (new, load, import)"""
         point = wx.GetMousePosition()
         menu = wx.Menu()
 
-        # Add items to the menu
-        new = wx.MenuItem(menu, wx.ID_ANY, Icons["workspaceNew"].GetLabel())
-        new.SetBitmap(Icons["workspaceNew"].GetBitmap(self.iconsize))
-        menu.AppendItem(new)
-        self.Bind(wx.EVT_MENU, self.OnWorkspaceNew, new)
-
-        load = wx.MenuItem(menu, wx.ID_ANY, Icons["workspaceLoad"].GetLabel())
-        load.SetBitmap(Icons["workspaceLoad"].GetBitmap(self.iconsize))
-        menu.AppendItem(load)
-        self.Bind(wx.EVT_MENU, self.OnWorkspaceLoad, load)
-
+        for key, handler in (('workspaceNew',  self.OnWorkspaceNew),
+                             ('workspaceLoad', self.OnWorkspaceLoad),
+                             (None, None),
+                             ('rastImport',    self.OnImportGdalLayers),
+                             ('vectImport',    self.OnImportOgrLayers)):
+            if key is None:
+                menu.AppendSeparator()
+                continue
+            item = wx.MenuItem(menu, wx.ID_ANY, Icons[key].GetLabel())
+            item.SetBitmap(Icons[key].GetBitmap(self.iconsize))
+            menu.AppendItem(item)
+            self.Bind(wx.EVT_MENU, handler, item)
+        
         # create menu
         self.PopupMenu(menu)
         menu.Destroy()



More information about the grass-commit mailing list