示例#1
0
    def _install_app(self, report_install=True):
        installer = AppInstaller(self._app['id'], self._apps, None,
                                 self._window)
        installer.set_report_install(report_install)
        if not installer.install():
            return

        # We need to reload the application information, readd it to
        # the desktop and send an update to the parent object.
        new_app = load_from_app_file(installer.get_loc())
        self._app['origin'] = new_app['origin']
        remove_from_desktop(self._app)
        self._apps.update_app(new_app)
        add_to_desktop(new_app)
示例#2
0
    def _install_app(self, report_install=True):
        installer = AppInstaller(self._app['id'], self._apps, None,
                                 self._window)
        installer.set_report_install(report_install)
        if not installer.install():
            return

        # We need to reload the application information, readd it to
        # the desktop and send an update to the parent object.
        new_app = load_from_app_file(installer.get_loc())
        self._app['origin'] = new_app['origin']
        remove_from_desktop(self._app)
        self._apps.update_app(new_app)

        if new_app.get('desktop'):
            add_to_desktop(new_app)
示例#3
0
 def _desktop_cb(self, event):
     if not self._is_on_desktop():
         if add_to_desktop(self._app):
             self._apps.update_app(self._app)
     else:
         if remove_from_desktop(self._app):
             self._apps.update_app(self._app)
示例#4
0
 def _desktop_cb(self, event):
     if not self._is_on_desktop():
         if add_to_desktop(self._app):
             self._apps.update_app(self._app)
     else:
         if remove_from_desktop(self._app):
             self._apps.update_app(self._app)
示例#5
0
    def _install(self):
        success = True
        if not self._icon_only:
            success = install_app(self._app, self._pw)

        if success:
            # write out the tmp json
            with open(self._tmp_data_file, "w") as f:
                f.write(json.dumps(self._app))

            self._loc = install_link_and_icon(self._app['slug'],
                                              self._tmp_data_file,
                                              self._tmp_icon_file,
                                              self._pw)

            if not self._icon_only and self._add_to_desktop:
                add_to_desktop(self._app)

            head = _("Done!")
            message = _(
                "{} installed successfully! "
                "Look for it in the Apps launcher."
            ).format(self._app["title"])
        else:
            head = _("Installation failed")
            message = _(
                "{} cannot be installed at "
                "the moment. Please make sure your kit is connected "
                "to the internet and there is enough space left on "
                "your card."
            ).format(self._app["title"])

        dialog = KanoDialog(
            head,
            message,
            {
                _("OK"): {
                    "return_value": 0
                },
            },
        )
        dialog.run()
        del dialog

        return success
示例#6
0
    def _install(self):
        success = True
        if not self._icon_only:
            success = install_app(self._app, self._pw)

        if success:
            # write out the tmp json
            with open(self._tmp_data_file, "w") as f:
                f.write(json.dumps(self._app))

            self._loc = install_link_and_icon(self._app['slug'],
                                              self._tmp_data_file,
                                              self._tmp_icon_file, self._pw)

            if not self._icon_only and self._add_to_desktop:
                add_to_desktop(self._app)

            head = _("Done!")
            message = _("{} installed successfully! "
                        "Look for it in the Apps launcher.").format(
                            self._app["title"])
        else:
            head = _("Installation failed")
            message = _("{} cannot be installed at "
                        "the moment. Please make sure your kit is connected "
                        "to the internet and there is enough space left on "
                        "your card.").format(self._app["title"])

        dialog = KanoDialog(
            head,
            message,
            {
                _("OK"): {
                    "return_value": 0
                },
            },
        )
        dialog.run()
        del dialog

        return success