┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/renamedialog.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-08-15 20:34:28 +0200
committerPeter Penz <[email protected]>2011-08-15 20:36:43 +0200
commit1479e8231570591ad0f9af70a4bd119095bdcd42 (patch)
treead4aa7929544dbb433c54a8bbfd57ec6a9afbb4f /src/views/renamedialog.cpp
parentdd71994b6cea7730c126f0b68351a96a0c624634 (diff)
Allow to adjust start-index when renaming a various number of items
Review: http://git.reviewboard.kde.org/r/102328/ Thanks to Chirag Anand for the patch! CCMAIL: [email protected]
Diffstat (limited to 'src/views/renamedialog.cpp')
-rw-r--r--src/views/renamedialog.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp
index c0c6ad58c..c974465fe 100644
--- a/src/views/renamedialog.cpp
+++ b/src/views/renamedialog.cpp
@@ -23,7 +23,9 @@
#include <KLocale>
#include <konq_operations.h>
#include <KStringHandler>
+#include <knuminput.h>
+#include <QHBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
@@ -41,7 +43,8 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
m_renameOneItem(false),
m_newName(),
m_lineEdit(0),
- m_items(items)
+ m_items(items),
+ m_spinBox(0)
{
const QSize minSize = minimumSize();
setMinimumSize(QSize(320, minSize.height()));
@@ -118,8 +121,15 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
topLayout->addWidget(m_lineEdit);
if (!m_renameOneItem) {
- QLabel* infoLabel = new QLabel(i18nc("@info", "(# will be replaced by ascending numbers)"), page);
- topLayout->addWidget(infoLabel);
+ QLabel* infoLabel = new QLabel(i18nc("@info", "# will be replaced by ascending numbers starting with:"), page);
+ m_spinBox = new KIntSpinBox(0, 10000, 1, 1, page, 10);
+
+ QHBoxLayout* horizontalLayout = new QHBoxLayout(page);
+ horizontalLayout->setMargin(0);
+ horizontalLayout->addWidget(infoLabel);
+ horizontalLayout->addWidget(m_spinBox);
+
+ topLayout->addLayout(horizontalLayout);
}
}
@@ -177,7 +187,7 @@ void RenameDialog::renameItems()
qSort(m_items.begin(), m_items.end(), lessThan);
// Iterate through all items and rename them...
- int index = 1;
+ int index = m_spinBox->value();
foreach (const KFileItem& item, m_items) {
const QString newName = indexedName(m_newName, index, QLatin1Char('#'));
++index;