Ejemplo n.º 1
0
    def openURL(self, url):
        from PyQt4.QtGui import QDesktopServices
        from PyQt4.QtCore import QUrl
        from ubiquity.misc import drop_privileges_save, regain_privileges_save

        # this nonsense is needed because kde doesn't want to be root
        drop_privileges_save()
        QDesktopServices.openUrl(QUrl(url))
        regain_privileges_save()
Ejemplo n.º 2
0
    def openURL(self, url):
        from PyQt4.QtGui import QDesktopServices
        from PyQt4.QtCore import QUrl
        from ubiquity.misc import drop_privileges_save, regain_privileges_save

        # this nonsense is needed because kde doesn't want to be root
        drop_privileges_save()
        QDesktopServices.openUrl(QUrl(url))
        regain_privileges_save()
Ejemplo n.º 3
0
    def openURL(self, url):        
        import subprocess
        from ubiquity.misc import drop_privileges_save, regain_privileges_save

        # this nonsense is needed because kde doesn't want to be root
        drop_privileges_save()                    
        uri = self.release_notes_url.replace('${LANG}', '')
        subprocess.Popen(['sensible-browser', uri], close_fds=True,
                             preexec_fn=misc.drop_all_privileges)
        regain_privileges_save()
Ejemplo n.º 4
0
    def openURL(self, url):
        from PyQt5.QtGui import QDesktopServices
        from PyQt5.QtCore import QUrl
        import shutil
        import os

        # this nonsense is needed because kde doesn't want to be root
        misc.drop_privileges()
        misc.drop_privileges_save()
        # copy over gtkrc-2.0 to get the themeing right
        if os.path.exists("/usr/share/kubuntu-default-settings"):
            shutil.copy(
                "/usr/share/kubuntu-default-settings/" + "dot-gtkrc-2.0-kde4",
                os.getenv("HOME") + "/.gtkrc-2.0")
        QDesktopServices.openUrl(QUrl(url))
        misc.regain_privileges()
        misc.regain_privileges_save()
Ejemplo n.º 5
0
    def openURL(self, url):
        from PyQt4.QtGui import QDesktopServices
        from PyQt4.QtCore import QUrl
        import shutil
        import os

        # this nonsense is needed because kde doesn't want to be root
        misc.drop_privileges()
        misc.drop_privileges_save()
        # copy over gtkrc-2.0 to get the themeing right
        if os.path.exists("/usr/share/netrunner-default-settings"):
            shutil.copy("/usr/share/netrunner-default-settings/" +
                        "dot-gtkrc-2.0-kde4",
                        os.getenv("HOME") + "/.gtkrc-2.0")
        QDesktopServices.openUrl(QUrl(url))
        misc.regain_privileges()
        misc.regain_privileges_save()