from PyQt import QtCore, QtGui
from qgis.core import *
from qgis.gui import *

class Ui_RUSLE(object):
    
    def setupUi(self, RUSLE_window):
        
        # create RUSLE window
        RUSLE_window.setWindowModality(QtCore.Qt.ApplicationModal)
        RUSLE_window.resize(450,400)
        
        # input file
        # create gridLayout
        self.gridLayout1 = QGridLayout(RUSLE_window)
        self.gridLayout1.setObjectName("gridLayout1")
        # group box to input files
        self.groupBox = QGroupBox(RUSLE_window)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout2 = QGridLayout(self.groupBox)
        self.gridLayout2.setObjectName("gridLayout2")
        self.gridLayout1.addWidget(self.groupBox,0,0,1,-1)        
        # create label in gridLayout 
        self.label = QLabel(RUSLE_window)
        self.label.setObjectName("label")  
        self.label2 = QLabel(RUSLE_window)
        self.label2.setObjectName("label2")  
        self.label3 = QLabel(RUSLE_window)
        self.label3.setObjectName("label3")  
        self.label4 = QLabel(RUSLE_window)
        self.label4.setObjectName("label4")  
        self.label5 = QLabel(RUSLE_window)
        self.label5.setObjectName("label5")           
        # define label (QWidget, row, column, QtAlignement)
        self.gridLayout2.addWidget(self.label,0,0,1,1)
        self.gridLayout2.addWidget(self.label2,1,0,1,1)
        self.gridLayout2.addWidget(self.label3,2,0,1,1)
        self.gridLayout2.addWidget(self.label4,3,0,1,1)
        self.gridLayout2.addWidget(self.label5,4,0,1,1)
       
        # create select button to input file
        self.selectButton = QPushButton(RUSLE_window)
        self.selectButton.setObjectName("selectButton")
        self.selectButton2 = QPushButton(RUSLE_window)
        self.selectButton2.setObjectName("selectButton2")    
        self.selectButton3 = QPushButton(RUSLE_window)
        self.selectButton3.setObjectName("selectButton3")  
        self.selectButton4 = QPushButton(RUSLE_window)
        self.selectButton4.setObjectName("selectButton4")  
        self.selectButton5 = QPushButton(RUSLE_window)
        self.selectButton5.setObjectName("selectButton5")    
        
        self.inputLayerCombo = QComboBox(RUSLE_window)
        self.inputLayerCombo.setObjectName("inputLayerCombo")  
        self.inputLayerCombo2 = QComboBox(RUSLE_window)
        self.inputLayerCombo2.setObjectName("inputLayerCombo2")  
        self.inputLayerCombo3 = QComboBox(RUSLE_window)
        self.inputLayerCombo3.setObjectName("inputLayerCombo3")  
        self.inputLayerCombo4 = QComboBox(RUSLE_window)
        self.inputLayerCombo4.setObjectName("inputLayerCombo4")   
        self.inputLayerCombo5 = QComboBox(RUSLE_window)
        self.inputLayerCombo5.setObjectName("inputLayerCombo5")          
        self.gridLayout2.addWidget(self.inputLayerCombo,0,1,1,1)
        self.gridLayout2.addWidget(self.inputLayerCombo2,1,1,1,1)
        self.gridLayout2.addWidget(self.inputLayerCombo3,2,1,1,1)
        self.gridLayout2.addWidget(self.inputLayerCombo4,3,1,1,1)
        self.gridLayout2.addWidget(self.inputLayerCombo5,4,1,1,1)
        # stretch to extend the widget in column 1
        self.gridLayout2.setColumnStretch(1,1)  
        
        self.gridLayout2.addWidget(self.selectButton,0,2,1,1)
        self.gridLayout2.addWidget(self.selectButton2,1,2,1,1)
        self.gridLayout2.addWidget(self.selectButton3,2,2,1,1)
        self.gridLayout2.addWidget(self.selectButton4,3,2,1,1)
        self.gridLayout2.addWidget(self.selectButton5,4,2,1,1)
        
        

        # output file
        # group box to output files
        self.groupBox2 = QGroupBox(RUSLE_window)
        self.groupBox2.setObjectName("groupBox2")
        self.gridLayout3 = QGridLayout(self.groupBox2)
        self.gridLayout3.setObjectName("gridLayout3")
        self.gridLayout1.addWidget(self.groupBox2,1,0,1,-1)        
        # create label in gridLayout
        self.label_out = QLabel(RUSLE_window)
        self.label_out.setObjectName("label_out")
        # define label (QWidget, row, column, QtAlignement)
        self.gridLayout3.addWidget(self.label_out,0,0,1,1)
        # create select button to output file
        self.selectButton_out = QPushButton(RUSLE_window)
        self.selectButton_out.setObjectName("selectButton_out")
        self.gridLayout3.addWidget(self.selectButton_out,0,2,1,1)
        self.outputLayerCombo = QLineEdit(RUSLE_window)
        self.outputLayerCombo.setObjectName("outputLayerCombo")
        self.gridLayout3.addWidget(self.outputLayerCombo, 0,1,1,1)
        
        # button Ok, Close and Help
        self.buttonBox = QDialogButtonBox(RUSLE_window)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Help|QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout1.addWidget(self.buttonBox, 2, 1, 1, 1)          
        
        self.retranslateUi(RUSLE_window)
        self.buttonBox.rejected.connect(RUSLE_window.close)
    
    def retranslateUi(self, RUSLE_window):
        RUSLE_window.setWindowTitle('RUSLE', 'RUSLE')   
        self.label.setText('RUSLE', 'R')
        self.label2.setText('RUSLE', 'U')
        self.label3.setText('RUSLE', 'S')
        self.label4.setText('RUSLE', 'L')
        self.label5.setText('RUSLE', 'E')
        self.selectButton.setText('RUSLE', 'Browse')   
        self.selectButton2.setText('RUSLE', 'Browse')
        self.selectButton3.setText('RUSLE', 'Browse')
        self.selectButton4.setText('RUSLE', 'Browse')
        self.selectButton5.setText('RUSLE', 'Browse')
        self.selectButton_out.setText('RUSLE', 'Browse')
        self.label_out.setText('RUSLE', 'RUSLE:')
        self.groupBox.setTitle("RUSLE", "Input")
        self.groupBox2.setTitle("RUSLE", "Output")
       
       
      
        
        
        