Skip to content
Permalink
Browse files

added standard buttons and title name of the task panel

  • Loading branch information...
amrit3701 committed Jun 22, 2017
1 parent 5acca2b commit 5d9467eacdc2c769703c37dfdb4bacaee6cad3b4
Showing with 23 additions and 62 deletions.
  1. +3 −2 StraightRebar.py
  2. +2 −22 StraightRebar.ui
  3. +2 −2 UShapeRebar.py
  4. +16 −36 UShapeRebar.ui
@@ -7,14 +7,14 @@
class _StraightRebarTaskPanel:
def __init__(self, Rebar = None):
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0]+".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("Arch", "Straight Rebar", None))
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
QtCore.QObject.connect(self.form.submit, QtCore.SIGNAL("clicked()"), self.accept)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0]+"/icons/StraightRebar.svg"))
self.Rebar = Rebar

def getStandardButtons(self):
return int(QtGui.QDialogButtonBox.Close)
return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)

def accept(self):
f_cover = self.form.frontCover.text()
@@ -46,6 +46,7 @@ def accept(self):
FreeCAD.Console.PrintMessage("Done!\n")
FreeCADGui.Control.closeDialog(self)


def amount_radio_clicked(self):
self.form.spacing.setEnabled(False)
self.form.amount.setEnabled(True)
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>245</width>
<height>377</height>
<width>197</width>
<height>306</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,25 +23,6 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="submit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="heading">
<property name="font">
@@ -235,7 +216,6 @@
<tabstop>spacing_radio</tabstop>
<tabstop>amount</tabstop>
<tabstop>spacing</tabstop>
<tabstop>submit</tabstop>
</tabstops>
<resources/>
<connections/>
@@ -8,14 +8,14 @@
class _UShapeRebarTaskPanel:
def __init__(self, Rebar = None):
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0]+".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("Arch", "U-Shape Rebar", None))
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
QtCore.QObject.connect(self.form.submit, QtCore.SIGNAL("clicked()"), self.accept)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0]+"/icons/UShapeRebar.svg"))
self.Rebar = Rebar

def getStandardButtons(self):
return int(QtGui.QDialogButtonBox.Close)
return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)

def accept(self):
f_cover = self.form.frontCover.text()
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StraightRebar</class>
<widget class="QDialog" name="StraightRebar">
<class>UShapeRebar</class>
<widget class="QDialog" name="UShapeRebar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>197</width>
<height>387</height>
<height>354</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,38 +23,6 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<widget class="QLabel" name="heading">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Fill all the values</string>
</property>
</widget>
</item>
<item row="8" column="0" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="submit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
@@ -215,6 +183,19 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="heading">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Fill all the values</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
@@ -245,7 +226,6 @@
<tabstop>spacing_radio</tabstop>
<tabstop>amount</tabstop>
<tabstop>spacing</tabstop>
<tabstop>submit</tabstop>
</tabstops>
<resources/>
<connections/>

0 comments on commit 5d9467e

Please sign in to comment.
You can’t perform that action at this time.