From c8e95e00a320ed65b4968945f1006b047f51ea5f Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 5 Jun 2011 01:24:43 +0300 Subject: [PATCH] Add "Enter format" to format selection --- src/i/MainWindow.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/i/MainWindow.cpp b/src/i/MainWindow.cpp index fb43d52..538ef9c 100644 --- a/src/i/MainWindow.cpp +++ b/src/i/MainWindow.cpp @@ -332,13 +332,28 @@ MainWindow::handleURL (const QString& url) this, tr ("Choose format"), tr ("Format:"), - formats, + formats << tr("Enter your own"), 0, false, &ok ); if (ok) - args << "-f" << s; + { + if (s == tr("Enter your own")) + { + s = QInputDialog::getText( + this, + tr("Enter format"), + tr("Format:"), + QLineEdit::Normal, + "default", + &ok + ); + if (!ok || s.isEmpty()) + return; + } + args << "-f" << s; + } else return; } -- 2.11.4.GIT