Пример #1
0
    def __init__(self, parent):
        self._mime = FBMimeMgr()

        super(FileBrowser2, self).__init__(parent)

        # Attributes
        self._mw = None
        self._menu = ebmlib.ContextMenuManager()
        self._monitor = ebmlib.DirectoryMonitor(
            checkFreq=-1)  # manual refresh...
        self._monitor.SubscribeCallback(self.OnFilesChanged)
        self._monitor.StartMonitoring()
        self.isClosing = False
        self.syncTimer = wx.Timer(self)
        self._cpath = None

        # Setup
        self.SetupImageList()
        if wx.Platform == '__WXMSW__':
            for dname in ebmlib.GetWindowsDrives():
                if os.path.exists(dname.Name):
                    self.AddWatchDirectory(dname.Name)
        else:
            self.AddWatchDirectory("/")

        # Event Handlers
        self.Bind(wx.EVT_MENU, self.OnMenu)
        self.Bind(wx.EVT_TIMER, self.OnTimer)
        ed_msg.Subscribe(self.OnThemeChanged, ed_msg.EDMSG_THEME_CHANGED)
        ed_msg.Subscribe(self.OnPageChange, ed_msg.EDMSG_UI_NB_CHANGED)
        ed_msg.Subscribe(self.OnPageClosing, ed_msg.EDMSG_UI_NB_CLOSING)
        ed_msg.Subscribe(self.OnConfig,
                         ed_msg.EDMSG_PROFILE_CHANGE + (fbcfg.FB_PROF_KEY, ))
    def __init__(self, parent):
        super(ProjectTree, self).__init__(parent)

        # Attributes
        self._proj = None
        self._menu = ebmlib.ContextMenuManager()
        self._monitor = ebmlib.DirectoryMonitor(checkFreq=2000.0)
        self._monitor.SubscribeCallback(self.OnFilesChanged)
        self._monitor.StartMonitoring()

        # Setup
        self.SetupImageList()

        # Event Handlers
        self.Bind(wx.EVT_MENU, self.OnContextMenu)

        # Message Handlers
        ed_msg.Subscribe(self.OnGetProject,
                         PyStudioMessages.PYSTUDIO_PROJECT_GET)