Esempio n. 1
0
    def __init__(self, parent):
        self.image = None
        self.blog = None
        self.indexService = getApplicationModel().getService(
            IZBlogAppServiceIDs.DOCUMENT_INDEX_SERVICE_ID)
        self.accountStore = getApplicationModel().getService(
            IZBlogAppServiceIDs.ACCOUNT_STORE_SERVICE_ID)
        self.model = ZContextInfoImagesModel(ZImageSearchFilter())
        self.openImageAction = getApplicationModel().getActionRegistry(
        ).findAction(IZAppActionIDs.OPEN_IMAGE_ACTION)

        ZBoxedView.__init__(self, parent)

        self._registerAsIndexListener()

        self.validSelection = False
Esempio n. 2
0
    def refreshContent(self, selection):
        (accountId, blogId) = selection.getData()

        filter = ZImageSearchFilter()
        if blogId is not None:
            account = self.accountStore.getAccountById(accountId)
            self.blog = account.getBlogById(blogId)
            filter.setAccountIdCriteria(accountId)
            filter.setBlogIdCriteria(blogId)
        else:
            self.blog = None
            filter.setAccountIdCriteria(
                IZImageSearchFilter.UNPUBLISHED_ACCOUNT_ID)
            filter.setBlogIdCriteria(IZImageSearchFilter.UNPUBLISHED_BLOG_ID)

        self.model = ZContextInfoImagesModel(filter)
        self.imagesTreeView.setContentProvider(
            ZImageTreeContentProvider(self.model))
        self.imagesTreeView.refresh()
        self.imagesTreeView.deselectAll()
        self.onInvalidSelection()
        fireViewUnselectionEvent()