Implemented a fix for the last change to work with Qt4/PyQt4.

Sun, 17 Jan 2016 13:40:24 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 17 Jan 2016 13:40:24 +0100
changeset 4676
c65b401b775e
parent 4675
adb8882de5af
child 4678
2a8b44424952

Implemented a fix for the last change to work with Qt4/PyQt4.

Preferences/ConfigurationPages/ConfigurationPageBase.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorStylesPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/HelpAppearancePage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/HexEditorPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/ShellPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/TemplatesPage.py file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/ConfigurationPageBase.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/ConfigurationPageBase.py	Sun Jan 17 13:40:24 2016 +0100
@@ -117,7 +117,7 @@
             (QFontDialog.FontDialogOptions)
         @return selected font (QFont)
         """
-        font, ok = QFontDialog.getFont(fontVar, self, options=options)
+        font, ok = QFontDialog.getFont(fontVar, self, "", options)
         if ok:
             fontSample.setFont(font)
             if showFontInfo:
--- a/Preferences/ConfigurationPages/EditorStylesPage.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/EditorStylesPage.py	Sun Jan 17 13:40:24 2016 +0100
@@ -19,6 +19,11 @@
 
 import Preferences
 
+try:
+    MonospacedFontsOption = QFontDialog.MonospacedFonts
+except AttributeError:
+    MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
+
 
 class EditorStylesPage(ConfigurationPageBase, Ui_EditorStylesPage):
     """
@@ -348,7 +353,7 @@
         """
         self.marginsFont = self.selectFont(
             self.marginsFontSample, self.marginsFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
         
     @pyqtSlot()
     def on_defaultFontButton_clicked(self):
@@ -366,7 +371,7 @@
         """
         self.monospacedFont = self.selectFont(
             self.monospacedFontSample, self.monospacedFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
         
     def polishPage(self):
         """
--- a/Preferences/ConfigurationPages/HelpAppearancePage.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/HelpAppearancePage.py	Sun Jan 17 13:40:24 2016 +0100
@@ -19,6 +19,11 @@
 
 import Preferences
 
+try:
+    MonospacedFontsOption = QFontDialog.MonospacedFonts
+except AttributeError:
+    MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
+
 
 class HelpAppearancePage(ConfigurationPageBase, Ui_HelpAppearancePage):
     """
@@ -124,9 +129,9 @@
         """
         Private method used to select the fixed-width font.
         """
-        self.fixedFont = \
-            self.selectFont(self.fixedFontSample, self.fixedFont, True,
-            options=QFontDialog.MonospacedFonts)
+        self.fixedFont = self.selectFont(
+            self.fixedFontSample, self.fixedFont, True,
+            options=MonospacedFontsOption)
     
 
 def create(dlg):
--- a/Preferences/ConfigurationPages/HexEditorPage.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/HexEditorPage.py	Sun Jan 17 13:40:24 2016 +0100
@@ -18,6 +18,11 @@
 
 import Preferences
 
+try:
+    MonospacedFontsOption = QFontDialog.MonospacedFonts
+except AttributeError:
+    MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
+
 
 class HexEditorPage(ConfigurationPageBase, Ui_HexEditorPage):
     """
@@ -98,7 +103,7 @@
         """
         self.monospacedFont = self.selectFont(
             self.monospacedFontSample, self.monospacedFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
     
     def polishPage(self):
         """
--- a/Preferences/ConfigurationPages/ShellPage.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/ShellPage.py	Sun Jan 17 13:40:24 2016 +0100
@@ -17,6 +17,11 @@
 
 import Preferences
 
+try:
+    MonospacedFontsOption = QFontDialog.MonospacedFonts
+except AttributeError:
+    MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
+
 
 class ShellPage(ConfigurationPageBase, Ui_ShellPage):
     """
@@ -93,7 +98,7 @@
         """
         self.monospacedFont = self.selectFont(
             self.monospacedFontSample, self.monospacedFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
         
     @pyqtSlot()
     def on_linenumbersFontButton_clicked(self):
@@ -102,7 +107,7 @@
         """
         self.marginsFont = self.selectFont(
             self.marginsFontSample, self.marginsFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
         
     def polishPage(self):
         """
--- a/Preferences/ConfigurationPages/TemplatesPage.py	Sun Jan 17 13:05:52 2016 +0100
+++ b/Preferences/ConfigurationPages/TemplatesPage.py	Sun Jan 17 13:40:24 2016 +0100
@@ -17,6 +17,11 @@
 
 import Preferences
 
+try:
+    MonospacedFontsOption = QFontDialog.MonospacedFonts
+except AttributeError:
+    MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
+
 
 class TemplatesPage(ConfigurationPageBase, Ui_TemplatesPage):
     """
@@ -69,7 +74,7 @@
         """
         self.editorFont = self.selectFont(
             self.editorFontSample, self.editorFont,
-            options=QFontDialog.MonospacedFonts)
+            options=MonospacedFontsOption)
     
 
 def create(dlg):

eric ide

mercurial