|
|
@ -112,7 +112,7 @@ public: |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
// Restore size and position
|
|
|
|
// Restore size and position
|
|
|
|
resize(settings.value(QString::fromUtf8("TorrentAdditionDlg/size"), size()).toSize()); |
|
|
|
resize(settings.value(QString::fromUtf8("TorrentAdditionDlg/size"), size()).toSize()); |
|
|
|
move(settings.value(QString::fromUtf8("TorrentAdditionDlg/pos"), screenCenter()).toPoint()); |
|
|
|
move(settings.value(QString::fromUtf8("TorrentAdditionDlg/pos"), misc::screenCenter(this)).toPoint()); |
|
|
|
// Restore column width
|
|
|
|
// Restore column width
|
|
|
|
QVariantList contentColsWidths = settings.value(QString::fromUtf8("TorrentAdditionDlg/filesColsWidth"), QVariantList()).toList(); |
|
|
|
QVariantList contentColsWidths = settings.value(QString::fromUtf8("TorrentAdditionDlg/filesColsWidth"), QVariantList()).toList(); |
|
|
|
if(contentColsWidths.empty()) { |
|
|
|
if(contentColsWidths.empty()) { |
|
|
@ -124,22 +124,6 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Screen center point
|
|
|
|
|
|
|
|
QPoint screenCenter() const{ |
|
|
|
|
|
|
|
int scrn = 0; |
|
|
|
|
|
|
|
QWidget *w = this->topLevelWidget(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(w) |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(w); |
|
|
|
|
|
|
|
else if(QApplication::desktop()->isVirtualDesktop()) |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(QCursor::pos()); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QRect desk(QApplication::desktop()->availableGeometry(scrn)); |
|
|
|
|
|
|
|
return QPoint((desk.width() - this->frameGeometry().width()) / 2, (desk.height() - this->frameGeometry().height()) / 2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void saveSettings() { |
|
|
|
void saveSettings() { |
|
|
|
if(is_magnet) return; |
|
|
|
if(is_magnet) return; |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|