Ejemplo n.º 1
0
class Ui_QgsCompositionWidgetBase(QtGui.QWidget):
    def __init__(self, parent):
        QtGui.QWidget.__init__(self, parent)
        self.setObjectName(_fromUtf8("QgsCompositionWidgetBase"))
        self.resize(345, 506)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        self.verticalLayout = QtGui.QVBoxLayout(self)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.scrollArea = QtGui.QScrollArea(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
                                       QtGui.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.scrollArea.sizePolicy().hasHeightForWidth())
        self.scrollArea.setSizePolicy(sizePolicy)
        self.scrollArea.setFocusPolicy(QtCore.Qt.WheelFocus)
        self.scrollArea.setFrameShape(QtGui.QFrame.StyledPanel)
        self.scrollArea.setFrameShadow(QtGui.QFrame.Plain)
        self.scrollArea.setWidgetResizable(True)
        self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
        self.scrollAreaWidgetContents = QtGui.QWidget()
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(
            0, 0, 327, 1085))
        self.scrollAreaWidgetContents.setObjectName(
            _fromUtf8("scrollAreaWidgetContents"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(
            self.scrollAreaWidgetContents)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.groupBox = QgsCollapsibleGroupBoxBasic(
            self.scrollAreaWidgetContents)
        self.groupBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.groupBox.setProperty("syncGroup", _fromUtf8("composeritem"))
        self.groupBox.setProperty("collapsed", False)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.textLabel7 = QtGui.QLabel(self.groupBox)
        self.textLabel7.setWordWrap(True)
        self.textLabel7.setObjectName(_fromUtf8("textLabel7"))
        self.gridLayout.addWidget(self.textLabel7, 4, 0, 1, 1)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
        self.mPaperUnitsComboBox = QtGui.QComboBox(self.groupBox)
        self.mPaperUnitsComboBox.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mPaperUnitsComboBox.sizePolicy().hasHeightForWidth())
        self.mPaperUnitsComboBox.setSizePolicy(sizePolicy)
        self.mPaperUnitsComboBox.setObjectName(
            _fromUtf8("mPaperUnitsComboBox"))
        self.gridLayout.addWidget(self.mPaperUnitsComboBox, 3, 1, 1, 1)
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
        self.textLabel3 = QtGui.QLabel(self.groupBox)
        self.textLabel3.setWordWrap(True)
        self.textLabel3.setObjectName(_fromUtf8("textLabel3"))
        self.gridLayout.addWidget(self.textLabel3, 0, 0, 1, 1)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.mPaperHeightDoubleSpinBox = QgsDoubleSpinBox(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mPaperHeightDoubleSpinBox.sizePolicy().hasHeightForWidth())
        self.mPaperHeightDoubleSpinBox.setSizePolicy(sizePolicy)
        self.mPaperHeightDoubleSpinBox.setPrefix(_fromUtf8(""))
        self.mPaperHeightDoubleSpinBox.setSuffix(_fromUtf8(""))
        self.mPaperHeightDoubleSpinBox.setMaximum(99999.0)
        self.mPaperHeightDoubleSpinBox.setProperty("showClearButton", False)
        self.mPaperHeightDoubleSpinBox.setObjectName(
            _fromUtf8("mPaperHeightDoubleSpinBox"))
        self.horizontalLayout_3.addWidget(self.mPaperHeightDoubleSpinBox)
        self.mPaperHeightDDBtn = QgsDataDefinedButton(self.groupBox)
        self.mPaperHeightDDBtn.setObjectName(_fromUtf8("mPaperHeightDDBtn"))
        self.horizontalLayout_3.addWidget(self.mPaperHeightDDBtn)
        self.gridLayout.addLayout(self.horizontalLayout_3, 2, 1, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.mPaperWidthDoubleSpinBox = QgsDoubleSpinBox(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mPaperWidthDoubleSpinBox.sizePolicy().hasHeightForWidth())
        self.mPaperWidthDoubleSpinBox.setSizePolicy(sizePolicy)
        self.mPaperWidthDoubleSpinBox.setPrefix(_fromUtf8(""))
        self.mPaperWidthDoubleSpinBox.setSuffix(_fromUtf8(""))
        self.mPaperWidthDoubleSpinBox.setMaximum(99999.0)
        self.mPaperWidthDoubleSpinBox.setProperty("showClearButton", False)
        self.mPaperWidthDoubleSpinBox.setObjectName(
            _fromUtf8("mPaperWidthDoubleSpinBox"))
        self.horizontalLayout_2.addWidget(self.mPaperWidthDoubleSpinBox)
        self.mPaperWidthDDBtn = QgsDataDefinedButton(self.groupBox)
        self.mPaperWidthDDBtn.setObjectName(_fromUtf8("mPaperWidthDDBtn"))
        self.horizontalLayout_2.addWidget(self.mPaperWidthDDBtn)
        self.gridLayout.addLayout(self.horizontalLayout_2, 1, 1, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.mPaperSizeComboBox = QtGui.QComboBox(self.groupBox)
        self.mPaperSizeComboBox.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mPaperSizeComboBox.sizePolicy().hasHeightForWidth())
        self.mPaperSizeComboBox.setSizePolicy(sizePolicy)
        self.mPaperSizeComboBox.setObjectName(_fromUtf8("mPaperSizeComboBox"))
        self.horizontalLayout.addWidget(self.mPaperSizeComboBox)
        self.mPaperSizeDDBtn = QgsDataDefinedButton(self.groupBox)
        self.mPaperSizeDDBtn.setObjectName(_fromUtf8("mPaperSizeDDBtn"))
        self.horizontalLayout.addWidget(self.mPaperSizeDDBtn)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 1, 1, 1)
        self.label = QtGui.QLabel(self.groupBox)
        self.label.setWordWrap(True)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.mPaperOrientationComboBox = QtGui.QComboBox(self.groupBox)
        self.mPaperOrientationComboBox.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mPaperOrientationComboBox.sizePolicy().hasHeightForWidth())
        self.mPaperOrientationComboBox.setSizePolicy(sizePolicy)
        self.mPaperOrientationComboBox.setObjectName(
            _fromUtf8("mPaperOrientationComboBox"))
        self.horizontalLayout_5.addWidget(self.mPaperOrientationComboBox)
        self.mPaperOrientationDDBtn = QgsDataDefinedButton(self.groupBox)
        self.mPaperOrientationDDBtn.setObjectName(
            _fromUtf8("mPaperOrientationDDBtn"))
        self.horizontalLayout_5.addWidget(self.mPaperOrientationDDBtn)
        self.gridLayout.addLayout(self.horizontalLayout_5, 4, 1, 1, 1)
        self.verticalLayout_2.addWidget(self.groupBox)
        self.groupBox_5 = QgsCollapsibleGroupBoxBasic(
            self.scrollAreaWidgetContents)
        self.groupBox_5.setObjectName(_fromUtf8("groupBox_5"))
        self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_5)
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.gridLayout_5 = QtGui.QGridLayout()
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.label_4 = QtGui.QLabel(self.groupBox_5)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_5.addWidget(self.label_4, 0, 1, 1, 1)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem, 0, 0, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem1, 0, 3, 1, 1)
        self.mTopMarginSpinBox = QgsDoubleSpinBox(self.groupBox_5)
        self.mTopMarginSpinBox.setSingleStep(0.1)
        self.mTopMarginSpinBox.setObjectName(_fromUtf8("mTopMarginSpinBox"))
        self.gridLayout_5.addWidget(self.mTopMarginSpinBox, 0, 2, 1, 1)
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.label_5 = QtGui.QLabel(self.groupBox_5)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_7.addWidget(self.label_5)
        self.mLeftMarginSpinBox = QgsDoubleSpinBox(self.groupBox_5)
        self.mLeftMarginSpinBox.setSingleStep(0.1)
        self.mLeftMarginSpinBox.setObjectName(_fromUtf8("mLeftMarginSpinBox"))
        self.horizontalLayout_7.addWidget(self.mLeftMarginSpinBox)
        self.label_11 = QtGui.QLabel(self.groupBox_5)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.horizontalLayout_7.addWidget(self.label_11)
        self.mRightMarginSpinBox = QgsDoubleSpinBox(self.groupBox_5)
        self.mRightMarginSpinBox.setSingleStep(0.1)
        self.mRightMarginSpinBox.setObjectName(
            _fromUtf8("mRightMarginSpinBox"))
        self.horizontalLayout_7.addWidget(self.mRightMarginSpinBox)
        self.gridLayout_5.addLayout(self.horizontalLayout_7, 1, 0, 1, 4)
        self.label_12 = QtGui.QLabel(self.groupBox_5)
        self.label_12.setObjectName(_fromUtf8("label_12"))
        self.gridLayout_5.addWidget(self.label_12, 2, 1, 1, 1)
        self.mBottomMarginSpinBox = QgsDoubleSpinBox(self.groupBox_5)
        self.mBottomMarginSpinBox.setSingleStep(0.1)
        self.mBottomMarginSpinBox.setObjectName(
            _fromUtf8("mBottomMarginSpinBox"))
        self.gridLayout_5.addWidget(self.mBottomMarginSpinBox, 2, 2, 1, 1)
        self.mResizePageButton = QtGui.QPushButton(self.groupBox_5)
        self.mResizePageButton.setObjectName(_fromUtf8("mResizePageButton"))
        self.gridLayout_5.addWidget(self.mResizePageButton, 3, 1, 1, 2)
        self.verticalLayout_5.addLayout(self.gridLayout_5)
        self.verticalLayout_2.addWidget(self.groupBox_5)
        self.groupBox_4 = QgsCollapsibleGroupBoxBasic(
            self.scrollAreaWidgetContents)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.mNumPagesLabel = QtGui.QLabel(self.groupBox_4)
        self.mNumPagesLabel.setWordWrap(True)
        self.mNumPagesLabel.setObjectName(_fromUtf8("mNumPagesLabel"))
        self.gridLayout_4.addWidget(self.mNumPagesLabel, 0, 0, 1, 1)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.mNumPagesSpinBox = QgsSpinBox(self.groupBox_4)
        self.mNumPagesSpinBox.setMinimum(1)
        self.mNumPagesSpinBox.setProperty("showClearButton", False)
        self.mNumPagesSpinBox.setObjectName(_fromUtf8("mNumPagesSpinBox"))
        self.horizontalLayout_4.addWidget(self.mNumPagesSpinBox)
        self.mNumPagesDDBtn = QgsDataDefinedButton(self.groupBox_4)
        self.mNumPagesDDBtn.setObjectName(_fromUtf8("mNumPagesDDBtn"))
        self.horizontalLayout_4.addWidget(self.mNumPagesDDBtn)
        self.gridLayout_4.addLayout(self.horizontalLayout_4, 0, 1, 1, 1)
        self.label_10 = QtGui.QLabel(self.groupBox_4)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout_4.addWidget(self.label_10, 1, 0, 1, 1)
        self.mPageStyleButton = QtGui.QPushButton(self.groupBox_4)
        self.mPageStyleButton.setObjectName(_fromUtf8("mPageStyleButton"))
        self.gridLayout_4.addWidget(self.mPageStyleButton, 1, 1, 1, 1)
        self.verticalLayout_2.addWidget(self.groupBox_4)
        self.groupBox_3 = QgsCollapsibleGroupBoxBasic(
            self.scrollAreaWidgetContents)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.mResolutionSpinBox = QgsSpinBox(self.groupBox_3)
        self.mResolutionSpinBox.setPrefix(_fromUtf8(""))
        self.mResolutionSpinBox.setMaximum(3000)
        self.mResolutionSpinBox.setProperty("showClearButton", False)
        self.mResolutionSpinBox.setObjectName(_fromUtf8("mResolutionSpinBox"))
        self.gridLayout_3.addWidget(self.mResolutionSpinBox, 1, 1, 1, 1)
        self.mPrintAsRasterCheckBox = QtGui.QCheckBox(self.groupBox_3)
        self.mPrintAsRasterCheckBox.setCheckable(True)
        self.mPrintAsRasterCheckBox.setChecked(False)
        self.mPrintAsRasterCheckBox.setObjectName(
            _fromUtf8("mPrintAsRasterCheckBox"))
        self.gridLayout_3.addWidget(self.mPrintAsRasterCheckBox, 2, 0, 1, 1)
        self.mWorldFileMapComboBox = QtGui.QComboBox(self.groupBox_3)
        self.mWorldFileMapComboBox.setEnabled(False)
        self.mWorldFileMapComboBox.setEditable(False)
        self.mWorldFileMapComboBox.setObjectName(
            _fromUtf8("mWorldFileMapComboBox"))
        self.gridLayout_3.addWidget(self.mWorldFileMapComboBox, 3, 1, 1, 1)
        self.mGenerateWorldFileCheckBox = QtGui.QCheckBox(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.mGenerateWorldFileCheckBox.sizePolicy().hasHeightForWidth())
        self.mGenerateWorldFileCheckBox.setSizePolicy(sizePolicy)
        self.mGenerateWorldFileCheckBox.setObjectName(
            _fromUtf8("mGenerateWorldFileCheckBox"))
        self.gridLayout_3.addWidget(self.mGenerateWorldFileCheckBox, 3, 0, 1,
                                    1)
        self.label_9 = QtGui.QLabel(self.groupBox_3)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout_3.addWidget(self.label_9, 1, 0, 1, 1)
        self.verticalLayout_2.addWidget(self.groupBox_3)
        self.mSnapToGridGroupCheckBox = QgsCollapsibleGroupBoxBasic(
            self.scrollAreaWidgetContents)
        self.mSnapToGridGroupCheckBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.mSnapToGridGroupCheckBox.setCheckable(False)
        self.mSnapToGridGroupCheckBox.setChecked(False)
        self.mSnapToGridGroupCheckBox.setProperty("syncGroup",
                                                  _fromUtf8("composeritem"))
        self.mSnapToGridGroupCheckBox.setProperty("collapsed", True)
        self.mSnapToGridGroupCheckBox.setObjectName(
            _fromUtf8("mSnapToGridGroupCheckBox"))
        self.gridLayout_2 = QtGui.QGridLayout(self.mSnapToGridGroupCheckBox)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.label_8 = QtGui.QLabel(self.mSnapToGridGroupCheckBox)
        self.label_8.setWordWrap(True)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout_2.addWidget(self.label_8, 0, 0, 1, 1)
        self.mGridResolutionSpinBox = QgsDoubleSpinBox(
            self.mSnapToGridGroupCheckBox)
        self.mGridResolutionSpinBox.setPrefix(_fromUtf8(""))
        self.mGridResolutionSpinBox.setMinimum(0.5)
        self.mGridResolutionSpinBox.setMaximum(9999.0)
        self.mGridResolutionSpinBox.setProperty("showClearButton", False)
        self.mGridResolutionSpinBox.setObjectName(
            _fromUtf8("mGridResolutionSpinBox"))
        self.gridLayout_2.addWidget(self.mGridResolutionSpinBox, 0, 1, 1, 1)
        self.label_6 = QtGui.QLabel(self.mSnapToGridGroupCheckBox)
        self.label_6.setWordWrap(True)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.gridLayout_2.addWidget(self.label_6, 1, 0, 1, 1)
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.mOffsetXSpinBox = QgsDoubleSpinBox(self.mSnapToGridGroupCheckBox)
        self.mOffsetXSpinBox.setMaximum(9999.0)
        self.mOffsetXSpinBox.setObjectName(_fromUtf8("mOffsetXSpinBox"))
        self.verticalLayout_3.addWidget(self.mOffsetXSpinBox)
        self.mOffsetYSpinBox = QgsDoubleSpinBox(self.mSnapToGridGroupCheckBox)
        self.mOffsetYSpinBox.setMaximum(9999.0)
        self.mOffsetYSpinBox.setObjectName(_fromUtf8("mOffsetYSpinBox"))
        self.verticalLayout_3.addWidget(self.mOffsetYSpinBox)
        self.gridLayout_2.addLayout(self.verticalLayout_3, 1, 1, 1, 1)
        self.label_7 = QtGui.QLabel(self.mSnapToGridGroupCheckBox)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.gridLayout_2.addWidget(self.label_7, 2, 0, 1, 1)
        self.mSnapToleranceSpinBox = QgsSpinBox(self.mSnapToGridGroupCheckBox)
        self.mSnapToleranceSpinBox.setMaximum(200)
        self.mSnapToleranceSpinBox.setProperty("showClearButton", False)
        self.mSnapToleranceSpinBox.setObjectName(
            _fromUtf8("mSnapToleranceSpinBox"))
        self.gridLayout_2.addWidget(self.mSnapToleranceSpinBox, 2, 1, 1, 1)
        self.gridLayout_2.setColumnStretch(1, 1)
        self.verticalLayout_2.addWidget(self.mSnapToGridGroupCheckBox)
        self.groupBox_2 = QgsCollapsibleGroupBox(self.scrollAreaWidgetContents)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.verticalLayout_4 = QtGui.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
        self.mVariableEditor = QgsVariableEditorWidget(self.groupBox_2)
        self.mVariableEditor.setMinimumSize(QtCore.QSize(0, 200))
        self.mVariableEditor.setObjectName(_fromUtf8("mVariableEditor"))
        self.verticalLayout_4.addWidget(self.mVariableEditor)
        self.verticalLayout_2.addWidget(self.groupBox_2)
        spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem2)
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
        self.verticalLayout.addWidget(self.scrollArea)
        self.textLabel7.setBuddy(self.mPaperOrientationComboBox)
        self.textLabel3.setBuddy(self.mPaperSizeComboBox)

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(self)
        self.setTabOrder(self.scrollArea, self.groupBox)
        self.setTabOrder(self.groupBox, self.mPaperSizeComboBox)
        self.setTabOrder(self.mPaperSizeComboBox, self.mPaperSizeDDBtn)
        self.setTabOrder(self.mPaperSizeDDBtn, self.mPaperWidthDoubleSpinBox)
        self.setTabOrder(self.mPaperWidthDoubleSpinBox, self.mPaperWidthDDBtn)
        self.setTabOrder(self.mPaperWidthDDBtn, self.mPaperHeightDoubleSpinBox)
        self.setTabOrder(self.mPaperHeightDoubleSpinBox,
                         self.mPaperHeightDDBtn)
        self.setTabOrder(self.mPaperHeightDDBtn, self.mPaperUnitsComboBox)
        self.setTabOrder(self.mPaperUnitsComboBox,
                         self.mPaperOrientationComboBox)
        self.setTabOrder(self.mPaperOrientationComboBox,
                         self.mPaperOrientationDDBtn)
        self.setTabOrder(self.mPaperOrientationDDBtn, self.mTopMarginSpinBox)
        self.setTabOrder(self.mTopMarginSpinBox, self.mLeftMarginSpinBox)
        self.setTabOrder(self.mLeftMarginSpinBox, self.mRightMarginSpinBox)
        self.setTabOrder(self.mRightMarginSpinBox, self.mBottomMarginSpinBox)
        self.setTabOrder(self.mBottomMarginSpinBox, self.mResizePageButton)
        self.setTabOrder(self.mResizePageButton, self.mNumPagesSpinBox)
        self.setTabOrder(self.mNumPagesSpinBox, self.mNumPagesDDBtn)
        self.setTabOrder(self.mNumPagesDDBtn, self.mPageStyleButton)
        self.setTabOrder(self.mPageStyleButton, self.mResolutionSpinBox)
        self.setTabOrder(self.mResolutionSpinBox, self.mPrintAsRasterCheckBox)
        self.setTabOrder(self.mPrintAsRasterCheckBox,
                         self.mGenerateWorldFileCheckBox)
        self.setTabOrder(self.mGenerateWorldFileCheckBox,
                         self.mWorldFileMapComboBox)
        self.setTabOrder(self.mWorldFileMapComboBox,
                         self.mSnapToGridGroupCheckBox)
        self.setTabOrder(self.mSnapToGridGroupCheckBox,
                         self.mGridResolutionSpinBox)
        self.setTabOrder(self.mGridResolutionSpinBox, self.mOffsetXSpinBox)
        self.setTabOrder(self.mOffsetXSpinBox, self.mOffsetYSpinBox)
        self.setTabOrder(self.mOffsetYSpinBox, self.mSnapToleranceSpinBox)

        self.groupBox_2.setVisible(False)
        self.groupBox.setVisible(False)
        self.groupBox_5.setVisible(False)

    def retranslateUi(self):
        self.setWindowTitle(
            _translate("QgsCompositionWidgetBase", "Composition", None))
        self.groupBox.setTitle(
            _translate("QgsCompositionWidgetBase", "Page size", None))
        self.textLabel7.setText(
            _translate("QgsCompositionWidgetBase", "Orientation", None))
        self.label_2.setText(
            _translate("QgsCompositionWidgetBase", "Height", None))
        self.label_3.setText(
            _translate("QgsCompositionWidgetBase", "Units", None))
        self.textLabel3.setText(
            _translate("QgsCompositionWidgetBase", "Presets", None))
        self.mPaperHeightDDBtn.setText(
            _translate("QgsCompositionWidgetBase", "...", None))
        self.mPaperWidthDDBtn.setText(
            _translate("QgsCompositionWidgetBase", "...", None))
        self.mPaperSizeDDBtn.setText(
            _translate("QgsCompositionWidgetBase", "...", None))
        self.label.setText(
            _translate("QgsCompositionWidgetBase", "Width", None))
        self.mPaperOrientationDDBtn.setText(
            _translate("QgsCompositionWidgetBase", "...", None))
        self.groupBox_5.setTitle(
            _translate("QgsCompositionWidgetBase", "Resize page to content",
                       None))
        self.label_4.setText(
            _translate("QgsCompositionWidgetBase", "Top margin (mm)", None))
        self.label_5.setText(
            _translate("QgsCompositionWidgetBase", "Left", None))
        self.label_11.setText(
            _translate("QgsCompositionWidgetBase", "Right", None))
        self.label_12.setText(
            _translate("QgsCompositionWidgetBase", "Bottom", None))
        self.mResizePageButton.setText(
            _translate("QgsCompositionWidgetBase", "Resize page", None))
        self.groupBox_4.setTitle(
            _translate("QgsCompositionWidgetBase", "Page settings", None))
        self.mNumPagesLabel.setText(
            _translate("QgsCompositionWidgetBase", "Number of pages", None))
        self.mNumPagesDDBtn.setText(
            _translate("QgsCompositionWidgetBase", "...", None))
        self.label_10.setText(
            _translate("QgsCompositionWidgetBase", "Page background", None))
        self.mPageStyleButton.setText(
            _translate("QgsCompositionWidgetBase", "Change...", None))
        self.groupBox_3.setTitle(
            _translate("QgsCompositionWidgetBase", "Export settings", None))
        self.mResolutionSpinBox.setSuffix(
            _translate("QgsCompositionWidgetBase", " dpi", None))
        self.mPrintAsRasterCheckBox.setText(
            _translate("QgsCompositionWidgetBase", "Print as raster", None))
        self.mGenerateWorldFileCheckBox.setText(
            _translate("QgsCompositionWidgetBase", "World file on", None))
        self.label_9.setText(
            _translate("QgsCompositionWidgetBase", "Export resolution", None))
        self.mSnapToGridGroupCheckBox.setTitle(
            _translate("QgsCompositionWidgetBase", "Guides and Grid", None))
        self.label_8.setText(
            _translate("QgsCompositionWidgetBase", "Grid spacing", None))
        self.mGridResolutionSpinBox.setSuffix(
            _translate("QgsCompositionWidgetBase", " mm", None))
        self.label_6.setText(
            _translate("QgsCompositionWidgetBase", "Grid offset", None))
        self.mOffsetXSpinBox.setPrefix(
            _translate("QgsCompositionWidgetBase", "x: ", None))
        self.mOffsetXSpinBox.setSuffix(
            _translate("QgsCompositionWidgetBase", " mm", None))
        self.mOffsetYSpinBox.setPrefix(
            _translate("QgsCompositionWidgetBase", "y: ", None))
        self.mOffsetYSpinBox.setSuffix(
            _translate("QgsCompositionWidgetBase", " mm", None))
        self.label_7.setText(
            _translate("QgsCompositionWidgetBase", "Snap tolerance", None))
        self.mSnapToleranceSpinBox.setSuffix(
            _translate("QgsCompositionWidgetBase", " px", None))
        self.groupBox_2.setTitle(
            _translate("QgsCompositionWidgetBase", "Variables", None))
class QgsComposerImageExportOptionsDialog(QtGui.QDialog):
    def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent)
        # self.setObjectName(_fromUtf8("QgsComposerImageExportOptionsDialog"))
        self.resize(489, 325)
        self.verticalLayout = QtGui.QVBoxLayout(self)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.groupBox = QtGui.QGroupBox(self)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.label_9 = QtGui.QLabel(self.groupBox)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout.addWidget(self.label_9, 0, 0, 1, 2)
        self.label_13 = QtGui.QLabel(self.groupBox)
        self.label_13.setObjectName(_fromUtf8("label_13"))
        self.gridLayout.addWidget(self.label_13, 2, 0, 1, 2)
        self.mResolutionSpinBox = QgsSpinBox(self.groupBox)
        self.mResolutionSpinBox.setPrefix(_fromUtf8(""))
        self.mResolutionSpinBox.setMaximum(3000)
        self.mResolutionSpinBox.setProperty("showClearButton", False)
        self.mResolutionSpinBox.setObjectName(_fromUtf8("mResolutionSpinBox"))
        self.gridLayout.addWidget(self.mResolutionSpinBox, 0, 2, 1, 2)
        self.mWidthSpinBox = QgsSpinBox(self.groupBox)
        self.mWidthSpinBox.setPrefix(_fromUtf8(""))
        self.mWidthSpinBox.setMinimum(0)
        self.mWidthSpinBox.setMaximum(99999999)
        self.mWidthSpinBox.setProperty("showClearButton", False)
        self.mWidthSpinBox.setObjectName(_fromUtf8("mWidthSpinBox"))
        self.gridLayout.addWidget(self.mWidthSpinBox, 1, 2, 1, 2)
        self.label_10 = QtGui.QLabel(self.groupBox)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 1, 0, 1, 1)
        self.mHeightSpinBox = QgsSpinBox(self.groupBox)
        self.mHeightSpinBox.setPrefix(_fromUtf8(""))
        self.mHeightSpinBox.setMinimum(0)
        self.mHeightSpinBox.setMaximum(99999999)
        self.mHeightSpinBox.setProperty("showClearButton", False)
        self.mHeightSpinBox.setObjectName(_fromUtf8("mHeightSpinBox"))
        self.gridLayout.addWidget(self.mHeightSpinBox, 2, 2, 1, 2)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 1, 4, 1, 1)
        self.verticalLayout.addWidget(self.groupBox)
        self.mClipToContentGroupBox = QgsCollapsibleGroupBoxBasic(self)
        self.mClipToContentGroupBox.setCheckable(True)
        self.mClipToContentGroupBox.setChecked(False)
        self.mClipToContentGroupBox.setObjectName(
            _fromUtf8("mClipToContentGroupBox"))
        self.verticalLayout_5 = QtGui.QVBoxLayout(self.mClipToContentGroupBox)
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.gridLayout_5 = QtGui.QGridLayout()
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.label_5 = QtGui.QLabel(self.mClipToContentGroupBox)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_7.addWidget(self.label_5)
        self.mLeftMarginSpinBox = QgsSpinBox(self.mClipToContentGroupBox)
        self.mLeftMarginSpinBox.setMaximum(1000)
        self.mLeftMarginSpinBox.setObjectName(_fromUtf8("mLeftMarginSpinBox"))
        self.horizontalLayout_7.addWidget(self.mLeftMarginSpinBox)
        self.label_11 = QtGui.QLabel(self.mClipToContentGroupBox)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.horizontalLayout_7.addWidget(self.label_11)
        self.mRightMarginSpinBox = QgsSpinBox(self.mClipToContentGroupBox)
        self.mRightMarginSpinBox.setMaximum(1000)
        self.mRightMarginSpinBox.setObjectName(
            _fromUtf8("mRightMarginSpinBox"))
        self.horizontalLayout_7.addWidget(self.mRightMarginSpinBox)
        self.gridLayout_5.addLayout(self.horizontalLayout_7, 1, 0, 1, 4)
        self.label_12 = QtGui.QLabel(self.mClipToContentGroupBox)
        self.label_12.setObjectName(_fromUtf8("label_12"))
        self.gridLayout_5.addWidget(self.label_12, 2, 1, 1, 1)
        self.label_4 = QtGui.QLabel(self.mClipToContentGroupBox)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_5.addWidget(self.label_4, 0, 1, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem1, 0, 3, 1, 1)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.gridLayout_5.addItem(spacerItem2, 0, 0, 1, 1)
        self.mTopMarginSpinBox = QgsSpinBox(self.mClipToContentGroupBox)
        self.mTopMarginSpinBox.setMaximum(1000)
        self.mTopMarginSpinBox.setObjectName(_fromUtf8("mTopMarginSpinBox"))
        self.gridLayout_5.addWidget(self.mTopMarginSpinBox, 0, 2, 1, 1)
        self.mBottomMarginSpinBox = QgsSpinBox(self.mClipToContentGroupBox)
        self.mBottomMarginSpinBox.setMaximum(1000)
        self.mBottomMarginSpinBox.setObjectName(
            _fromUtf8("mBottomMarginSpinBox"))
        self.gridLayout_5.addWidget(self.mBottomMarginSpinBox, 2, 2, 1, 1)
        self.verticalLayout_5.addLayout(self.gridLayout_5)
        self.verticalLayout.addWidget(self.mClipToContentGroupBox)
        spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem3)
        self.buttonBox = QtGui.QDialogButtonBox(self)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                          | QtGui.QDialogButtonBox.Save)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi()
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("accepted()")),
                               self.accept)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("rejected()")),
                               self.reject)
        QtCore.QMetaObject.connectSlotsByName(self)
        self.setTabOrder(self.mResolutionSpinBox, self.mWidthSpinBox)
        self.setTabOrder(self.mWidthSpinBox, self.mHeightSpinBox)
        self.setTabOrder(self.mHeightSpinBox, self.mClipToContentGroupBox)
        self.setTabOrder(self.mClipToContentGroupBox, self.mTopMarginSpinBox)
        self.setTabOrder(self.mTopMarginSpinBox, self.mLeftMarginSpinBox)
        self.setTabOrder(self.mLeftMarginSpinBox, self.mRightMarginSpinBox)
        self.setTabOrder(self.mRightMarginSpinBox, self.mBottomMarginSpinBox)

        self.connect(self.mClipToContentGroupBox,
                     QtCore.SIGNAL("toggled( bool )"),
                     self.clipToContentsToggled)
        # self.mWidthSpinBox.valueChanged.connect(self.on_mWidthSpinBox_valueChanged)
        # self.mHeightSpinBox.valueChanged.connect(self.on_mHeightSpinBox_valueChanged)
        self.connect(self.mWidthSpinBox, QtCore.SIGNAL("valueChanged( int )"),
                     self.on_mWidthSpinBox_valueChanged)
        self.connect(self.mHeightSpinBox, QtCore.SIGNAL("valueChanged( int )"),
                     self.on_mHeightSpinBox_valueChanged)
        self.connect(self.mResolutionSpinBox,
                     QtCore.SIGNAL("valueChanged( int )"),
                     self.on_mResolutionSpinBox_valueChanged)

        settings = QtCore.QSettings()
        self.restoreGeometry(
            settings.value("/Windows/ComposerImageExportOptionsDialog/geometry"
                           ).toByteArray())

    def retranslateUi(self):
        self.setWindowTitle(_translate("self", "Image export options", None))
        self.groupBox.setTitle(_translate("self", "Export options", None))
        self.label_9.setText(_translate("self", "Export resolution", None))
        self.label_13.setText(_translate("self", "Page height", None))
        self.mResolutionSpinBox.setSuffix(_translate("self", " dpi", None))
        self.mWidthSpinBox.setSpecialValueText(_translate(
            "self", "Auto", None))
        self.mWidthSpinBox.setSuffix(_translate("self", " px", None))
        self.label_10.setText(_translate("self", "Page width", None))
        self.mHeightSpinBox.setSpecialValueText(
            _translate("self", "Auto", None))
        self.mHeightSpinBox.setSuffix(_translate("self", " px", None))
        self.mClipToContentGroupBox.setTitle(
            _translate("self", "Crop to content", None))
        self.label_5.setText(_translate("self", "Left", None))
        self.mLeftMarginSpinBox.setSuffix(_translate("self", " px", None))
        self.label_11.setText(_translate("self", "Right", None))
        self.mRightMarginSpinBox.setSuffix(_translate("self", " px", None))
        self.label_12.setText(_translate("self", "Bottom", None))
        self.label_4.setText(_translate("self", "Top margin", None))
        self.mTopMarginSpinBox.setSuffix(_translate("self", " px", None))
        self.mBottomMarginSpinBox.setSuffix(_translate("self", " px", None))

    def setResolution(self, resolution):
        self.mResolutionSpinBox.setValue(resolution)

        if (self.mImageSize.isValid()):
            self.mWidthSpinBox.blockSignals(True)
            self.mHeightSpinBox.blockSignals(True)
            if (self.mClipToContentGroupBox.isChecked()):
                self.mWidthSpinBox.setValue(0)
                self.mHeightSpinBox.setValue(0)
            else:
                self.mWidthSpinBox.setValue(self.mImageSize.width() *
                                            resolution / 25.4)
                self.mHeightSpinBox.setValue(self.mImageSize.height() *
                                             resolution / 25.4)
            self.mWidthSpinBox.blockSignals(False)
            self.mHeightSpinBox.blockSignals(False)

    def resolution(self):
        return self.mResolutionSpinBox.value()

    def setImageSize(self, size):
        self.mImageSize = size
        self.mWidthSpinBox.blockSignals(True)
        self.mHeightSpinBox.blockSignals(True)
        self.mWidthSpinBox.setValue(size.width() *
                                    self.mResolutionSpinBox.value() / 25.4)
        self.mHeightSpinBox.setValue(size.height() *
                                     self.mResolutionSpinBox.value() / 25.4)
        self.mWidthSpinBox.blockSignals(False)
        self.mHeightSpinBox.blockSignals(False)

    def imageWidth(self):
        return self.mWidthSpinBox.value()

    def imageHeight(self):
        return self.mHeightSpinBox.value()

    def setCropToContents(self, crop):
        self.mClipToContentGroupBox.setChecked(crop)

    def cropToContents(self):
        return self.mClipToContentGroupBox.isChecked()

    def getCropMargins(self):
        topMargin = self.mTopMarginSpinBox.value()
        rightMargin = self.mRightMarginSpinBox.value()
        bottomMargin = self.mBottomMarginSpinBox.value()
        leftMargin = self.mLeftMarginSpinBox.value()
        return topMargin, rightMargin, bottomMargin, leftMargin

    def setCropMargins(self, topMargin, rightMargin, bottomMargin, leftMargin):
        self.mTopMarginSpinBox.setValue(topMargin)
        self.mRightMarginSpinBox.setValue(rightMargin)
        self.mBottomMarginSpinBox.setValue(bottomMargin)
        self.mLeftMarginSpinBox.setValue(leftMargin)

    def on_mWidthSpinBox_valueChanged(self, value):
        self.mHeightSpinBox.blockSignals(True)
        self.mResolutionSpinBox.blockSignals(True)
        self.mHeightSpinBox.setValue(self.mImageSize.height() *
                                     self.mWidthSpinBox.value() /
                                     self.mImageSize.width())
        self.mResolutionSpinBox.setValue(self.mWidthSpinBox.value() * 25.4 /
                                         self.mImageSize.width())
        self.mHeightSpinBox.blockSignals(False)
        self.mResolutionSpinBox.blockSignals(False)

    def on_mHeightSpinBox_valueChanged(self, value):
        self.mWidthSpinBox.blockSignals(True)
        self.mResolutionSpinBox.blockSignals(True)
        self.mWidthSpinBox.setValue(self.mImageSize.width() *
                                    self.mHeightSpinBox.value() /
                                    self.mImageSize.height())
        self.mResolutionSpinBox.setValue(self.mHeightSpinBox.value() * 25.4 /
                                         self.mImageSize.height())
        self.mWidthSpinBox.blockSignals(False)
        self.mResolutionSpinBox.blockSignals(False)

    def on_mResolutionSpinBox_valueChanged(self, value):
        self.mWidthSpinBox.blockSignals(True)
        self.mHeightSpinBox.blockSignals(True)
        if (self.mClipToContentGroupBox.isChecked()):
            self.mWidthSpinBox.setValue(0)
            self.mHeightSpinBox.setValue(0)
        else:
            self.mWidthSpinBox.setValue(self.mImageSize.width() *
                                        self.mResolutionSpinBox.value() / 25.4)
            self.mHeightSpinBox.setValue(self.mImageSize.height() *
                                         self.mResolutionSpinBox.value() /
                                         25.4)
        self.mWidthSpinBox.blockSignals(False)
        self.mHeightSpinBox.blockSignals(False)

    def clipToContentsToggled(self, state):
        self.mWidthSpinBox.setEnabled(not state)
        self.mHeightSpinBox.setEnabled(not state)

        if (state):
            self.mWidthSpinBox.blockSignals(True)
            self.mWidthSpinBox.setValue(0)
            self.mWidthSpinBox.blockSignals(False)
            self.mHeightSpinBox.blockSignals(True)
            self.mHeightSpinBox.setValue(0)
            self.mHeightSpinBox.blockSignals(False)
        else:
            self.mWidthSpinBox.blockSignals(True)
            self.mWidthSpinBox.setValue(self.mImageSize.width() *
                                        self.mResolutionSpinBox.value() / 25.4)
            self.mWidthSpinBox.blockSignals(False)
            self.mHeightSpinBox.blockSignals(True)
            self.mHeightSpinBox.setValue(self.mImageSize.height() *
                                         self.mResolutionSpinBox.value() /
                                         25.4)
            self.mHeightSpinBox.blockSignals(False)