|
@@ -58,18 +58,11 @@ import codecs
|
|
|
|
|
|
from threading import Thread
|
|
from threading import Thread
|
|
|
|
|
|
-gisbase = os.getenv("GISBASE")
|
|
|
|
-if gisbase is None:
|
|
|
|
- print >>sys.stderr, "We don't seem to be properly installed, or we are being run outside GRASS. Expect glitches."
|
|
|
|
|
|
+if not os.getenv("GISBASE"):
|
|
|
|
+ sys.write("We don't seem to be properly installed, or we are being run "
|
|
|
|
+ "outside GRASS. Expect glitches.\n")
|
|
gisbase = os.path.join(os.path.dirname(sys.argv[0]), os.path.pardir)
|
|
gisbase = os.path.join(os.path.dirname(sys.argv[0]), os.path.pardir)
|
|
- wxbase = gisbase
|
|
|
|
-else:
|
|
|
|
- wxbase = os.path.join(gisbase, 'etc', 'gui', 'wxpython')
|
|
|
|
|
|
|
|
-if wxbase not in sys.path:
|
|
|
|
- sys.path.append(wxbase)
|
|
|
|
-
|
|
|
|
-from core import globalvar
|
|
|
|
import wx
|
|
import wx
|
|
try:
|
|
try:
|
|
import wx.lib.agw.flatnotebook as FN
|
|
import wx.lib.agw.flatnotebook as FN
|
|
@@ -89,6 +82,7 @@ from grass.pydispatch.signal import Signal
|
|
from grass.script import core as grass
|
|
from grass.script import core as grass
|
|
from grass.script import task as gtask
|
|
from grass.script import task as gtask
|
|
|
|
|
|
|
|
+from core import globalvar
|
|
from gui_core.widgets import StaticWrapText, ScrolledPanel, ColorTablesComboBox, \
|
|
from gui_core.widgets import StaticWrapText, ScrolledPanel, ColorTablesComboBox, \
|
|
BarscalesComboBox, NArrowsComboBox
|
|
BarscalesComboBox, NArrowsComboBox
|
|
from gui_core.ghelp import HelpPanel
|
|
from gui_core.ghelp import HelpPanel
|
|
@@ -417,7 +411,7 @@ class TaskFrame(wx.Frame):
|
|
self.CreateStatusBar()
|
|
self.CreateStatusBar()
|
|
|
|
|
|
# icon
|
|
# icon
|
|
- self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
|
|
|
|
|
|
+ self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
|
|
|
|
|
|
guisizer = wx.BoxSizer(wx.VERTICAL)
|
|
guisizer = wx.BoxSizer(wx.VERTICAL)
|
|
|
|
|
|
@@ -432,7 +426,7 @@ class TaskFrame(wx.Frame):
|
|
|
|
|
|
# GRASS logo
|
|
# GRASS logo
|
|
self.logo = wx.StaticBitmap(parent = self.panel,
|
|
self.logo = wx.StaticBitmap(parent = self.panel,
|
|
- bitmap = wx.Bitmap(name = os.path.join(globalvar.ETCIMGDIR,
|
|
|
|
|
|
+ bitmap = wx.Bitmap(name = os.path.join(globalvar.IMGDIR,
|
|
'grass_form.png'),
|
|
'grass_form.png'),
|
|
type = wx.BITMAP_TYPE_PNG))
|
|
type = wx.BITMAP_TYPE_PNG))
|
|
topsizer.Add(item = self.logo, proportion = 0, border = 3,
|
|
topsizer.Add(item = self.logo, proportion = 0, border = 3,
|
|
@@ -1054,7 +1048,7 @@ class CmdPanel(wx.Panel):
|
|
value = self._getValue(p)
|
|
value = self._getValue(p)
|
|
|
|
|
|
if p['name'] == 'icon': # symbols
|
|
if p['name'] == 'icon': # symbols
|
|
- bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR, value) + '.png')
|
|
|
|
|
|
+ bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR, value) + '.png')
|
|
bb = wx.BitmapButton(parent = which_panel, id = wx.ID_ANY,
|
|
bb = wx.BitmapButton(parent = which_panel, id = wx.ID_ANY,
|
|
bitmap = bitmap)
|
|
bitmap = bitmap)
|
|
iconLabel = wx.StaticText(parent = which_panel, id = wx.ID_ANY)
|
|
iconLabel = wx.StaticText(parent = which_panel, id = wx.ID_ANY)
|
|
@@ -1268,7 +1262,7 @@ class CmdPanel(wx.Panel):
|
|
showButton = False
|
|
showButton = False
|
|
if showButton:
|
|
if showButton:
|
|
iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
|
|
iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
|
|
- bitmap = wx.Bitmap(os.path.join(globalvar.ETCICONDIR, iconTheme, 'map-info.png'))
|
|
|
|
|
|
+ bitmap = wx.Bitmap(os.path.join(globalvar.ICONDIR, iconTheme, 'map-info.png'))
|
|
bb = wx.BitmapButton(parent=which_panel, bitmap=bitmap)
|
|
bb = wx.BitmapButton(parent=which_panel, bitmap=bitmap)
|
|
bb.Bind(wx.EVT_BUTTON, self.OnTimelineTool)
|
|
bb.Bind(wx.EVT_BUTTON, self.OnTimelineTool)
|
|
bb.SetToolTipString(_("Show graphical representation of temporal extent of dataset(s) ."))
|
|
bb.SetToolTipString(_("Show graphical representation of temporal extent of dataset(s) ."))
|
|
@@ -2147,7 +2141,7 @@ class CmdPanel(wx.Panel):
|
|
for p in self.task.params:
|
|
for p in self.task.params:
|
|
if 'wxId' in p and myId in p['wxId']:
|
|
if 'wxId' in p and myId in p['wxId']:
|
|
from gui_core.dialogs import SymbolDialog
|
|
from gui_core.dialogs import SymbolDialog
|
|
- dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
|
|
|
|
|
|
+ dlg = SymbolDialog(self, symbolPath = globalvar.SYMBDIR,
|
|
currentSymbol = p['value'])
|
|
currentSymbol = p['value'])
|
|
if dlg.ShowModal() == wx.ID_OK:
|
|
if dlg.ShowModal() == wx.ID_OK:
|
|
img = dlg.GetSelectedSymbolPath()
|
|
img = dlg.GetSelectedSymbolPath()
|
|
@@ -2236,7 +2230,7 @@ class CmdPanel(wx.Panel):
|
|
|
|
|
|
def AddBitmapToImageList(self, section, imageList):
|
|
def AddBitmapToImageList(self, section, imageList):
|
|
iconTheme = UserSettings.Get(group = 'appearance', key = 'iconTheme', subkey = 'type')
|
|
iconTheme = UserSettings.Get(group = 'appearance', key = 'iconTheme', subkey = 'type')
|
|
- iconSectionDict = {'manual': os.path.join(globalvar.ETCICONDIR, iconTheme, 'help.png')}
|
|
|
|
|
|
+ iconSectionDict = {'manual': os.path.join(globalvar.ICONDIR, iconTheme, 'help.png')}
|
|
if section in iconSectionDict.keys():
|
|
if section in iconSectionDict.keys():
|
|
image = wx.Image(iconSectionDict[section]).Scale(16, 16, wx.IMAGE_QUALITY_HIGH)
|
|
image = wx.Image(iconSectionDict[section]).Scale(16, 16, wx.IMAGE_QUALITY_HIGH)
|
|
idx = imageList.Add(wx.BitmapFromImage(image))
|
|
idx = imageList.Add(wx.BitmapFromImage(image))
|