mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-05 11:24:15 +00:00
Remove button to change save path from lower panel
This commit is contained in:
parent
dfe5fbe34c
commit
cfb4ded943
@ -245,7 +245,6 @@ void PropertiesWidget::loadTorrentInfos(const QTorrentHandle &_h) {
|
|||||||
try {
|
try {
|
||||||
// Save path
|
// Save path
|
||||||
updateSavePath(h);
|
updateSavePath(h);
|
||||||
changeSavePathButton->setEnabled(h.has_metadata());
|
|
||||||
// Hash
|
// Hash
|
||||||
hash_lbl->setText(h.hash());
|
hash_lbl->setText(h.hash());
|
||||||
PropListModel->model()->clear();
|
PropListModel->model()->clear();
|
||||||
@ -662,56 +661,6 @@ bool PropertiesWidget::applyPriorities() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PropertiesWidget::on_changeSavePathButton_clicked() {
|
|
||||||
if (!h.is_valid()) return;
|
|
||||||
QString new_path;
|
|
||||||
if (h.has_metadata() && h.num_files() == 1) {
|
|
||||||
new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath());
|
|
||||||
} else {
|
|
||||||
const QDir saveDir(TorrentPersistentData::getSavePath(h.hash()));
|
|
||||||
new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(),
|
|
||||||
QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails);
|
|
||||||
}
|
|
||||||
if (!new_path.isEmpty()) {
|
|
||||||
// Check if savePath exists
|
|
||||||
QString save_path_dir = new_path.replace("\\", "/");
|
|
||||||
QString new_file_name;
|
|
||||||
if (h.has_metadata() && h.num_files() == 1) {
|
|
||||||
save_path_dir = fsutils::branchPath(save_path_dir, &new_file_name); // Skip file name
|
|
||||||
}
|
|
||||||
QDir savePath(fsutils::expandPath(save_path_dir));
|
|
||||||
// Actually move storage
|
|
||||||
if (!QBtSession::instance()->useTemporaryFolder() || h.is_seed()) {
|
|
||||||
if (!savePath.exists()) savePath.mkpath(savePath.absolutePath());
|
|
||||||
h.move_storage(savePath.absolutePath());
|
|
||||||
}
|
|
||||||
// Update save_path in dialog
|
|
||||||
QString display_path;
|
|
||||||
if (h.has_metadata() && h.num_files() == 1) {
|
|
||||||
// Rename the file
|
|
||||||
Q_ASSERT(!new_file_name.isEmpty());
|
|
||||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
|
||||||
if (h.filename_at(0).compare(new_file_name, Qt::CaseInsensitive) != 0) {
|
|
||||||
#else
|
|
||||||
if (h.filename_at(0).compare(new_file_name, Qt::CaseSensitive) != 0) {
|
|
||||||
#endif
|
|
||||||
qDebug("Renaming single file to %s", qPrintable(new_file_name));
|
|
||||||
h.rename_file(0, new_file_name);
|
|
||||||
// Also rename it in the files list model
|
|
||||||
PropListModel->setData(PropListModel->index(0, 0), new_file_name);
|
|
||||||
}
|
|
||||||
display_path = h.firstFileSavePath();
|
|
||||||
} else {
|
|
||||||
display_path = savePath.absolutePath();
|
|
||||||
}
|
|
||||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
|
||||||
display_path.replace("/", "\\");
|
|
||||||
#endif
|
|
||||||
save_path->setText(display_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PropertiesWidget::filteredFilesChanged() {
|
void PropertiesWidget::filteredFilesChanged() {
|
||||||
if (h.is_valid()) {
|
if (h.is_valid()) {
|
||||||
applyPriorities();
|
applyPriorities();
|
||||||
|
@ -79,7 +79,6 @@ protected slots:
|
|||||||
void askWebSeed();
|
void askWebSeed();
|
||||||
void deleteSelectedUrlSeeds();
|
void deleteSelectedUrlSeeds();
|
||||||
void displayFilesListMenu(const QPoint& pos);
|
void displayFilesListMenu(const QPoint& pos);
|
||||||
void on_changeSavePathButton_clicked();
|
|
||||||
void filteredFilesChanged();
|
void filteredFilesChanged();
|
||||||
void showPiecesDownloaded(bool show);
|
void showPiecesDownloaded(bool show);
|
||||||
void showPiecesAvailability(bool show);
|
void showPiecesAvailability(bool show);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>551</width>
|
<width>551</width>
|
||||||
<height>274</height>
|
<height>452</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -49,8 +49,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>534</width>
|
<width>549</width>
|
||||||
<height>451</height>
|
<height>447</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
@ -365,22 +365,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="changeSavePathButton">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>22</width>
|
|
||||||
<height>15</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">...</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_4">
|
<spacer name="horizontalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -548,22 +532,6 @@
|
|||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextBrowser" name="comment_text">
|
<widget class="QTextBrowser" name="comment_text">
|
||||||
<property name="html">
|
|
||||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'Lucida Grande'; font-size:8pt; font-weight:400; font-style:normal;">
|
|
||||||
<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;">
|
|
||||||
<tr>
|
|
||||||
<td style="border: none;">
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Cantarell';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p>
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p></td></tr></table></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user