コード例 #1
0
ファイル: tasks.py プロジェクト: cottonpaul/OneSupport
    def get_graphics(self):
        self._in_progress = False

        graphics = Graphics()
        url = os.path.join(self._task_master.get_bundle_path(), 'html-content',
                           self._uri[0])
        graphics.add_uri('file://' + url, height=self._height)
        graphics.set_zoom_level(self._zoom_level)

        error_report = self._task_master.read_task_data(ERROR_REPORT)
        self._entry = graphics.add_text_view()
        if error_report is not None:
            text_buffer = self._entry.get_buffer()
            text_buffer.set_text(error_report)
        self._task_master.activity.set_copy_widget(text_entry=self._entry)
        self._task_master.activity.set_paste_widget(text_entry=self._entry)

        for i in range(3):
            button, label = graphics.add_button_and_label()
            button.connect('clicked', self._upload_cb, i)
            label.set_use_markup(True)
            self._buttons.append(button)
            self._labels.append(label)
            self._files.append(None)
            self._mimetypes.append(None)

        url = os.path.join(self._task_master.get_bundle_path(), 'html-content',
                           self._uri[1])
        graphics.add_uri('file://' + url, height=self._height)
        graphics.set_zoom_level(self._zoom_level)

        return graphics, self._prompt