예제 #1
0
void Window::dropEvent(QDropEvent *event) {
    if (event->mimeData()->hasUrls() && event->mimeData()->urls().size() > 0) {
        for(int i = 0; i < event->mimeData()->urls().size(); ++i)
            UploadList::add(event->mimeData()->urls().at(i).toLocalFile());
        UploadingsReceived();
    }
    event->acceptProposedAction();
}
예제 #2
0
TabWidget::TabWidget(QWidget *parent) :
    QTabWidget(parent),
    m_ui(new Ui::TabWidget)
{
    m_ui->setupUi(this);
    connect(m_ui->pushButton_upload, SIGNAL(clicked()), this, SLOT(uploadDialog()));
    connect(m_ui->pushButton_clear, SIGNAL(clicked()), this, SLOT(clearTableView()));
    uploadings_model = new QStandardItemModel(0,2);
    m_ui->tableView->setModel(uploadings_model);
    connect(m_ui->pushButton_control, SIGNAL(clicked()), this, SLOT(controlUpload()));
    suffixes << "B" << "KB" << "MB" << "GB" << "TB" << "PB";
    loadOptions();
    connect(&Listener::instance(), SIGNAL(UploadingsReceived()), this, SLOT(newUpload()));
    connect(&Window::instance(), SIGNAL(UploadingsReceived()), this, SLOT(newUpload()));
    connect(m_ui->checkBox_api, SIGNAL(stateChanged(int)), this, SLOT(toggleApiKey(int)));
    connect(m_ui->lineEdit_api,SIGNAL(editingFinished()), this, SLOT(updateApiKey()));
    connect(m_ui->checkBox_systemtray, SIGNAL(stateChanged(int)), this, SLOT(toggleSystemTray(int)));
    newUpload();
}