Ejemplo n.º 1
0
    def __init__(self):
        # Create dialog class
        QDialog.__init__(self)

        # Load UI from designer
        ui_util.load_ui(self, self.ui_path)

        # Init Ui
        ui_util.init_ui(self)

        # get translations
        self.app = get_app()
        _ = self.app._tr

        create_text = _('Create & Edit Amazing Videos and Movies')
        description_text = _(
            'OpenShot Video Editor 2.x is the next generation of the award-winning <br/>OpenShot video editing platform.'
        )
        learnmore_text = _('Learn more')
        copyright_text = _(
            'Copyright &copy; %(begin_year)s-%(current_year)s') % {
                'begin_year': '2008',
                'current_year': str(datetime.datetime.today().year)
            }
        about_html = '<html><head/><body><hr/><p align="center"><span style=" font-size:10pt; font-weight:600;">%s</span></p><p align="center"><span style=" font-size:10pt;">%s </span><a href="http://%s.openshot.org?r=about-us"><span style=" font-size:10pt; text-decoration: none; color:#55aaff;">%s</span></a><span style=" font-size:10pt;">.</span></p></body></html>' % (
            create_text, description_text, info.website_language(),
            learnmore_text)
        company_html = '<html><head/><body style="font-size:11pt; font-weight:400; font-style:normal;">\n<hr />\n<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">%s </span><a href="http://%s.openshotstudios.com?r=about-us"><span style=" font-size:10pt; font-weight:600; text-decoration: none; color:#55aaff;">OpenShot Studios, LLC<br /></span></a></p></body></html>' % (
            copyright_text, info.website_language())

        # Set description and company labels
        self.lblAboutDescription.setText(about_html)
        self.lblAboutCompany.setText(company_html)

        # set events handlers
        self.btncredit.clicked.connect(self.load_credit)
        self.btnlicense.clicked.connect(self.load_license)

        # Init some variables
        self.txtversion.setText(_("Version: %s") % info.VERSION)
        self.txtversion.setAlignment(Qt.AlignCenter)

        # Track metrics
        track_metric_screen("about-screen")
Ejemplo n.º 2
0
    def __init__(self):

        # Create dialog class
        QDialog.__init__(self)

        # Load UI from designer
        ui_util.load_ui(self, self.ui_path)

        # Init Ui
        ui_util.init_ui(self)

        # get translations
        self.app = get_app()
        _ = self.app._tr

        # Update supporter button
        supporter_text = _("Become a Supporter")
        supporter_html = '<html><head/><body><p align="center"><a href="http://%s.openshot.org/donate/?app-about-us"><span style=" text-decoration: underline; color:#55aaff;">%s</span></a></p></body></html>' % (
            info.website_language(), supporter_text)
        self.lblBecomeSupporter.setText(supporter_html)

        # Add credits listview
        self.developersListView = CreditsTreeView(credits=info.CREDITS['code'],
                                                  columns=["email", "website"])
        self.vboxDevelopers.addWidget(self.developersListView)
        self.txtDeveloperFilter.textChanged.connect(
            partial(self.Filter_Triggered, self.txtDeveloperFilter,
                    self.developersListView))

        # Get string of translators for the current language
        translator_credits = []
        translator_credits_string = _("translator-credits").replace(
            "Launchpad Contributions:\n", "").replace("translator-credits", "")
        if translator_credits_string:
            # Parse string into a list of dictionaries
            translator_rows = translator_credits_string.split("\n")
            for row in translator_rows:
                # Split each row into 2 parts (name and username)
                translator_parts = row.split("https://launchpad.net/")
                name = translator_parts[0].strip()
                username = translator_parts[1].strip()
                translator_credits.append({
                    "name":
                    name,
                    "website":
                    "https://launchpad.net/%s" % username
                })

            # Add translators listview
            self.translatorsListView = CreditsTreeView(translator_credits,
                                                       columns=["website"])
            self.vboxTranslators.addWidget(self.translatorsListView)
            self.txtTranslatorFilter.textChanged.connect(
                partial(self.Filter_Triggered, self.txtTranslatorFilter,
                        self.translatorsListView))
        else:
            # No translations for this langauge, hide credits
            self.tabCredits.removeTab(1)

        # Get list of supporters
        supporter_list = []
        import codecs
        with codecs.open(
                os.path.join(info.PATH, 'settings', 'supporters.json'), 'r',
                'utf-8') as supporter_file:
            supporter_string = supporter_file.read()
            supporter_list = json.loads(supporter_string)

        # Add supporters listview
        self.supportersListView = CreditsTreeView(supporter_list,
                                                  columns=["website"])
        self.vboxSupporters.addWidget(self.supportersListView)
        self.txtSupporterFilter.textChanged.connect(
            partial(self.Filter_Triggered, self.txtSupporterFilter,
                    self.supportersListView))
Ejemplo n.º 3
0
    def __init__(self):
        # Create dialog class
        QDialog.__init__(self)

        # Load UI from designer
        ui_util.load_ui(self, self.ui_path)

        # Init Ui
        ui_util.init_ui(self)

        # get translations
        self.app = get_app()
        _ = self.app._tr

        # Hide chnagelog button by default
        self.btnchangelog.setVisible(False)
        for project in ['openshot-qt', 'libopenshot', 'libopenshot-audio']:
            changelog_path = os.path.join(info.PATH, 'settings',
                                          '%s.log' % project)
            if os.path.exists(changelog_path):
                # Attempt to open changelog with utf-8, and then utf-16-le (for unix / windows support)
                for encoding_name in ('utf-8', 'utf_16_le'):
                    try:
                        with codecs.open(
                                changelog_path, 'r',
                                encoding=encoding_name) as changelog_file:
                            if changelog_file.read():
                                self.btnchangelog.setVisible(True)
                                break
                    except:
                        # Ignore decoding errors
                        pass

        create_text = _('Create &amp; Edit Amazing Videos and Movies')
        description_text = _(
            'OpenShot Video Editor 2.x is the next generation of the award-winning <br/>OpenShot video editing platform.'
        )
        learnmore_text = _('Learn more')
        copyright_text = _(
            'Copyright &copy; %(begin_year)s-%(current_year)s') % {
                'begin_year': '2008',
                'current_year': str(datetime.datetime.today().year)
            }
        about_html = '<html><head/><body><hr/><p align="center"><span style=" font-size:10pt; font-weight:600;">%s</span></p><p align="center"><span style=" font-size:10pt;">%s </span><a href="https://www.openshot.org/%s?r=about-us"><span style=" font-size:10pt; text-decoration: none; color:#55aaff;">%s</span></a><span style=" font-size:10pt;">.</span></p></body></html>' % (
            create_text, description_text, info.website_language(),
            learnmore_text)
        company_html = '<html><head/><body style="font-size:11pt; font-weight:400; font-style:normal;">\n<hr />\n<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">%s </span><a href="http://www.openshotstudios.com?r=about-us"><span style=" font-size:10pt; font-weight:600; text-decoration: none; color:#55aaff;">OpenShot Studios, LLC<br /></span></a></p></body></html>' % (
            copyright_text)

        # Set description and company labels
        self.lblAboutDescription.setText(about_html)
        self.lblAboutCompany.setText(company_html)

        # set events handlers
        self.btncredit.clicked.connect(self.load_credit)
        self.btnlicense.clicked.connect(self.load_license)
        self.btnchangelog.clicked.connect(self.load_changelog)

        # Init some variables
        openshot_qt_version = _("Version: %s") % info.VERSION
        libopenshot_version = "libopenshot: %s" % openshot.OPENSHOT_VERSION_FULL
        self.txtversion.setText("<b>%s</b><br/>%s" %
                                (openshot_qt_version, libopenshot_version))
        self.txtversion.setAlignment(Qt.AlignCenter)

        # Track metrics
        track_metric_screen("about-screen")
Ejemplo n.º 4
0
    def __init__(self):
        # Create dialog class
        QDialog.__init__(self)

        # Load UI from designer & init
        ui_util.load_ui(self, self.ui_path)
        ui_util.init_ui(self)

        # get translations
        self.app = get_app()
        _ = self.app._tr

        # Hide chnagelog button by default
        self.btnchangelog.setVisible(False)

        projects = ['openshot-qt', 'libopenshot', 'libopenshot-audio']
        # Old paths
        paths = [os.path.join(info.PATH, 'settings', '{}.log'.format(p)) for p in projects]
        # New paths
        paths.extend([os.path.join(info.PATH, 'resources', '{}.log'.format(p)) for p in projects])
        if any([os.path.exists(path) for path in paths]):
            self.btnchangelog.setVisible(True)
        else:
            log.warn("No changelog files found, disabling button")

        create_text = _('Create &amp; Edit Amazing Videos and Movies')
        description_text = _(
            "OpenShot Video Editor 2.x is the next generation of the award-winning <br/>"
            "OpenShot video editing platform.")
        learnmore_text = _('Learn more')
        copyright_text = _('Copyright &copy; %(begin_year)s-%(current_year)s') % {
            'begin_year': '2008',
            'current_year': str(datetime.datetime.today().year)
            }
        about_html = '''
            <html><head/><body><hr/>
            <p align="center">
            <span style=" font-size:10pt; font-weight:600;">%s</span>
            </p>
            <p align="center">
            <span style=" font-size:10pt;">%s </span>
            <a href="https://www.openshot.org/%s?r=about-us">
                <span style=" font-size:10pt; text-decoration: none; color:#55aaff;">%s</span>
            </a>
            <span style=" font-size:10pt;">.</span>
            </p>
            </body></html>
            ''' % (
                create_text,
                description_text,
                info.website_language(),
                learnmore_text)
        company_html = '''
            <html><head/>
            <body style="font-size:11pt; font-weight:400; font-style:normal;">
            <hr />
            <p align="center"
               style="margin:12px 12px 0 0; -qt-block-indent:0; text-indent:0;">
               <span style="font-size:10pt; font-weight:600;">%s </span>
               <a href="http://www.openshotstudios.com?r=about-us">
               <span style="font-size:10pt; font-weight:600; text-decoration: none; color:#55aaff;">
               OpenShot Studios, LLC<br /></span></a>
            </p>
            </body></html>
            ''' % (copyright_text)

        # Set description and company labels
        self.lblAboutDescription.setText(about_html)
        self.lblAboutCompany.setText(company_html)

        # set events handlers
        self.btncredit.clicked.connect(self.load_credit)
        self.btnlicense.clicked.connect(self.load_license)
        self.btnchangelog.clicked.connect(self.load_changelog)

        # Look for frozen version info
        frozen_version_label = ""
        version_path = os.path.join(info.PATH, "settings", "version.json")
        if os.path.exists(version_path):
            with open(version_path, "r", encoding="UTF-8") as f:
                version_info = json.loads(f.read())
                if version_info:
                    frozen_version_label = "<br/><br/><b>%s</b><br/>Build Date: %s" % \
                        (version_info.get('build_name'), version_info.get('date'))

        # Init some variables
        openshot_qt_version = _("Version: %s") % info.VERSION
        libopenshot_version = "libopenshot: %s" % openshot.OPENSHOT_VERSION_FULL
        self.txtversion.setText(
            "<b>%s</b><br/>%s%s" % (openshot_qt_version, libopenshot_version, frozen_version_label))
        self.txtversion.setAlignment(Qt.AlignCenter)

        # Track metrics
        track_metric_screen("about-screen")