Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def textRouter::TextRouter::on_menuManilaSetStoryAsHP_select (   self,
  event 
)

Set's a chosen story to be the current homepage.

Definition at line 1023 of file textRouter.py.

01023                                                      :
        """Set's a chosen story to be the current homepage."""
        if not self.checkManilaAccounts(3):
            return

        curManilaAccount = self.theManilaAccounts[self.theCurrentManilaAccount]

        if not curManilaAccount.checkSetupOK():
            self.status(curManilaAccount.getErrorMessage())
            return

        listX = [ "%s" % curManilaAccount.storiesList[key][0] for key in curManilaAccount.storiesList.keys() ]

        defIndex = ((curManilaAccount.currentStory != -1) and [curManilaAccount.currentStory] or [0])[0]

        dlg = ChooserDialog(self, "Set Homepage", \
                            "Choose a story to set the homepage as...", \
                            listX, listX[defIndex])
        dlg.showModal()

        if dlg.accepted():
            i = dlg.components.options.findString(dlg.components.options.stringSelection)
            if i == -1:
                self.status("No story selected for making the homepage.")
            else:
                msgNum = int(curManilaAccount.storiesList.keys()[i])
                self.showWaitMsg("Setting homepage from story '%s' (msg num: %d)..." % \
                                 (listX[i],msgNum))
                curManilaAccount.manilaSetHomepageFromMSG(msgNum)
                if curManilaAccount.anErrorOccured():
                    self.status("Error setting homepage from story: %s" % curManilaAccount.getErrorMessage())
                else:
                    self.status("Set homepage from story '%s' (num: %d) successfully." % \
                                (listX[i],msgNum))
        else:
            self.status("Story upload cancelled.")

        dlg.destroy()


    def on_menuManilaNewAccount_select(self, event):


Generated by  Doxygen 1.6.0   Back to index