|
|
@ -256,6 +256,8 @@ void AddNewTorrentDialog::showEvent(QShowEvent *event) |
|
|
|
|
|
|
|
|
|
|
|
void AddNewTorrentDialog::showAdvancedSettings(bool show) |
|
|
|
void AddNewTorrentDialog::showAdvancedSettings(bool show) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
const int minimumW = minimumWidth(); |
|
|
|
|
|
|
|
setMinimumWidth(width()); // to remain the same width
|
|
|
|
if (show) { |
|
|
|
if (show) { |
|
|
|
ui->adv_button->setText(QString::fromUtf8(C_UP)); |
|
|
|
ui->adv_button->setText(QString::fromUtf8(C_UP)); |
|
|
|
ui->settings_group->setVisible(true); |
|
|
|
ui->settings_group->setVisible(true); |
|
|
@ -274,7 +276,8 @@ void AddNewTorrentDialog::showAdvancedSettings(bool show) |
|
|
|
ui->infoGroup->setVisible(false); |
|
|
|
ui->infoGroup->setVisible(false); |
|
|
|
ui->buttonsHLayout->insertWidget(0, layout()->takeAt(layout()->indexOf(ui->never_show_cb) + 1)->widget()); |
|
|
|
ui->buttonsHLayout->insertWidget(0, layout()->takeAt(layout()->indexOf(ui->never_show_cb) + 1)->widget()); |
|
|
|
} |
|
|
|
} |
|
|
|
relayout(); |
|
|
|
adjustSize(); |
|
|
|
|
|
|
|
setMinimumWidth(minimumW); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AddNewTorrentDialog::saveSavePathHistory() const |
|
|
|
void AddNewTorrentDialog::saveSavePathHistory() const |
|
|
@ -347,7 +350,6 @@ void AddNewTorrentDialog::onSavePathChanged(int index) |
|
|
|
// Toggle default save path setting checkbox visibility
|
|
|
|
// Toggle default save path setting checkbox visibility
|
|
|
|
ui->default_save_path_cb->setChecked(false); |
|
|
|
ui->default_save_path_cb->setChecked(false); |
|
|
|
ui->default_save_path_cb->setVisible(QDir(ui->save_path_combo->itemData(ui->save_path_combo->currentIndex()).toString()) != QDir(Preferences::instance()->getSavePath())); |
|
|
|
ui->default_save_path_cb->setVisible(QDir(ui->save_path_combo->itemData(ui->save_path_combo->currentIndex()).toString()) != QDir(Preferences::instance()->getSavePath())); |
|
|
|
relayout(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remember index
|
|
|
|
// Remember index
|
|
|
|
m_oldIndex = index; |
|
|
|
m_oldIndex = index; |
|
|
@ -404,15 +406,6 @@ void AddNewTorrentDialog::browseButton_clicked() |
|
|
|
connect(ui->save_path_combo, SIGNAL(currentIndexChanged(int)), SLOT(onSavePathChanged(int))); |
|
|
|
connect(ui->save_path_combo, SIGNAL(currentIndexChanged(int)), SLOT(onSavePathChanged(int))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AddNewTorrentDialog::relayout() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
qApp->processEvents(); |
|
|
|
|
|
|
|
int min_width = minimumWidth(); |
|
|
|
|
|
|
|
setMinimumWidth(width()); |
|
|
|
|
|
|
|
adjustSize(); |
|
|
|
|
|
|
|
setMinimumWidth(min_width); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddNewTorrentDialog::renameSelectedFile() |
|
|
|
void AddNewTorrentDialog::renameSelectedFile() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const QModelIndexList selectedIndexes = ui->content_tree->selectionModel()->selectedRows(0); |
|
|
|
const QModelIndexList selectedIndexes = ui->content_tree->selectionModel()->selectedRows(0); |
|
|
|