Exemple #1
0
    def __init__(self, parent=None, files=None, max_files=10):
        super(RecentFilesMenu, self).__init__(parent)

        self._actions = []

        self.status = getPlugin('status')

        for i in range(max_files):
            action = QAction(
                parent=self,
                visible=False,
                triggered=lambda: actions.program.load(self.sender().data()),
            )

            self._actions.append(action)
            self.addAction(action)

        self.addSeparator()

        action = QAction(
            parent=self,
            text='Browse for files ...',
            triggered=lambda: showDialog('open_file'),
        )

        self.addAction(action)

        self.update(files or self.status.recent_files())
        self.status.recent_files.notify(self.update)
Exemple #2
0
 def showDialog(self, dialog_name):
     showDialog(dialog_name)
Exemple #3
0
 def showDialog(self):
     showDialog(self._dialog_name)
Exemple #4
0
 def openFile(self):
     showDialog('open_file')