예제 #1
0
 def on_right(self, new_right):
     """
     Slot for the new right coordinate
     :param new_right: The new right coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_right) and (self.right is None or float(self.right) != float(new_right)):
         self.right = new_right
         self.draw_new_rect()
예제 #2
0
 def on_bottom(self, new_bottom):
     """
     Slot for the new bottom coordinate
     :param new_bottom: The new bottom coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_bottom) and (self.bottom is None or float(self.bottom) != float(new_bottom)):
         self.bottom = new_bottom
         self.draw_new_rect()
예제 #3
0
 def on_top(self, new_top):
     """
     Slot for new top coordinates
     :param new_top: The new top coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_top) and (self.top is None or float(self.top) != float(new_top)):
         self.top = new_top
         self.draw_new_rect()
예제 #4
0
 def on_right(self, new_right):
     """
     Slot for the new right coordinate
     :param new_right: The new right coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_right) and (
             self.right is None or float(self.right) != float(new_right)):
         self.right = new_right
         self.draw_new_rect()
예제 #5
0
 def on_top(self, new_top):
     """
     Slot for new top coordinates
     :param new_top: The new top coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_top) and (
             self.top is None or float(self.top) != float(new_top)):
         self.top = new_top
         self.draw_new_rect()
예제 #6
0
 def on_bottom(self, new_bottom):
     """
     Slot for the new bottom coordinate
     :param new_bottom: The new bottom coordinate
     :return: None
     """
     if InfoCubeProcessForm.validate_is_float(new_bottom) and (
             self.bottom is None
             or float(self.bottom) != float(new_bottom)):
         self.bottom = new_bottom
         self.draw_new_rect()
예제 #7
0
 def draw_new_rect(self):
     """
     Redraws the rectangle when the coordinates are changed manually
     :return: None
     """
     # all points must be valid
     if not InfoCubeProcessForm.validate_bbox_fields(self.left, self.right, self.top, self.bottom, []):
         return
     # convert points from wgs84
     x_upper_left = self.transform_point_from_wgs_84(float(self.left), float(self.top))
     x_lower_right = self.transform_point_from_wgs_84(float(self.right), float(self.bottom))
     self.show_rect(x_upper_left, x_lower_right)
예제 #8
0
 def draw_new_rect(self):
     """
     Redraws the rectangle when the coordinates are changed manually
     :return: None
     """
     # all points must be valid
     if not InfoCubeProcessForm.validate_bbox_fields(
             self.left, self.right, self.top, self.bottom, []):
         return
     # convert points from wgs84
     x_upper_left = self.transform_point_from_wgs_84(
         float(self.left), float(self.top))
     x_lower_right = self.transform_point_from_wgs_84(
         float(self.right), float(self.bottom))
     self.show_rect(x_upper_left, x_lower_right)
예제 #9
0
    def setupUi(self, dialog):
        dialog.setObjectName(_fromUtf8("DGConnect"))
        dialog.resize(918, 221)

        self.dialog = dialog
        
        self.formLayout = QtGui.QFormLayout(dialog)
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.username_label = QtGui.QLabel(dialog)
        self.username_label.setObjectName(_fromUtf8("username_label"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.username_label)
        self.username = QtGui.QLineEdit(dialog)
        self.username.setObjectName(_fromUtf8("username"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.username)
        self.password_label = QtGui.QLabel(dialog)
        self.password_label.setObjectName(_fromUtf8("password_label"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.password_label)
        self.password = QtGui.QLineEdit(dialog)
        self.password.setEchoMode(QtGui.QLineEdit.Password)
        self.password.setObjectName(_fromUtf8("password"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.password)
        self.client_id_label = QtGui.QLabel(dialog)
        self.client_id_label.setObjectName(_fromUtf8("client_id_label"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.client_id_label)
        self.client_id = QtGui.QLineEdit(dialog)
        self.client_id.setObjectName(_fromUtf8("client_id"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.client_id)
        self.client_secret_label = QtGui.QLabel(dialog)
        self.client_secret_label.setObjectName(_fromUtf8("client_secret_label"))
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.client_secret_label)
        self.client_secret = QtGui.QLineEdit(dialog)
        self.client_secret.setEchoMode(QtGui.QLineEdit.Password)
        self.client_secret.setObjectName(_fromUtf8("client_secret"))
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.client_secret)
        self.select_file_layout = QtGui.QHBoxLayout()
        self.select_file_layout.setObjectName(_fromUtf8("select_file_layout"))
        self.select_file = QtGui.QLineEdit(dialog)
        self.select_file.setObjectName(_fromUtf8("select_file"))
        self.select_file_layout.addWidget(self.select_file)
        self.select_file_button = QtGui.QPushButton(dialog)
        self.select_file_button.setObjectName(_fromUtf8("select_file_button"))
        self.select_file_layout.addWidget(self.select_file_button)
        self.formLayout.setLayout(6, QtGui.QFormLayout.FieldRole, self.select_file_layout)
        self.settings_layout = QtGui.QHBoxLayout()
        self.settings_layout.setContentsMargins(-1, -1, 0, 0)
        self.settings_layout.setObjectName(_fromUtf8("settings_layout"))
        self.load_settings_button = QtGui.QPushButton(dialog)
        self.load_settings_button.setCheckable(False)
        self.load_settings_button.setObjectName(_fromUtf8("load_settings_button"))
        self.settings_layout.addWidget(self.load_settings_button)
        self.save_settings_button = QtGui.QPushButton(dialog)
        self.save_settings_button.setCheckable(False)
        self.save_settings_button.setObjectName(_fromUtf8("save_settings_button"))
        self.settings_layout.addWidget(self.save_settings_button)
        self.formLayout.setLayout(7, QtGui.QFormLayout.LabelRole, self.settings_layout)
        self.line = QtGui.QFrame(dialog)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.formLayout.setWidget(9, QtGui.QFormLayout.SpanningRole, self.line)
        self.bbox_layout = QtGui.QGridLayout()
        self.bbox_layout.setContentsMargins(-1, -1, -1, 0)
        self.bbox_layout.setHorizontalSpacing(6)
        self.bbox_layout.setObjectName(_fromUtf8("bbox_layout"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.bbox_layout.addItem(spacerItem, 0, 2, 1, 1)
        self.top_layout = QtGui.QHBoxLayout()
        self.top_layout.setContentsMargins(0, -1, -1, -1)
        self.top_layout.setObjectName(_fromUtf8("top_layout"))
        self.top_label = QtGui.QLabel(dialog)
        self.top_label.setObjectName(_fromUtf8("top_label"))
        self.top_layout.addWidget(self.top_label)
        self.top = QtGui.QLineEdit(dialog)
        self.top.setReadOnly(False)
        self.top.setObjectName(_fromUtf8("top"))
        self.top_layout.addWidget(self.top)
        self.bbox_layout.addLayout(self.top_layout, 0, 1, 1, 1)
        self.left_layout = QtGui.QHBoxLayout()
        self.left_layout.setContentsMargins(-1, -1, -1, 0)
        self.left_layout.setObjectName(_fromUtf8("left_layout"))
        self.left_label = QtGui.QLabel(dialog)
        self.left_label.setObjectName(_fromUtf8("left_label"))
        self.left_layout.addWidget(self.left_label)
        self.left = QtGui.QLineEdit(dialog)
        self.left.setReadOnly(False)
        self.left.setObjectName(_fromUtf8("left"))
        self.left_layout.addWidget(self.left)
        self.bbox_layout.addLayout(self.left_layout, 1, 0, 1, 1)
        self.right_layout = QtGui.QHBoxLayout()
        self.right_layout.setObjectName(_fromUtf8("right_layout"))
        self.right_label = QtGui.QLabel(dialog)
        self.right_label.setObjectName(_fromUtf8("right_label"))
        self.right_layout.addWidget(self.right_label)
        self.right = QtGui.QLineEdit(dialog)
        self.right.setReadOnly(False)
        self.right.setObjectName(_fromUtf8("right"))
        self.right_layout.addWidget(self.right)
        self.bbox_layout.addLayout(self.right_layout, 1, 2, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.bbox_layout.addItem(spacerItem1, 0, 0, 1, 1)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.bbox_layout.addItem(spacerItem2, 1, 1, 1, 1)
        self.bottom_layout = QtGui.QHBoxLayout()
        self.bottom_layout.setContentsMargins(-1, -1, -1, 0)
        self.bottom_layout.setObjectName(_fromUtf8("bottom_layout"))
        self.bottom_label = QtGui.QLabel(dialog)
        self.bottom_label.setObjectName(_fromUtf8("bottom_label"))
        self.bottom_layout.addWidget(self.bottom_label)
        self.bottom = QtGui.QLineEdit(dialog)
        self.bottom.setReadOnly(False)
        self.bottom.setObjectName(_fromUtf8("bottom"))
        self.bottom_layout.addWidget(self.bottom)
        self.bbox_layout.addLayout(self.bottom_layout, 2, 1, 1, 1)
        self.formLayout.setLayout(13, QtGui.QFormLayout.SpanningRole, self.bbox_layout)
        self.line_2 = QtGui.QFrame(dialog)
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.formLayout.setWidget(15, QtGui.QFormLayout.SpanningRole, self.line_2)
        self.yes_no_box = QtGui.QDialogButtonBox(dialog)
        self.yes_no_box.setOrientation(QtCore.Qt.Horizontal)
        self.yes_no_box.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.yes_no_box.setObjectName(_fromUtf8("yes_no_box"))
        self.formLayout.setWidget(16, QtGui.QFormLayout.FieldRole, self.yes_no_box)
        self.select_file_label = QtGui.QLabel(dialog)
        self.select_file_label.setObjectName(_fromUtf8("select_file_label"))
        self.formLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.select_file_label)
        self.username_label.setBuddy(self.username)
        self.password_label.setBuddy(self.password)
        self.client_id_label.setBuddy(self.client_id)
        self.client_secret_label.setBuddy(self.client_secret)
        self.top_label.setBuddy(self.top)
        self.left_label.setBuddy(self.left)
        self.right_label.setBuddy(self.right)
        self.bottom_label.setBuddy(self.bottom)
        self.select_file_label.setBuddy(self.select_file)

        self.retranslateUi(dialog)
        QtCore.QObject.connect(self.yes_no_box, QtCore.SIGNAL(_fromUtf8("accepted()")), dialog.accept)
        QtCore.QObject.connect(self.yes_no_box, QtCore.SIGNAL(_fromUtf8("rejected()")), dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(dialog)

        # set up handlers
        self.yes_no_box.accepted.connect(lambda: InfoCubeProcessForm.ok_clicked(self))
        self.yes_no_box.rejected.connect(lambda: InfoCubeProcessForm.cancel_clicked(self))
        self.save_settings_button.clicked.connect(lambda: InfoCubeProcessForm.save_settings_clicked(self))
        self.load_settings_button.clicked.connect(lambda: InfoCubeProcessForm.load_settings_clicked(self))
        self.select_file_button.clicked.connect(lambda: InfoCubeProcessForm.select_file_clicked(self))

        QtCore.QMetaObject.connectSlotsByName(dialog)

        InfoCubeProcessForm.load_settings(self)