mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 12:59:56 -07:00
Merge pull request #786 from Gelmir/inputDlg_autoexpand
Resize input dialogs to fit contents
This commit is contained in:
commit
4cd4ad457b
15 changed files with 338 additions and 40 deletions
|
@ -33,7 +33,6 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QTimer>
|
||||
#include <QClipboard>
|
||||
#include <QInputDialog>
|
||||
#include <QColor>
|
||||
#include <QUrl>
|
||||
#include <QMenu>
|
||||
|
@ -61,6 +60,7 @@
|
|||
#include "qinisettings.h"
|
||||
#include "iconprovider.h"
|
||||
#include "fs_utils.h"
|
||||
#include "autoexpandabledialog.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
|
@ -607,7 +607,7 @@ void TransferListWidget::askNewLabelForSelection() {
|
|||
bool invalid;
|
||||
do {
|
||||
invalid = false;
|
||||
const QString label = QInputDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, "", &ok).trimmed();
|
||||
const QString label = AutoExpandableDialog::getText(this, tr("New Label"), tr("Label:"), QLineEdit::Normal, "", &ok).trimmed();
|
||||
if (ok && !label.isEmpty()) {
|
||||
if (fsutils::isValidFileSystemName(label)) {
|
||||
setSelectionLabel(label);
|
||||
|
@ -629,7 +629,7 @@ void TransferListWidget::renameSelectedTorrent() {
|
|||
if (!h.is_valid()) return;
|
||||
// Ask for a new Name
|
||||
bool ok;
|
||||
QString name = QInputDialog::getText(this, tr("Rename"), tr("New name:"), QLineEdit::Normal, h.name(), &ok);
|
||||
QString name = AutoExpandableDialog::getText(this, tr("Rename"), tr("New name:"), QLineEdit::Normal, h.name(), &ok);
|
||||
if (ok && !name.isEmpty()) {
|
||||
name.replace(QRegExp("\r?\n|\r"), " ");
|
||||
// Rename the torrent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue