예제 #1
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        load_ui('KeyRequest.ui', self)

        self.pushButton_cancel.clicked.connect(self.reject)
        self.pushButton_ok.clicked.connect(self.accept)
예제 #2
0
    def __init__(self, **kwargs):
        super(MainWindow, self).__init__(**kwargs)

        load_ui('MainWindow.ui', self)
        self.setWindowTitle('Picup - {}'.format(__version__))

        apikey = get_api_key(self)
        self.upload_in_progress = False
        self.upload_thread = QThread()
        self.upload = Upload(apikey=apikey)
        self.upload_thread.start()
        self.upload.moveToThread(self.upload_thread.thread())

        self.listView_files_model = FileListModel()
        self.listView_files.setModel(self.listView_files_model)

        self.pushButton_close.clicked.connect(self.close)
        self.pushButton_add_picture.clicked.connect(self.add_file)
        self.pushButton_upload.clicked.connect(self.start_upload)
        self.pushButton_clear_list.clicked.connect(
                                        self.listView_files_model.clear_list)
        self.pushButton_remove_selected.clicked.connect(self.remove_selected)

        self.upload.upload_finished.connect(self.upload_finished)
        self.upload.upload_error.connect(self.handle_error)

        self.upload_pictures.connect(self.upload.upload_multiple)

        self.dialog = QFileDialog(parent=self)
        self.dialog.setFileMode(QFileDialog.ExistingFiles)
        self.dialog.setNameFilters(SUPPORTED_FILE_TYPES)
예제 #3
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        load_ui('MainWindow.ui', self)
        self.setWindowTitle('Picup - {}'.format(__version__))

        apikey = get_api_key()
        if not apikey:
            apikey = self.request_api_key()

        self.legal_resize = True
        self.upload_in_progress = False
        self.upload_thread = QThread(parent=self)
        self.upload = Upload(apikey=apikey)
        self.upload_thread.start()
        self.upload.moveToThread(self.upload_thread)


        self.list_view_files_model = FileListModel(parent=self)
        self.list_view_files.setModel(self.list_view_files_model)

        self.pushButton_close.clicked.connect(self.shutdown)
        self.pushButton_add_picture.clicked.connect(self.add_file)
        self.pushButton_add_links.clicked.connect(self.add_url)
        self.pushButton_upload.clicked.connect(self.start_upload)
        self.pushButton_clear_list.clicked.connect(
                self.list_view_files_model.clear_list)
        self.pushButton_remove_selected.clicked.connect(self.remove_selected)

        self.upload.upload_finished.connect(self.upload_finished)
        self.upload.upload_error.connect(self.handle_error)

        self.upload_pictures.connect(self.upload.upload_multiple)

        self.dialog = QFileDialog(parent=self)
        self.dialog.setFileMode(QFileDialog.ExistingFiles)
        self.dialog.setNameFilters(SUPPORTED_FILE_TYPES)

        self.resize_container.hide()
        self.resize_container_percentual.hide()
        self.check_box_resize.clicked.connect(
                self.set_resize_box_visibility
                )
        self.radio_button_absolute.toggled.connect(
                self.set_absolute_resize_box_visibility
                )
        self.radio_button_percentual.toggled.connect(
                self.set_percentual_resize_box_visibility
                )
        self.spin_box_width.valueChanged.connect(self.update_resize)
        self.spin_box_higth.valueChanged.connect(self.update_resize)
        self.spin_box_percentual.valueChanged.connect(self.update_resize)
        self.comboBox_rotate_options.activated['QString'].connect(
                self.upload.change_default_rotation
                )
        self.checkBox_delete_exif.toggled.connect(
                self.upload.change_default_exif
                )

        self.comboBox_rotate_options.addItems(ALLOWED_ROTATION)
예제 #4
0
    def __init__(self, **kwargs):
        super(KeyRequest, self).__init__(**kwargs)

        load_ui('KeyRequest.ui', self)

        self.pushButton_cancel.clicked.connect(self.reject)
        self.pushButton_ok.clicked.connect(self.accept)
예제 #5
0
    def __init__(self, upload_thread, amount_links, **kwargs):
        super(ShowLinks, self).__init__(**kwargs)
        load_ui('LinkDialog.ui', self)

        self.entrys = []
        self.upload_thread = upload_thread
        self.central_widget = QWidget(self)
        self.scrollArea.setWidget(self.central_widget)
        self.progressBar_upload.setMaximum(amount_links)
        self.scroll_area_layout = QVBoxLayout()
        self.central_widget.setLayout(self.scroll_area_layout)
        self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.upload_thread.picture_uploaded.connect(self.add_entry)
        self.upload_thread.upload_finished.connect(self.upload_finished)
예제 #6
0
    def __init__(self, upload_thread, amount_links, **kwargs):
        super(ShowLinks, self).__init__(**kwargs)
        load_ui('LinkDialog.ui', self)

        self.entrys = []
        self.upload_thread = upload_thread
        self.central_widget = QWidget(self)
        self.scrollArea.setWidget(self.central_widget)
        self.progressBar_upload.setMaximum(amount_links)
        self.scroll_area_layout = QVBoxLayout()
        self.central_widget.setLayout(self.scroll_area_layout)
        self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.upload_thread.picture_uploaded.connect(self.add_entry)
        self.upload_thread.upload_finished.connect(self.upload_finished)
예제 #7
0
파일: show_links.py 프로젝트: Arvedui/picup
    def __init__(self, upload_thread, amount_links, **kwargs):
        super().__init__(**kwargs)
        load_ui('LinkDialog.ui', self)

        self.linkmodel = LinkListModel()
        self.listView_links.setModel(self.linkmodel)
        self.clipboard = QApplication.clipboard()

        self.upload_thread = upload_thread
        self.central_widget = QWidget(self)
        self.scrollArea.setWidget(self.central_widget)
        self.progressBar_upload.setMaximum(amount_links)
        self.scroll_area_layout = QVBoxLayout()
        self.central_widget.setLayout(self.scroll_area_layout)
        self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.upload_thread.picture_uploaded.connect(self.add_entry)
        self.upload_thread.upload_finished.connect(self.upload_finished)
        self.comboBox_link_output.activated['QString'].connect(
                self.linkmodel.set_linktype)
        self.pushButton_to_clipboard.clicked.connect(self.copy_to_clipboard)
        self.pushButton_to_file.clicked.connect(self.copy_to_file)

        self.comboBox_link_output.addItems(LINKTYPE_ORDER)
예제 #8
0
파일: url_input.py 프로젝트: Arvedui/picup
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        load_ui('link_input.ui', self)

        self.buttonBox.rejected.connect(self.reject)
        self.buttonBox.accepted.connect(self.accept)