コード例 #1
0
ファイル: base.py プロジェクト: PisiLinuxNew/service-manager
    def showFail(self, exception):

        exception = unicode(exception)
        if exception.startswith('tr.org.pardus.comar.Comar.PolicyKit'):
            errorTitle = i18n("Authentication Error")
            errorMessage = i18n("You are not authorized for this operation.")
        else:
            errorTitle = i18n("Error")
            errorMessage = i18n("An exception occurred.")
        messageBox = QMessageBox(errorTitle, errorMessage, QMessageBox.Critical, QMessageBox.Ok, 0, 0)

        if not exception.startswith('tr.org.pardus.comar.Comar.PolicyKit'):
            messageBox.setDetailedText(unicode(exception))

        messageBox.exec_()
コード例 #2
0
    def showFail(self, exception):

        exception = unicode(exception)
        if exception.startswith('tr.org.pardus.comar.Comar.PolicyKit'):
            errorTitle = i18n("Authentication Error")
            errorMessage = i18n("You are not authorized for this operation.")
        else:
            errorTitle = i18n("Error")
            errorMessage = i18n("An exception occurred.")
        messageBox = QMessageBox(errorTitle, errorMessage,
                                 QMessageBox.Critical, QMessageBox.Ok, 0, 0)

        if not exception.startswith('tr.org.pardus.comar.Comar.PolicyKit'):
            messageBox.setDetailedText(unicode(exception))

        messageBox.exec_()
コード例 #3
0
def getDescription(service):
    try:
        # TODO add a package map for known services
        service = service.replace('_', '-')
        lang = str(locale.getdefaultlocale()[0].split("_")[0])
        desc = pisi.api.info_name(service)[0].package.description
        if desc.has_key(lang):
            return unicode(desc[lang])
        return unicode(desc['en'])
    except Exception, msg:
        # print "ERROR:", msg
        return unicode(i18n('Service information is not available'))
コード例 #4
0
        app = KApplication()

        # Create Main Widget
        mainWindow = ServiceManager(None, aboutData.appName)
        mainWindow.show()

    else:

        # Application Stuff
        from servicemanager.base import MainManager

        # Pds Stuff
        from pds.quniqueapp import QUniqueApplication
        from servicemanager.context import KIcon, i18n

        # Create a QUniqueApplication instance
        app = QUniqueApplication(sys.argv, catalog=about.appName)

        # Create Main Widget and make some settings
        mainWindow = MainManager(None)
        mainWindow.show()
        mainWindow.resize(640, 480)
        mainWindow.setWindowTitle(i18n(about.PACKAGE))
        mainWindow.setWindowIcon(KIcon(about.icon))

    # Create connection for lastWindowClosed signal to quit app
    app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)

    # Run the applications
    app.exec_()
コード例 #5
0
ファイル: service-manager.py プロジェクト: blue-devil/project
        app = KApplication()

        # Create Main Widget
        mainWindow = ServiceManager(None, aboutData.appName)
        mainWindow.show()

    else:

        # Application Stuff
        from servicemanager.base import MainManager

        # Pds Stuff
        from pds.quniqueapp import QUniqueApplication
        from servicemanager.context import KIcon, i18n

        # Create a QUniqueApllication instance
        app = QUniqueApplication(sys.argv, catalog=about.appName)

        # Create Main Widget and make some settings
        mainWindow = MainManager(None)
        mainWindow.show()
        mainWindow.resize(640, 480)
        mainWindow.setWindowTitle(i18n(about.PACKAGE))
        mainWindow.setWindowIcon(KIcon(about.icon))

    # Create connection for lastWindowClosed signal to quit app
    app.connect(app, SIGNAL('lastWindowClosed()'), app.quit)

    # Run the applications
    app.exec_()