~ubuntu-core-dev/ubuntu/xenial/ubuntu-release-upgrader/xenial

« back to all changes in this revision

Viewing changes to DistUpgrade/DistUpgradeFetcherKDE.py

  • Committer: Jonathan Riddell
  • Date: 2015-02-26 15:27:21 UTC
  • Revision ID: jriddell@ubuntu.com-20150226152721-op1yks0ixp8u0jjt
Tags: 1:15.04.10
Fix detection of pyqt5 vs pyqqt4

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        # QStandardButton translations.
75
75
        # FIXME: make sure we dep on l10n
76
76
        translator = QTranslator(app)
77
 
        if PYQT_VERSION >= 0x50000:
 
77
        if type(PYQT_VERSION) == int:
78
78
            translator.load(QLocale.system(), 'qt', '_',
79
79
                            '/usr/share/qt5/translations')
80
80
        else:
87
87
 
88
88
# Qt 5 vs. KDELibs4 compat functions
89
89
def _warning(text):
90
 
    if PYQT_VERSION >= 0x50000:
 
90
    if type(PYQT_VERSION) == int:
91
91
        QMessageBox.warning(None, "", text)
92
92
    else:
93
93
        KMessageBox.sorry(None, text, "")
94
94
 
95
95
 
96
96
def _icon(name):
97
 
    if PYQT_VERSION >= 0x50000:
 
97
    if type(PYQT_VERSION) == int:
98
98
        return QIcon.fromTheme(name)
99
99
    else:
100
100
        return KIcon(name)
115
115
        QApplication.processEvents()
116
116
 
117
117
    def error(self, summary, message):
118
 
        if PYQT_VERSION >= 0x50000:
 
118
        if type(PYQT_VERSION) == int:
119
119
            QMessageBox.critical(None, summary, message)
120
120
        else:
121
121
            KMessageBox.sorry(None, message, summary)
248
248
 
249
249
    def mediaChange(self, medium, drive):
250
250
        msg = _("Please insert '%s' into the drive '%s'") % (medium, drive)
251
 
        if PYQT_VERSION >= 0x50000:
 
251
        if type(PYQT_VERSION) == int:
252
252
            change = QMessageBox.question(None, _("Media Change"), msg,
253
253
                                          QMessageBox.Ok, QMessageBox.Cancel)
254
254
            if change == QMessageBox.Ok: