Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@ghunt-desktop.(none)>2010-06-20 15:14:52 (GMT)
committer root <root@ghunt-desktop.(none)>2010-06-20 15:14:52 (GMT)
commit9dae344745577076fd3bd15dd8887d42deb5fccd (patch)
tree3cea6c4641af61139d12bdd49e1d8d0c655fcc24
parent2415239957382b99e8fde4aa6b0f1d5684f962bb (diff)
help tab added
-rw-r--r--browser.py64
-rw-r--r--dbphoto.py4
-rw-r--r--help/__init__.py0
-rw-r--r--help/help.py244
-rwxr-xr-xhelptemplate.py79
-rw-r--r--progresslistener.py89
-rw-r--r--xophotoactivity.py88
7 files changed, 531 insertions, 37 deletions
diff --git a/browser.py b/browser.py
new file mode 100644
index 0000000..4d89715
--- /dev/null
+++ b/browser.py
@@ -0,0 +1,64 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import os
+import time
+import logging
+from gettext import gettext as _
+
+import gobject
+import gtk
+import hulahop
+import xpcom
+from xpcom.nsError import *
+from xpcom import components
+from xpcom.components import interfaces
+from hulahop.webview import WebView
+
+from sugar.datastore import datastore
+from sugar import profile
+from sugar import env
+from sugar.activity import activity
+from sugar.graphics import style
+
+from progresslistener import ProgressListener
+
+_ZOOM_AMOUNT = 0.1
+
+class Browser(WebView):
+ def __init__(self):
+ WebView.__init__(self)
+
+ self.progress = ProgressListener()
+
+ def do_setup(self):
+ WebView.do_setup(self)
+ self.progress.setup(self)
+
+ def zoom_in(self):
+ contentViewer = self.doc_shell.queryInterface( \
+ interfaces.nsIDocShell).contentViewer
+ if contentViewer is not None:
+ markupDocumentViewer = contentViewer.queryInterface( \
+ interfaces.nsIMarkupDocumentViewer)
+ markupDocumentViewer.fullZoom += _ZOOM_AMOUNT
+
+ def zoom_out(self):
+ contentViewer = self.doc_shell.queryInterface( \
+ interfaces.nsIDocShell).contentViewer
+ if contentViewer is not None:
+ markupDocumentViewer = contentViewer.queryInterface( \
+ interfaces.nsIMarkupDocumentViewer)
+ markupDocumentViewer.fullZoom -= _ZOOM_AMOUNT
+
diff --git a/dbphoto.py b/dbphoto.py
index 295b2cb..b8cddeb 100644
--- a/dbphoto.py
+++ b/dbphoto.py
@@ -139,11 +139,11 @@ class DbAccess():
rows_md5 = self.cur.fetchall()
if len(rows_md5) >0:
pass
- #_logger.debug('duplicate picture, ojbect_id %s path: %s'%(object_id,fn,))
+ _logger.debug('duplicate picture, ojbect_id %s path: %s'%(object_id,fn,))
sql = "select * from picture where jobject_id = '%s'"%(object_id,)
self.cur.execute(sql)
rows = self.cur.fetchall()
- #_logger.debug('rowcount %s object_id %s'%(len(rows),object_id))
+ _logger.debug('rowcount %s object_id %s'%(len(rows),object_id))
#the object_id is supposed to be unique, so add only new object_id's
info = os.stat(fn)
if len(rows) == 0:
diff --git a/help/__init__.py b/help/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/help/__init__.py
diff --git a/help/help.py b/help/help.py
new file mode 100644
index 0000000..6e767fd
--- /dev/null
+++ b/help/help.py
@@ -0,0 +1,244 @@
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import os, sys
+from gettext import gettext as _
+from subprocess import Popen, PIPE
+import shutil
+
+import gtk
+import gobject
+import wnck
+#from time import time
+from sugar import util
+
+from sugar.activity import activity
+from sugar.graphics.window import Window
+from sugar.graphics.toolbox import Toolbox
+from sugar.activity.activityhandle import ActivityHandle
+from sugar import wm, env
+#from IPython.Debugger import Tracer
+from pdb import *
+from sugar.graphics.toolbutton import ToolButton
+
+import hulahop
+#hulahop.startup(os.path.join(activity.get_activity_root(), 'data/gecko'))
+
+"""#from hulahop.webview import WebView
+from browser import Browser
+import xpcom
+from xpcom.components import interfaces
+"""
+gobject.threads_init()
+
+HOME = os.path.join(activity.get_bundle_path(), _('help/HelpApi.htm'))
+#HOME = "http://website.com/something.html"
+HELP_PANE = 1
+
+# Initialize logging.
+import logging
+_logger = logging.getLogger()
+
+class Help(Window):
+ def __init__(self, parent):
+ self.parent_obj = parent
+ hulahop.startup(os.path.join(os.environ['SUGAR_ACTIVITY_ROOT'],'data','gecko'))
+ #from hulahop.webview import WebView
+ from browser import Browser
+ import xpcom
+ from xpcom.components import interfaces
+ self.help_id = None
+ self.handle = ActivityHandle()
+ self.handle.activity_id = util.unique_id()
+ Window.__init__(self)
+ self.connect('realize',self.realize_cb)
+
+ #self.props.max_participants = 1
+
+ self._web_view = Browser()
+
+ #Mimic the other tabs (hide the fact that this is another window)
+ self.toolbox = Toolbox()
+ self.toolbox.connect('current_toolbar_changed',self.goto_cb)
+ self.set_toolbox(self.toolbox)
+ self.toolbox.show()
+
+ activitybar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Activity'), activitybar)
+ activitybar.show_all()
+
+ editbar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Edit'), editbar)
+ editbar.show_all()
+
+ usebar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Use'), usebar)
+ usebar.show_all()
+
+ self.help_toolbar = Toolbar(self._web_view)
+ self.help_toolbar.show()
+ self.toolbox.add_toolbar(_('Help'), self.help_toolbar)
+ self.toolbox._notebook.set_current_page(HELP_PANE)
+
+ self.set_canvas(self._web_view)
+ self._web_view.show()
+
+ self.toolbox.set_current_toolbar(HELP_PANE)
+
+ self._web_view.load_uri(HOME)
+
+ def get_help_toolbar(self):
+ return self.help_toolbar
+
+ def realize_help(self):
+
+ #trial and error suggest the following parent activation is necesssary to return reliably to parent window
+ if version > 0.839:
+ self.pywin = self.get_wnck_window_from_activity_id(str(self.parent_obj.handle.activity_id))
+ if self.pywin:
+ self.pywin.activate(gtk.get_current_event_time())
+ _logger.debug('pywin.activate called')
+ self.show_all()
+ self.toolbox._notebook.set_current_page(HELP_PANE)
+ return self
+
+ def realize_cb(self, window):
+ self.help_id = util.unique_id()
+ wm.set_activity_id(window.window, self.help_id)
+ self.help_window = window
+
+ def activate_help(self):
+ _logger.debug('activate_help called')
+ self.help_window.show()
+ if version < 0.838: return
+ window = self.get_wnck_window_from_activity_id(self.help_id)
+ self.toolbox._notebook.set_current_page(HELP_PANE)
+ if window:
+ window.activate(gtk.get_current_event_time())
+ else:
+ _logger.debug('failed to get window')
+
+ def goto_cb(self, page, tab):
+ _logger.debug('current_toolbar_changed event called goto_cb. tab: %s'%tab)
+ if tab == HELP_PANE: return
+ if not self.help_id: return
+ self.parent_obj.set_toolbar(tab)
+ self.help_window.hide()
+ if version < 0.838: return
+ self.pywin = self.get_wnck_window_from_activity_id(str(self.parent_obj.handle.activity_id))
+ if self.pywin:
+ self.pywin.activate(gtk.get_current_event_time())
+
+ def get_wnck_window_from_activity_id(self, activity_id):
+ """Use shell model to look up the wmck window associated with activity_id
+ --the home_model code changed between .82 and .84 sugar
+ --so do the lookup differently depending on sugar version
+ """
+ _logger.debug('get_wnck_window_from_activity_id. id:%s'%activity_id)
+ _logger.debug('sugar version %s'%version)
+ if version and version >= 0.839:
+ home_model = shell.get_model()
+ activity = home_model.get_activity_by_id(activity_id)
+ else:
+ instance = view.Shell.get_instance()
+ home_model = instance.get_model().get_home()
+ activity = home_model._get_activity_by_id(activity_id)
+ if activity:
+ return activity.get_window()
+ else:
+ _logger.debug('wnck_window was none')
+ return None
+
+class Toolbar(gtk.Toolbar):
+ def __init__(self, web_view):
+ gobject.GObject.__init__(self)
+
+ self._web_view = web_view
+
+ self._back = ToolButton('go-previous-paired')
+ self._back.set_tooltip(_('Back'))
+ self._back.props.sensitive = False
+ self._back.connect('clicked', self._go_back_cb)
+ self.insert(self._back, -1)
+ self._back.show()
+
+ self._forward = ToolButton('go-next-paired')
+ self._forward.set_tooltip(_('Forward'))
+ self._forward.props.sensitive = False
+ self._forward.connect('clicked', self._go_forward_cb)
+ self.insert(self._forward, -1)
+ self._forward.show()
+
+ home = ToolButton('zoom-home')
+ home.set_tooltip(_('Home'))
+ home.connect('clicked', self._go_home_cb)
+ self.insert(home, -1)
+ home.show()
+
+ progress_listener = self._web_view.progress
+ progress_listener.connect('location-changed',
+ self._location_changed_cb)
+ progress_listener.connect('loading-stop', self._loading_stop_cb)
+
+ def _location_changed_cb(self, progress_listener, uri):
+ self.update_navigation_buttons()
+
+ def _loading_stop_cb(self, progress_listener):
+ self.update_navigation_buttons()
+
+ def update_navigation_buttons(self):
+ can_go_back = self._web_view.web_navigation.canGoBack
+ self._back.props.sensitive = can_go_back
+
+ can_go_forward = self._web_view.web_navigation.canGoForward
+ self._forward.props.sensitive = can_go_forward
+
+ def _go_back_cb(self, button):
+ self._web_view.web_navigation.goBack()
+
+ def _go_forward_cb(self, button):
+ self._web_view.web_navigation.goForward()
+
+ def _go_home_cb(self, button):
+ self._web_view.load_uri(HOME)
+
+def command_line(cmd):
+ _logger.debug('command_line cmd:%s'%cmd)
+ p1 = Popen(cmd,stdout=PIPE, shell=True)
+ output = p1.communicate()
+ if p1.returncode != 0:
+ return None
+ return output[0]
+
+def sugar_version():
+ cmd = '/bin/rpm -q sugar'
+ reply = command_line(cmd)
+ if reply and reply.find('sugar') > -1:
+ version = reply.split('-')[1]
+ version_chunks = version.split('.')
+ major_minor = version_chunks[0] + '.' + version_chunks[1]
+ return float(major_minor)
+ return None
+
+version = 0.0
+version = sugar_version()
+if version and version >= 0.839:
+ from jarabe.model import shell
+else:
+ if not '/usr/share/sugar/shell/' in sys.path:
+ sys.path.append('/usr/share/sugar/shell/')
+ import view.Shell
+
diff --git a/helptemplate.py b/helptemplate.py
new file mode 100755
index 0000000..635278f
--- /dev/null
+++ b/helptemplate.py
@@ -0,0 +1,79 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import os
+from gettext import gettext as _
+
+import gtk
+import gobject
+import logging
+_logger = logging.getLogger()
+
+from sugar.activity import activity
+from sugar.graphics.toolbutton import ToolButton
+from help.help import Help
+
+HOME = os.path.join(activity.get_bundle_path(), 'help/XO_Introduction.html')
+#HOME = "http://website.com/something.html"
+HELP_TAB = 1
+
+class HelpTemplate(activity.Activity):
+ def __init__(self, handle):
+ activity.Activity.__init__(self, handle)
+
+ #following are essential for interface to Help
+ self.help_x11 = None
+ self.handle = handle
+ self.help = Help(self)
+
+ self.toolbox = activity.ActivityToolbox(self)
+ self.toolbox.connect_after('current_toolbar_changed',self._toolbar_changed_cb)
+ self.toolbox.show()
+
+ toolbar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Help'), toolbar)
+ toolbar.show()
+
+ label = gtk.Button('Help Template')
+ label.show()
+ self.set_canvas(label)
+
+ self.set_toolbox(self.toolbox)
+ self.toolbox.set_current_toolbar(0)
+
+ def _toolbar_changed_cb(self,widget,tab_no):
+ if tab_no == HELP_TAB:
+ self.help_selected()
+
+ def set_toolbar(self,tab):
+ self.toolbox.set_current_toolbar(tab)
+
+ ################ Help routines
+ def help_selected(self):
+ """
+ if help is not created in a gtk.mainwindow then create it
+ else just switch to that viewport
+ """
+ if not self.help_x11:
+ screen = gtk.gdk.screen_get_default()
+ self.pdb_window = screen.get_root_window()
+ _logger.debug('xid for pydebug:%s'%self.pdb_window.xid)
+ #self.window_instance = self.window.window
+ self.help_x11 = self.help.realize_help()
+ #self.x11_window = self.get_x11()os.geteuid()
+ else:
+ self.help.activate_help()
+ #self.help.reshow()
+ #self.help.toolbox.set_current_page(self.panes['HELP']
+
diff --git a/progresslistener.py b/progresslistener.py
new file mode 100644
index 0000000..cf3cb43
--- /dev/null
+++ b/progresslistener.py
@@ -0,0 +1,89 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import gobject
+import xpcom
+from xpcom.components import interfaces
+
+class ProgressListener(gobject.GObject):
+ _com_interfaces_ = interfaces.nsIWebProgressListener
+
+ __gsignals__ = {
+ 'location-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([object])),
+ 'loading-start': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([])),
+ 'loading-stop': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([])),
+ 'loading-progress': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([float]))
+ }
+
+ def __init__(self):
+ gobject.GObject.__init__(self)
+
+ self.total_requests = 0
+ self.completed_requests = 0
+
+ self._wrapped_self = xpcom.server.WrapObject( \
+ self, interfaces.nsIWebProgressListener)
+ weak_ref = xpcom.client.WeakReference(self._wrapped_self)
+
+ self._reset_requests_count()
+
+ def setup(self, browser):
+ mask = interfaces.nsIWebProgress.NOTIFY_STATE_NETWORK | \
+ interfaces.nsIWebProgress.NOTIFY_STATE_REQUEST | \
+ interfaces.nsIWebProgress.NOTIFY_LOCATION
+
+ browser.web_progress.addProgressListener(self._wrapped_self, mask)
+
+ def _reset_requests_count(self):
+ self.total_requests = 0
+ self.completed_requests = 0
+
+ def onLocationChange(self, webProgress, request, location):
+ self.emit('location-changed', location)
+
+ def onProgressChange(self, webProgress, request, curSelfProgress,
+ maxSelfProgress, curTotalProgress, maxTotalProgress):
+ pass
+
+ def onSecurityChange(self, webProgress, request, state):
+ pass
+
+ def onStateChange(self, webProgress, request, stateFlags, status):
+ if stateFlags & interfaces.nsIWebProgressListener.STATE_IS_REQUEST:
+ if stateFlags & interfaces.nsIWebProgressListener.STATE_START:
+ self.total_requests += 1
+ elif stateFlags & interfaces.nsIWebProgressListener.STATE_STOP:
+ self.completed_requests += 1
+
+ if stateFlags & interfaces.nsIWebProgressListener.STATE_IS_NETWORK:
+ if stateFlags & interfaces.nsIWebProgressListener.STATE_START:
+ self.emit('loading-start')
+ self._reset_requests_count()
+ elif stateFlags & interfaces.nsIWebProgressListener.STATE_STOP:
+ self.emit('loading-stop')
+
+ if self.total_requests < self.completed_requests:
+ self.emit('loading-progress', 1.0)
+ elif self.total_requests > 0:
+ self.emit('loading-progress', float(self.completed_requests) /
+ float(self.total_requests))
+ else:
+ self.emit('loading-progress', 0.0)
+
+ def onStatusChange(self, webProgress, request, status, message):
+ pass
diff --git a/xophotoactivity.py b/xophotoactivity.py
index 0f74397..42bd18d 100644
--- a/xophotoactivity.py
+++ b/xophotoactivity.py
@@ -44,6 +44,7 @@ import os
import shutil
from threading import Timer
from subprocess import Popen, PIPE
+from help.help import Help
import display
from display import *
@@ -52,6 +53,12 @@ from sources import *
from sinks import *
import dbphoto
+#help interface
+HOME = os.path.join(activity.get_bundle_path(), 'help/XO_Introduction.html')
+#HOME = "http://website.com/something.html"
+HELP_TAB = 3
+
+
#Application Globals
album_column_width = 200
#db can be resumed, new instance, or recovering from db error
@@ -91,25 +98,22 @@ class XoPhotoActivity(activity.Activity):
activity.Activity.__init__(self, handle, create_jobject = self.make_jobject)
self.make_jobject = False
+ #following are essential for interface to Help
+ self.help_x11 = None
+ self.handle = handle
+ self.help = Help(self)
+
+ self.toolbox = activity.ActivityToolbox(self)
+ self.toolbox.connect_after('current_toolbar_changed',self._toolbar_changed_cb)
+ self.toolbox.show()
+
+ toolbar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Help'), toolbar)
+ toolbar.show()
+
# Build the activity toolbar.
self.build_toolbar()
- """
- #wait for the gtk window to realize
- self.connect('realize',self.realized_cb)
- Timer(5.0, self.end_realize_delay, ()).start()
-
- while not self.timed_out and not self.realized:
- gtk.main_iteration()
-
- if self.timed_out:
- _logger.debug('gtk window not realized')
- exit()
- def realized_cb(self):
- self.realized = True
-
- """
-
# Build the Pygame canvas.
self._pygamecanvas = sugargame.canvas.PygameCanvas(self)
@@ -121,21 +125,11 @@ class XoPhotoActivity(activity.Activity):
# Start the game running.
self._pygamecanvas.run_pygame(self.game.run)
- """
- def __realize_cb(self,window):
- super(activity.Activity,self).__realize_cb()
- self.window.realized = True
- """
- def is_realized(self):
- return self.window_realized
-
- def end_realize_delay(self):
- self.timed_out = True
-
def build_toolbar(self):
- toolbox = photo_toolbar.ActivityToolbox(self)
- self.activity_toolbar = toolbox.get_activity_toolbar()
+ self.toolbox = photo_toolbar.ActivityToolbox(self)
+ self.toolbox.connect_after('current_toolbar_changed',self._toolbar_changed_cb)
+ self.activity_toolbar = self.toolbox.get_activity_toolbar()
"""
label = gtk.Label(_('New Album Name:'))
tool_item = gtk.ToolItem()
@@ -151,7 +145,7 @@ class XoPhotoActivity(activity.Activity):
#self.activity_toolbar.share.props.visible = False
self.edit_toolbar = EditToolbar()
- toolbox.add_toolbar(_('Edit'), self.edit_toolbar)
+ self.toolbox.add_toolbar(_('Edit'), self.edit_toolbar)
self.edit_toolbar.connect('do-import',
self.edit_toolbar_doimport_cb)
self.edit_toolbar.connect('do-stop',
@@ -159,7 +153,7 @@ class XoPhotoActivity(activity.Activity):
self.edit_toolbar.show()
self.use_toolbar = UseToolbar()
- toolbox.add_toolbar(_('Use'), self.use_toolbar)
+ self.toolbox.add_toolbar(_('Use'), self.use_toolbar)
self.use_toolbar.connect('do-export',
self.use_toolbar_doexport_cb)
self.use_toolbar.connect('do-upload',
@@ -170,10 +164,34 @@ class XoPhotoActivity(activity.Activity):
self.__stop_clicked_cb)
self.use_toolbar.show()
- toolbox.show()
- self.set_toolbox(toolbox)
+ toolbar = gtk.Toolbar()
+ self.toolbox.add_toolbar(_('Help'), toolbar)
+ toolbar.show()
+
+ self.toolbox.show()
+ self.set_toolbox(self.toolbox)
-
+ ################ Help routines
+ def _toolbar_changed_cb(self,widget,tab_no):
+ if tab_no == HELP_TAB:
+ self.help_selected()
+
+ def set_toolbar(self,tab):
+ self.toolbox.set_current_toolbar(tab)
+
+ def help_selected(self):
+ """
+ if help is not created in a gtk.mainwindow then create it
+ else just switch to that viewport
+ """
+ if not self.help_x11:
+ screen = gtk.gdk.screen_get_default()
+ self.pdb_window = screen.get_root_window()
+ _logger.debug('xid for pydebug:%s'%self.pdb_window.xid)
+ self.help_x11 = self.help.realize_help()
+ else:
+ self.help.activate_help()
+
def activity_toolbar_add_album_cb(self,album_name):
self.game.album_collection.create_new_album(None)
@@ -266,7 +284,7 @@ class XoPhotoActivity(activity.Activity):
pygame.display.flip()
if path:
self.file_tree.copy_tree_to_ds(path)
- Datastore_SQLite().scan_images()
+ Datastore_SQLite(self.game.db).scan_images()
def use_toolbar_doexport_cb(self,use_toolbar):
if not self.file_tree: