Project.PropertiesDialog: extended the dialog to add 'make' support make_support

Fri, 13 Apr 2018 19:18:29 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 13 Apr 2018 19:18:29 +0200
branch
make_support
changeset 6243
528fbf120d68
parent 6242
28bda6fd5e57
child 6244
233eea858c32

Project.PropertiesDialog: extended the dialog to add 'make' support

Project/PropertiesDialog.py file | annotate | diff | comparison | revisions
Project/PropertiesDialog.ui file | annotate | diff | comparison | revisions
--- a/Project/PropertiesDialog.py	Fri Apr 13 19:17:10 2018 +0200
+++ b/Project/PropertiesDialog.py	Fri Apr 13 19:18:29 2018 +0200
@@ -21,6 +21,7 @@
 
 import Utilities
 import Preferences
+import UI.PixmapCache
 
 
 class PropertiesDialog(QDialog, Ui_PropertiesDialog):
@@ -44,10 +45,13 @@
         self.dirPicker.setMode(E5PathPickerModes.DirectoryMode)
         self.mainscriptPicker.setMode(E5PathPickerModes.OpenFileMode)
         
+        self.makeButton.setIcon(UI.PixmapCache.getIcon("makefile.png"))
+        
         self.project = project
         self.newProject = new
         self.transPropertiesDlg = None
         self.spellPropertiesDlg = None
+        self.makePropertiesDlg = None
         
         patterns = []
         for pattern, filetype in self.project.pdata["FILETYPES"].items():
@@ -189,6 +193,20 @@
         if res == QDialog.Rejected:
             self.transPropertiesDlg.initDialog()  # reset the dialogs contents
     
+    @pyqtSlot()
+    def on_makeButton_clicked(self):
+        """
+        Private slot to display the make properties dialog.
+        """
+        if self.makePropertiesDlg is None:
+            # TODO: add 'make' support - implement MakePropertiesDialog
+            from .MakePropertiesDialog import MakePropertiesDialog
+            self.makePropertiesDlg = \
+                MakePropertiesDialog(self.project, self.newProject, self)
+        res = self.makePropertiesDlg.exec_()
+        if res == QDialog.Rejected:
+            self.makePropertiesDlg.initDialog()
+    
     @pyqtSlot(str)
     def on_mainscriptPicker_pathSelected(self, script):
         """
@@ -285,3 +303,6 @@
         
         if self.transPropertiesDlg is not None:
             self.transPropertiesDlg.storeData()
+        
+        if self.makePropertiesDlg is not None:
+            self.makePropertiesDlg.storeData()
--- a/Project/PropertiesDialog.ui	Fri Apr 13 19:17:10 2018 +0200
+++ b/Project/PropertiesDialog.ui	Fri Apr 13 19:18:29 2018 +0200
@@ -79,17 +79,57 @@
       </widget>
      </item>
      <item row="3" column="1">
-      <widget class="QCheckBox" name="mixedLanguageCheckBox">
-       <property name="toolTip">
-        <string>Select, if the project uses other programming languages as well</string>
-       </property>
-       <property name="text">
-        <string>Mi&amp;xed programming languages</string>
-       </property>
-       <property name="shortcut">
-        <string>Alt+X</string>
-       </property>
-      </widget>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="QCheckBox" name="mixedLanguageCheckBox">
+         <property name="toolTip">
+          <string>Select, if the project uses other programming languages as well</string>
+         </property>
+         <property name="text">
+          <string>Mi&amp;xed programming languages</string>
+         </property>
+         <property name="shortcut">
+          <string>Alt+X</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="makeCheckBox">
+         <property name="toolTip">
+          <string>Select to activate the 'make' support</string>
+         </property>
+         <property name="text">
+          <string>Enable 'make' Support</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QToolButton" name="makeButton">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="toolTip">
+          <string>Press to open a dialog to enter the 'make' parameters</string>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
+      </layout>
      </item>
      <item row="4" column="0">
       <widget class="QLabel" name="textLabel1_2">
@@ -378,6 +418,8 @@
   <tabstop>spellPropertiesButton</tabstop>
   <tabstop>languageComboBox</tabstop>
   <tabstop>mixedLanguageCheckBox</tabstop>
+  <tabstop>makeCheckBox</tabstop>
+  <tabstop>makeButton</tabstop>
   <tabstop>projectTypeComboBox</tabstop>
   <tabstop>dirPicker</tabstop>
   <tabstop>versionEdit</tabstop>
@@ -399,8 +441,8 @@
    <slot>accept()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>57</x>
-     <y>511</y>
+     <x>66</x>
+     <y>545</y>
     </hint>
     <hint type="destinationlabel">
      <x>57</x>
@@ -415,8 +457,8 @@
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>143</x>
-     <y>516</y>
+     <x>152</x>
+     <y>545</y>
     </hint>
     <hint type="destinationlabel">
      <x>145</x>
@@ -424,5 +466,21 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>makeCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>makeButton</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>479</x>
+     <y>99</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>579</x>
+     <y>101</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>

eric ide

mercurial