Version: (using KDE KDE 3.4.3) Installed from: Ubuntu Packages It would be helpful to improve the picture nomenclature (at the Camera GUI) to generate more commandline-friendly names. At the moment you could customize the name with: Prefix, Date, Sequence Number e.g. prefix20060404-23:39:58-0001.JPG I suggest that: a) use a more commandline friendly date (without ':') 20060404-233958 (or abutted to the iso norm: 2006-04-04T233958) b) you could provide a postfix to keep the dateorder at the filesystem c) use .jpg instead of .JPG d) include the camera name This would result in this name: prefix2006-04-04T233958-0001-nikon_d70postfix.jpg Especially a) would improve the handling at the commandline. The others are just nice.
I forgot to mention that it would also be nice to use the exif date/time as reference for the filename and not or only as a fallback the file modification time.
this is just a small fix for a) --- renamecustomizer.cpp.old 2006-04-05 21:05:14.000000000 +0200 +++ renamecustomizer.cpp 2006-04-05 21:11:54.000000000 +0200 @@ -204,7 +204,7 @@ QString templ(d->renameCustomPrefix->text()); if (d->renameCustomExif->isChecked()) - templ += "%Y%m%d-%H:%M:%S"; + templ += "%Y%m%dT%H%M%S"; if (d->renameCustomSeq->isChecked()) templ += "-%%04d";
Options a) will be implemented via ':'-removed in 0.8.2-beta1 and later. As the other suggstion make sense too, I suggest keep the wish nevertheless open.
Achim, Option a) already implemented in stable and trunk. I don't know why CCBUGS have never post my commit in this file. Gilles Caulier
SVN commit 582104 by cgilles: digikam from trunk : camera gui rename customizer : add postfix string support CCBUGS: 124939 M +27 -11 renamecustomizer.cpp --- trunk/extragear/graphics/digikam/utilities/cameragui/renamecustomizer.cpp #582103:582104 @@ -62,6 +62,7 @@ renameCustomOptions = 0; changedTimer = 0; renameCustomPrefix = 0; + renameCustomPostfix = 0; startIndexLabel = 0; startIndexInput = 0; } @@ -82,6 +83,7 @@ QTimer *changedTimer; KLineEdit *renameCustomPrefix; + KLineEdit *renameCustomPostfix; KIntNumInput *startIndexInput; }; @@ -140,19 +142,26 @@ d->renameCustomBox->setColumnLayout(0, Qt::Vertical); QGridLayout* renameCustomBoxLayout = new QGridLayout(d->renameCustomBox->layout(), - 2, 2, KDialogBase::spacingHint()); + 3, 2, KDialogBase::spacingHint()); renameCustomBoxLayout->setColSpacing( 0, 10 ); + QLabel* prefixLabel = new QLabel(i18n("Prefix:"), d->renameCustomBox); renameCustomBoxLayout->addMultiCellWidget(prefixLabel, 0, 0, 1, 1); - d->renameCustomPrefix = new KLineEdit(d->renameCustomBox); renameCustomBoxLayout->addMultiCellWidget(d->renameCustomPrefix, 0, 0, 2, 2); QWhatsThis::add( d->renameCustomPrefix, i18n("<p>Set here the string to use like a prefix of " "image filenames.")); + QLabel* postfixLabel = new QLabel(i18n("Postfix:"), d->renameCustomBox); + renameCustomBoxLayout->addMultiCellWidget(postfixLabel, 1, 1, 1, 1); + d->renameCustomPostfix = new KLineEdit(d->renameCustomBox); + renameCustomBoxLayout->addMultiCellWidget(d->renameCustomPostfix, 1, 1, 2, 2); + QWhatsThis::add( d->renameCustomPostfix, i18n("<p>Set here the string to use like a postfix of " + "image filenames.")); + QLabel *renameOptionsLabel = new QLabel( i18n("Add:"), d->renameCustomBox ); renameOptionsLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); - renameCustomBoxLayout->addMultiCellWidget(renameOptionsLabel, 1, 1, 1, 1); + renameCustomBoxLayout->addMultiCellWidget(renameOptionsLabel, 2, 2, 1, 1); d->renameCustomOptions = new QComboBox( d->renameCustomBox ); d->renameCustomOptions->insertItem(i18n("Date and time"), 0); @@ -163,7 +172,7 @@ "<b>Sequence number</b>: add a sequence number.<p>" "<b>Time stamp & number</b>: add both camera provided date and time and " "a sequence number.")); - renameCustomBoxLayout->addMultiCellWidget(d->renameCustomOptions, 1, 1, 2, 2); + renameCustomBoxLayout->addMultiCellWidget(d->renameCustomOptions, 2, 2, 2, 2); d->startIndexLabel = new QLabel( i18n("Start Index:"), d->renameCustomBox ); d->startIndexInput = new KIntNumInput(1, d->renameCustomBox); @@ -171,8 +180,8 @@ QWhatsThis::add( d->startIndexInput, i18n("<p>Set here the start index value used to rename picture " "files with a sequence number.")); - renameCustomBoxLayout->addMultiCellWidget(d->startIndexLabel, 2, 2, 1, 1); - renameCustomBoxLayout->addMultiCellWidget(d->startIndexInput, 2, 2, 2, 2); + renameCustomBoxLayout->addMultiCellWidget(d->startIndexLabel, 3, 3, 1, 1); + renameCustomBoxLayout->addMultiCellWidget(d->startIndexInput, 3, 3, 2, 2); mainLayout->addMultiCellWidget(d->renameCustomBox, 3, 3, 0, 1); @@ -183,6 +192,9 @@ connect(d->renameCustomPrefix, SIGNAL(textChanged(const QString&)), this, SLOT(slotRenameOptionsChanged())); + + connect(d->renameCustomPostfix, SIGNAL(textChanged(const QString&)), + this, SLOT(slotRenameOptionsChanged())); connect(d->renameCustomOptions, SIGNAL(activated(int)), this, SLOT(slotCustomOptionsActived(int))); @@ -253,6 +265,7 @@ } } + name += d->renameCustomPostfix->text(); name += suffix; return name; @@ -308,11 +321,12 @@ KConfig* config = kapp->config(); config->setGroup("Camera Settings"); - bool def = config->readBoolEntry("Rename Use Default", true); - int option = config->readNumEntry("Rename Add Option", ADDSEQNUMB); - int chcaseT = config->readNumEntry("Case Type", NONE); - QString prefix = config->readEntry("Rename Prefix", i18n("photo")); - int startIndex = config->readNumEntry("Rename Start Index", 1); + bool def = config->readBoolEntry("Rename Use Default", true); + int option = config->readNumEntry("Rename Add Option", ADDSEQNUMB); + int chcaseT = config->readNumEntry("Case Type", NONE); + QString prefix = config->readEntry("Rename Prefix", i18n("photo")); + QString postfix = config->readEntry("Rename Postfix", QString()); + int startIndex = config->readNumEntry("Rename Start Index", 1); if (def) { @@ -331,6 +345,7 @@ d->renameDefaultCaseType->setCurrentItem(chcaseT); d->renameCustomPrefix->setText(prefix); + d->renameCustomPostfix->setText(postfix); d->renameCustomOptions->setCurrentItem(option); d->startIndexInput->setValue(startIndex); slotCustomOptionsActived(option); @@ -345,6 +360,7 @@ config->writeEntry("Rename Add Option", d->renameCustomOptions->currentItem()); config->writeEntry("Case Type", d->renameDefaultCaseType->currentItem()); config->writeEntry("Rename Prefix", d->renameCustomPrefix->text()); + config->writeEntry("Rename Postfix", d->renameCustomPostfix->text()); config->writeEntry("Rename Start Index", d->startIndexInput->value()); config->sync(); }
SVN commit 582127 by cgilles: digikam from trunk : camera gui : add new option to add camera name to target donwload file. BUG: 124939 M +1 -1 cameraui.cpp M +64 -62 renamecustomizer.cpp M +1 -9 renamecustomizer.h --- trunk/extragear/graphics/digikam/utilities/cameragui/cameraui.cpp #582126:582127 @@ -251,7 +251,7 @@ d->advBox = new QWidget(d->rightSidebar); QGridLayout* grid = new QGridLayout( d->advBox, 3, 1, KDialog::marginHint()); - d->renameCustomizer = new RenameCustomizer(d->advBox); + d->renameCustomizer = new RenameCustomizer(d->advBox, d->cameraTitle); d->view->setRenameCustomizer(d->renameCustomizer); // -- Albums Auto-creation options ----------------------------------------- --- trunk/extragear/graphics/digikam/utilities/cameragui/renamecustomizer.cpp #582126:582127 @@ -26,6 +26,7 @@ #include <qdatetime.h> #include <qlayout.h> #include <qradiobutton.h> +#include <qcheckbox.h> #include <qcombobox.h> #include <qhbox.h> #include <qlabel.h> @@ -60,7 +61,9 @@ renameCustomBox = 0; renameDefaultCase = 0; renameDefaultCaseType = 0; - renameCustomOptions = 0; + addDateTimeBox = 0; + addCameraNameBox = 0; + addSeqNumberBox = 0; changedTimer = 0; renameCustomPrefix = 0; renameCustomPostfix = 0; @@ -71,6 +74,8 @@ QWidget *focusedWidget; + QString cameraTitle; + QRadioButton *renameDefault; QRadioButton *renameCustom; @@ -82,7 +87,9 @@ QComboBox *renameDefaultCaseType; - QComboBox *renameCustomOptions; + QCheckBox *addDateTimeBox; + QCheckBox *addCameraNameBox; + QCheckBox *addSeqNumberBox; QTimer *changedTimer; @@ -92,12 +99,13 @@ KIntNumInput *startIndexInput; }; -RenameCustomizer::RenameCustomizer(QWidget* parent) +RenameCustomizer::RenameCustomizer(QWidget* parent, const QString& cameraTitle) : QButtonGroup(parent) { d = new RenameCustomizerPriv; d->changedTimer = new QTimer(); - + d->cameraTitle = cameraTitle; + setTitle(i18n("Renaming Options")); setRadioButtonExclusive(true); setColumnLayout(0, Qt::Vertical); @@ -146,7 +154,7 @@ d->renameCustomBox->setColumnLayout(0, Qt::Vertical); QGridLayout* renameCustomBoxLayout = new QGridLayout(d->renameCustomBox->layout(), - 3, 2, KDialogBase::spacingHint()); + 5, 2, KDialogBase::spacingHint()); renameCustomBoxLayout->setColSpacing( 0, 10 ); QLabel* prefixLabel = new QLabel(i18n("Prefix:"), d->renameCustomBox); @@ -164,29 +172,26 @@ QWhatsThis::add( d->renameCustomPostfix, i18n("<p>Set here the string to use like a postfix of " "image filenames.")); - QLabel *renameOptionsLabel = new QLabel( i18n("Add:"), d->renameCustomBox ); - renameOptionsLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); - renameCustomBoxLayout->addMultiCellWidget(renameOptionsLabel, 2, 2, 1, 1); + d->addDateTimeBox = new QCheckBox( i18n("Add Date && Time"), d->renameCustomBox ); + renameCustomBoxLayout->addMultiCellWidget(d->addDateTimeBox, 2, 2, 1, 2); + QWhatsThis::add( d->addDateTimeBox, i18n("<p>Set this option to add the camera provided date and time.")); - d->renameCustomOptions = new QComboBox( d->renameCustomBox ); - d->renameCustomOptions->insertItem(i18n("Date and time"), 0); - d->renameCustomOptions->insertItem(i18n("Sequence number"), 1); - d->renameCustomOptions->insertItem(i18n("Time stamp & number"), 2); - QWhatsThis::add( d->renameCustomOptions, i18n("<p>Set here the information to add to filename:<p>" - "<b>Date and time</b>: add the camera provided date and time.<p>" - "<b>Sequence number</b>: add a sequence number.<p>" - "<b>Time stamp & number</b>: add both camera provided date and time and " - "a sequence number.")); - renameCustomBoxLayout->addMultiCellWidget(d->renameCustomOptions, 2, 2, 2, 2); + d->addCameraNameBox = new QCheckBox( i18n("Add Camera Name"), d->renameCustomBox ); + renameCustomBoxLayout->addMultiCellWidget(d->addCameraNameBox, 3, 3, 1, 2); + QWhatsThis::add( d->addCameraNameBox, i18n("<p>Set this option to add the camera name.")); + d->addSeqNumberBox = new QCheckBox( i18n("Add Sequence Number"), d->renameCustomBox ); + renameCustomBoxLayout->addMultiCellWidget(d->addSeqNumberBox, 4, 4, 1, 2); + QWhatsThis::add( d->addSeqNumberBox, i18n("<p>Set this option to add a sequence number starting with the index set below.")); + d->startIndexLabel = new QLabel( i18n("Start Index:"), d->renameCustomBox ); d->startIndexInput = new KIntNumInput(1, d->renameCustomBox); - d->startIndexInput->setRange(1, 999999, 1, false); + d->startIndexInput->setRange(1, 900000, 1, false); QWhatsThis::add( d->startIndexInput, i18n("<p>Set here the start index value used to rename picture " "files with a sequence number.")); - renameCustomBoxLayout->addMultiCellWidget(d->startIndexLabel, 3, 3, 1, 1); - renameCustomBoxLayout->addMultiCellWidget(d->startIndexInput, 3, 3, 2, 2); + renameCustomBoxLayout->addMultiCellWidget(d->startIndexLabel, 5, 5, 1, 1); + renameCustomBoxLayout->addMultiCellWidget(d->startIndexInput, 5, 5, 2, 2); mainLayout->addMultiCellWidget(d->renameCustomBox, 3, 3, 0, 1); @@ -200,10 +205,16 @@ connect(d->renameCustomPostfix, SIGNAL(textChanged(const QString&)), this, SLOT(slotRenameOptionsChanged())); - - connect(d->renameCustomOptions, SIGNAL(activated(int)), - this, SLOT(slotCustomOptionsActived(int))); - + + connect(d->addDateTimeBox, SIGNAL(toggled(bool)), + this, SLOT(slotRenameOptionsChanged())); + + connect(d->addCameraNameBox, SIGNAL(toggled(bool)), + this, SLOT(slotRenameOptionsChanged())); + + connect(d->addSeqNumberBox, SIGNAL(toggled(bool)), + this, SLOT(slotRenameOptionsChanged())); + connect(d->renameDefaultCaseType, SIGNAL(activated(const QString&)), this, SLOT(slotRenameOptionsChanged())); @@ -248,28 +259,17 @@ // it seems that QString::number does not support padding with zeros QString seq; - seq.sprintf("-%04d", index); + seq.sprintf("-%06d", index); - switch (d->renameCustomOptions->currentItem()) - { - case ADDDATETIME: - { - name += date; - break; - } - case ADDSEQNUMB: - { - name += seq; - break; - } - case ADDBOTH: - { - name += date; - name += seq; - break; - } - } + if (d->addDateTimeBox->isChecked()) + name += date; + if (d->addSeqNumberBox->isChecked()) + name += seq; + + if (d->addCameraNameBox->isChecked()) + name += QString("-%1").arg(d->cameraTitle.simplifyWhiteSpace().replace(" ", "")); + name += d->renameCustomPostfix->text(); name += suffix; @@ -300,9 +300,11 @@ slotRenameOptionsChanged(); } -void RenameCustomizer::slotCustomOptionsActived(int i) +void RenameCustomizer::slotRenameOptionsChanged() { - if (i == ADDSEQNUMB || i == ADDBOTH) + d->focusedWidget = focusWidget(); + + if (d->addSeqNumberBox->isChecked()) { d->startIndexInput->setEnabled(true); d->startIndexLabel->setEnabled(true); @@ -312,13 +314,7 @@ d->startIndexInput->setEnabled(false); d->startIndexLabel->setEnabled(false); } - - slotRenameOptionsChanged(); -} -void RenameCustomizer::slotRenameOptionsChanged() -{ - d->focusedWidget = focusWidget(); d->changedTimer->start(500, true); } @@ -327,12 +323,14 @@ KConfig* config = kapp->config(); config->setGroup("Camera Settings"); - bool def = config->readBoolEntry("Rename Use Default", true); - int option = config->readNumEntry("Rename Add Option", ADDSEQNUMB); - int chcaseT = config->readNumEntry("Case Type", NONE); - QString prefix = config->readEntry("Rename Prefix", i18n("photo")); - QString postfix = config->readEntry("Rename Postfix", QString()); - int startIndex = config->readNumEntry("Rename Start Index", 1); + bool def = config->readBoolEntry("Rename Use Default", true); + bool addSeqNumb = config->readBoolEntry("Add Sequence Number", true); + bool adddateTime = config->readBoolEntry("Add Date Time", false); + bool addCamName = config->readBoolEntry("Add Camera Name", false); + int chcaseT = config->readNumEntry("Case Type", NONE); + QString prefix = config->readEntry("Rename Prefix", i18n("photo")); + QString postfix = config->readEntry("Rename Postfix", QString()); + int startIndex = config->readNumEntry("Rename Start Index", 1); if (def) { @@ -349,12 +347,14 @@ d->renameDefaultBox->setEnabled(false); } + d->addDateTimeBox->setChecked(adddateTime); + d->addCameraNameBox->setChecked(addCamName); + d->addSeqNumberBox->setChecked(addSeqNumb); d->renameDefaultCaseType->setCurrentItem(chcaseT); d->renameCustomPrefix->setText(prefix); d->renameCustomPostfix->setText(postfix); - d->renameCustomOptions->setCurrentItem(option); d->startIndexInput->setValue(startIndex); - slotCustomOptionsActived(option); + slotRenameOptionsChanged(); } void RenameCustomizer::saveSettings() @@ -363,7 +363,9 @@ config->setGroup("Camera Settings"); config->writeEntry("Rename Use Default", d->renameDefault->isChecked()); - config->writeEntry("Rename Add Option", d->renameCustomOptions->currentItem()); + config->writeEntry("Add Camera Name", d->addCameraNameBox->isChecked()); + config->writeEntry("Add Date Time", d->addDateTimeBox->isChecked()); + config->writeEntry("Add Sequence Number", d->addSeqNumberBox->isChecked()); config->writeEntry("Case Type", d->renameDefaultCaseType->currentItem()); config->writeEntry("Rename Prefix", d->renameCustomPrefix->text()); config->writeEntry("Rename Postfix", d->renameCustomPostfix->text()); --- trunk/extragear/graphics/digikam/utilities/cameragui/renamecustomizer.h #582126:582127 @@ -48,14 +48,7 @@ LOWER }; - enum CustomOptions - { - ADDDATETIME = 0, - ADDSEQNUMB, - ADDBOTH - }; - - RenameCustomizer(QWidget* parent); + RenameCustomizer(QWidget* parent, const QString& cameraTitle); ~RenameCustomizer(); void setUseDefault(bool val); @@ -81,7 +74,6 @@ void slotRadioButtonClicked(int); void slotRenameOptionsChanged(); - void slotCustomOptionsActived(int); private: