Review: http://git.reviewboard.kde.org/r/102328/
Thanks to Chirag Anand for the patch!
CCMAIL: anand.chirag@gmail.com
#include <KLocale>
#include <konq_operations.h>
#include <KStringHandler>
#include <KLocale>
#include <konq_operations.h>
#include <KStringHandler>
#include <QLabel>
#include <QVBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
m_renameOneItem(false),
m_newName(),
m_lineEdit(0),
m_renameOneItem(false),
m_newName(),
m_lineEdit(0),
+ m_items(items),
+ m_spinBox(0)
{
const QSize minSize = minimumSize();
setMinimumSize(QSize(320, minSize.height()));
{
const QSize minSize = minimumSize();
setMinimumSize(QSize(320, minSize.height()));
topLayout->addWidget(m_lineEdit);
if (!m_renameOneItem) {
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);
qSort(m_items.begin(), m_items.end(), lessThan);
// Iterate through all items and rename them...
qSort(m_items.begin(), m_items.end(), lessThan);
// Iterate through all items and rename them...
+ int index = m_spinBox->value();
foreach (const KFileItem& item, m_items) {
const QString newName = indexedName(m_newName, index, QLatin1Char('#'));
++index;
foreach (const KFileItem& item, m_items) {
const QString newName = indexedName(m_newName, index, QLatin1Char('#'));
++index;
#include <KFileItem>
class KLineEdit;
#include <KFileItem>
class KLineEdit;
private:
void renameItems();
private:
void renameItems();
/**
* @return Returns the string \p name, where the characters represented by
* \p indexPlaceHolder get replaced by the index \p index.
/**
* @return Returns the string \p name, where the characters represented by
* \p indexPlaceHolder get replaced by the index \p index.
QString m_newName;
KLineEdit* m_lineEdit;
KFileItemList m_items;
QString m_newName;
KLineEdit* m_lineEdit;
KFileItemList m_items;
+ KIntSpinBox* m_spinBox;