diff options
Diffstat (limited to 'digikam/utilities/cameragui/renamecustomizer.cpp')
| -rw-r--r-- | digikam/utilities/cameragui/renamecustomizer.cpp | 218 |
1 files changed, 109 insertions, 109 deletions
diff --git a/digikam/utilities/cameragui/renamecustomizer.cpp b/digikam/utilities/cameragui/renamecustomizer.cpp index fc90ce2c..3d57ac3b 100644 --- a/digikam/utilities/cameragui/renamecustomizer.cpp +++ b/digikam/utilities/cameragui/renamecustomizer.cpp @@ -23,18 +23,18 @@ * * ============================================================ */ -// Qt includes. - -#include <qdatetime.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtimer.h> -#include <qwhatsthis.h> +// TQt includes. + +#include <tqdatetime.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtimer.h> +#include <tqwhatsthis.h> // KDE includes. @@ -94,31 +94,31 @@ public: dateTimeFormat = 0; } - QWidget *focusedWidget; + TQWidget *focusedWidget; - QString cameraTitle; + TQString cameraTitle; - QRadioButton *renameDefault; - QRadioButton *renameCustom; + TQRadioButton *renameDefault; + TQRadioButton *renameCustom; - QGroupBox *renameDefaultBox; - QGroupBox *renameCustomBox; + TQGroupBox *renameDefaultBox; + TQGroupBox *renameCustomBox; - QLabel *renameDefaultCase; - QLabel *startIndexLabel; - QLabel *dateTimeLabel; + TQLabel *renameDefaultCase; + TQLabel *startIndexLabel; + TQLabel *dateTimeLabel; - QComboBox *renameDefaultCaseType; - QComboBox *dateTimeFormat; + TQComboBox *renameDefaultCaseType; + TQComboBox *dateTimeFormat; - QCheckBox *addDateTimeBox; - QCheckBox *addCameraNameBox; - QCheckBox *addSeqNumberBox; + TQCheckBox *addDateTimeBox; + TQCheckBox *addCameraNameBox; + TQCheckBox *addSeqNumberBox; - QPushButton *dateTimeButton; - QString dateTimeFormatString; + TQPushButton *dateTimeButton; + TQString dateTimeFormatString; - QTimer *changedTimer; + TQTimer *changedTimer; KLineEdit *renameCustomPrefix; KLineEdit *renameCustomSuffix; @@ -126,42 +126,42 @@ public: KIntNumInput *startIndexInput; }; -RenameCustomizer::RenameCustomizer(QWidget* parent, const QString& cameraTitle) - : QButtonGroup(parent) +RenameCustomizer::RenameCustomizer(TQWidget* tqparent, const TQString& cameraTitle) + : TQButtonGroup(tqparent) { d = new RenameCustomizerPriv; - d->changedTimer = new QTimer(this); + d->changedTimer = new TQTimer(this); d->cameraTitle = cameraTitle; - setFrameStyle( QFrame::NoFrame ); + setFrameStyle( TQFrame::NoFrame ); setRadioButtonExclusive(true); setColumnLayout(0, Qt::Vertical); - QGridLayout* mainLayout = new QGridLayout(layout(), 4, 1); + TQGridLayout* mainLayout = new TQGridLayout(tqlayout(), 4, 1); // ---------------------------------------------------------------- - d->renameDefault = new QRadioButton(i18n("Camera filenames"), this); - QWhatsThis::add( d->renameDefault, i18n("<p>Turn on this option to use camera " + d->renameDefault = new TQRadioButton(i18n("Camera filenames"), this); + TQWhatsThis::add( d->renameDefault, i18n("<p>Turn on this option to use camera " "provided image filenames without modifications.")); mainLayout->addMultiCellWidget(d->renameDefault, 0, 0, 0, 1); - d->renameDefaultBox = new QGroupBox( this ); - d->renameDefaultBox->setFrameStyle(QFrame::NoFrame|QFrame::Plain); + d->renameDefaultBox = new TQGroupBox( this ); + d->renameDefaultBox->setFrameStyle(TQFrame::NoFrame|TQFrame::Plain); d->renameDefaultBox->setInsideMargin(0); d->renameDefaultBox->setColumnLayout(0, Qt::Vertical); - d->renameDefaultCase = new QLabel( i18n("Change case to:"), d->renameDefaultBox ); - d->renameDefaultCase->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ); + d->renameDefaultCase = new TQLabel( i18n("Change case to:"), d->renameDefaultBox ); + d->renameDefaultCase->tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Preferred ); - d->renameDefaultCaseType = new QComboBox( d->renameDefaultBox ); + d->renameDefaultCaseType = new TQComboBox( d->renameDefaultBox ); d->renameDefaultCaseType->insertItem(i18n("Leave as Is"), 0); d->renameDefaultCaseType->insertItem(i18n("Upper"), 1); d->renameDefaultCaseType->insertItem(i18n("Lower"), 2); - d->renameDefaultCaseType->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); - QWhatsThis::add( d->renameDefaultCaseType, i18n("<p>Set the method to use to change the case " + d->renameDefaultCaseType->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Preferred); + TQWhatsThis::add( d->renameDefaultCaseType, i18n("<p>Set the method to use to change the case " "of image filenames.")); - QHBoxLayout* boxLayout1 = new QHBoxLayout( d->renameDefaultBox->layout() ); + TQHBoxLayout* boxLayout1 = new TQHBoxLayout( d->renameDefaultBox->tqlayout() ); boxLayout1->addSpacing( 10 ); boxLayout1->addWidget( d->renameDefaultCase ); boxLayout1->addWidget( d->renameDefaultCaseType ); @@ -170,48 +170,48 @@ RenameCustomizer::RenameCustomizer(QWidget* parent, const QString& cameraTitle) // ------------------------------------------------------------- - d->renameCustom = new QRadioButton(i18n("Customize"), this); + d->renameCustom = new TQRadioButton(i18n("Customize"), this); mainLayout->addMultiCellWidget(d->renameCustom, 2, 2, 0, 1); - QWhatsThis::add( d->renameCustom, i18n("<p>Turn on this option to customize image filenames " + TQWhatsThis::add( d->renameCustom, i18n("<p>Turn on this option to customize image filenames " "during download.")); - d->renameCustomBox = new QGroupBox(this); - d->renameCustomBox->setFrameStyle(QFrame::NoFrame|QFrame::Plain); + d->renameCustomBox = new TQGroupBox(this); + d->renameCustomBox->setFrameStyle(TQFrame::NoFrame|TQFrame::Plain); d->renameCustomBox->setInsideMargin(0); d->renameCustomBox->setColumnLayout(0, Qt::Vertical); - QGridLayout* renameCustomBoxLayout = new QGridLayout(d->renameCustomBox->layout(), + TQGridLayout* renameCustomBoxLayout = new TQGridLayout(d->renameCustomBox->tqlayout(), 6, 2, KDialogBase::spacingHint()); renameCustomBoxLayout->setColSpacing( 0, 10 ); - QLabel* prefixLabel = new QLabel(i18n("Prefix:"), d->renameCustomBox); + TQLabel* prefixLabel = new TQLabel(i18n("Prefix:"), d->renameCustomBox); renameCustomBoxLayout->addMultiCellWidget(prefixLabel, 0, 0, 1, 1); d->renameCustomPrefix = new KLineEdit(d->renameCustomBox); d->focusedWidget = d->renameCustomPrefix; renameCustomBoxLayout->addMultiCellWidget(d->renameCustomPrefix, 0, 0, 2, 2); - QWhatsThis::add( d->renameCustomPrefix, i18n("<p>Set the prefix which will be added to " + TQWhatsThis::add( d->renameCustomPrefix, i18n("<p>Set the prefix which will be added to " "image filenames.")); - QLabel* suffixLabel = new QLabel(i18n("Suffix:"), d->renameCustomBox); + TQLabel* suffixLabel = new TQLabel(i18n("Suffix:"), d->renameCustomBox); renameCustomBoxLayout->addMultiCellWidget(suffixLabel, 1, 1, 1, 1); d->renameCustomSuffix = new KLineEdit(d->renameCustomBox); renameCustomBoxLayout->addMultiCellWidget(d->renameCustomSuffix, 1, 1, 2, 2); - QWhatsThis::add( d->renameCustomSuffix, i18n("<p>Set the suffix which will be added to " + TQWhatsThis::add( d->renameCustomSuffix, i18n("<p>Set the suffix which will be added to " "image filenames.")); - d->addDateTimeBox = new QCheckBox( i18n("Add Date && Time"), d->renameCustomBox ); + d->addDateTimeBox = new TQCheckBox( 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.")); + TQWhatsThis::add( d->addDateTimeBox, i18n("<p>Set this option to add the camera provided date and time.")); - QWidget *dateTimeWidget = new QWidget(d->renameCustomBox); - d->dateTimeLabel = new QLabel(i18n("Date format:"), dateTimeWidget); - d->dateTimeFormat = new QComboBox(dateTimeWidget); + TQWidget *dateTimeWidget = new TQWidget(d->renameCustomBox); + d->dateTimeLabel = new TQLabel(i18n("Date format:"), dateTimeWidget); + d->dateTimeFormat = new TQComboBox(dateTimeWidget); d->dateTimeFormat->insertItem(i18n("Standard"), RenameCustomizerPriv::DigikamStandard); d->dateTimeFormat->insertItem(i18n("ISO"), RenameCustomizerPriv::IsoDateFormat); d->dateTimeFormat->insertItem(i18n("Full Text"), RenameCustomizerPriv::TextDateFormat); d->dateTimeFormat->insertItem(i18n("Local Settings"), RenameCustomizerPriv::LocalDateFormat); d->dateTimeFormat->insertItem(i18n("Advanced..."), RenameCustomizerPriv::Advanced); - QWhatsThis::add( d->dateTimeFormat, i18n("<p>Select your preferred date format for " + TQWhatsThis::add( d->dateTimeFormat, i18n("<p>Select your preferred date format for " "creating new albums. The options available are:</p>" "<p><b>Standard</b>: the date format that has been used as a standard by digiKam. " "E.g.: <i>20060824T142618</i></p>" @@ -221,29 +221,29 @@ RenameCustomizer::RenameCustomizer(QWidget* parent, const QString& cameraTitle) "E.g.: <i>Thu Aug 24 14:26:18 2006</i></p>" "<p><b>Local Settings</b>: the date format depending on KDE control panel settings.</p>" "<p><b>Advanced:</b> allows the user to specify a custom date format.</p>")); - d->dateTimeButton = new QPushButton(SmallIcon("configure"), QString(), dateTimeWidget); - QSizePolicy policy = d->dateTimeButton->sizePolicy(); - policy.setHorData(QSizePolicy::Maximum); - d->dateTimeButton->setSizePolicy(policy); - QHBoxLayout *boxLayout2 = new QHBoxLayout(dateTimeWidget); + d->dateTimeButton = new TQPushButton(SmallIcon("configure"), TQString(), dateTimeWidget); + TQSizePolicy policy = d->dateTimeButton->tqsizePolicy(); + policy.setHorData(TQSizePolicy::Maximum); + d->dateTimeButton->tqsetSizePolicy(policy); + TQHBoxLayout *boxLayout2 = new TQHBoxLayout(dateTimeWidget); boxLayout2->addWidget(d->dateTimeLabel); boxLayout2->addWidget(d->dateTimeFormat); boxLayout2->addWidget(d->dateTimeButton); renameCustomBoxLayout->addMultiCellWidget(dateTimeWidget, 3, 3, 1, 2); - d->addCameraNameBox = new QCheckBox( i18n("Add Camera Name"), d->renameCustomBox ); + d->addCameraNameBox = new TQCheckBox( i18n("Add Camera Name"), d->renameCustomBox ); renameCustomBoxLayout->addMultiCellWidget(d->addCameraNameBox, 4, 4, 1, 2); - QWhatsThis::add( d->addCameraNameBox, i18n("<p>Set this option to add the camera name.")); + TQWhatsThis::add( d->addCameraNameBox, i18n("<p>Set this option to add the camera name.")); - d->addSeqNumberBox = new QCheckBox( i18n("Add Sequence Number"), d->renameCustomBox ); + d->addSeqNumberBox = new TQCheckBox( i18n("Add Sequence Number"), d->renameCustomBox ); renameCustomBoxLayout->addMultiCellWidget(d->addSeqNumberBox, 5, 5, 1, 2); - QWhatsThis::add( d->addSeqNumberBox, i18n("<p>Set this option to add a sequence number " + TQWhatsThis::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->startIndexLabel = new TQLabel( i18n("Start Index:"), d->renameCustomBox ); d->startIndexInput = new KIntNumInput(1, d->renameCustomBox); d->startIndexInput->setRange(1, 900000, 1, false); - QWhatsThis::add( d->startIndexInput, i18n("<p>Set the starting index value used to rename " + TQWhatsThis::add( d->startIndexInput, i18n("<p>Set the starting index value used to rename " "files with a sequence number.")); renameCustomBoxLayout->addMultiCellWidget(d->startIndexLabel, 6, 6, 1, 1); @@ -254,41 +254,41 @@ RenameCustomizer::RenameCustomizer(QWidget* parent, const QString& cameraTitle) // -- setup connections ------------------------------------------------- - connect(this, SIGNAL(clicked(int)), - this, SLOT(slotRadioButtonClicked(int))); + connect(this, TQT_SIGNAL(clicked(int)), + this, TQT_SLOT(slotRadioButtonClicked(int))); - connect(d->renameCustomPrefix, SIGNAL(textChanged(const QString&)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->renameCustomPrefix, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->renameCustomSuffix, SIGNAL(textChanged(const QString&)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->renameCustomSuffix, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->addDateTimeBox, SIGNAL(toggled(bool)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->addDateTimeBox, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->addCameraNameBox, SIGNAL(toggled(bool)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->addCameraNameBox, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->addSeqNumberBox, SIGNAL(toggled(bool)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->addSeqNumberBox, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->renameDefaultCaseType, SIGNAL(activated(const QString&)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->renameDefaultCaseType, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->startIndexInput, SIGNAL(valueChanged (int)), - this, SLOT(slotRenameOptionsChanged())); + connect(d->startIndexInput, TQT_SIGNAL(valueChanged (int)), + this, TQT_SLOT(slotRenameOptionsChanged())); - connect(d->changedTimer, SIGNAL(timeout()), - this, SIGNAL(signalChanged())); + connect(d->changedTimer, TQT_SIGNAL(timeout()), + this, TQT_SIGNAL(signalChanged())); - connect(d->dateTimeButton, SIGNAL(clicked()), - this, SLOT(slotDateTimeButtonClicked())); + connect(d->dateTimeButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotDateTimeButtonClicked())); - connect(d->dateTimeFormat, SIGNAL(activated(int)), - this, SLOT(slotDateTimeFormatChanged(int))); + connect(d->dateTimeFormat, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDateTimeFormatChanged(int))); - connect(d->addDateTimeBox, SIGNAL(toggled(bool)), - this, SLOT(slotDateTimeBoxToggled(bool))); + connect(d->addDateTimeBox, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotDateTimeBoxToggled(bool))); // -- initial values --------------------------------------------------- @@ -315,16 +315,16 @@ int RenameCustomizer::startIndex() const return d->startIndexInput->value(); } -QString RenameCustomizer::newName(const QDateTime &dateTime, int index, const QString &extension) const +TQString RenameCustomizer::newName(const TQDateTime &dateTime, int index, const TQString &extension) const { if (d->renameDefault->isChecked()) - return QString(); + return TQString(); else { - QString name(d->renameCustomPrefix->text()); + TQString name(d->renameCustomPrefix->text()); // use the "T" as a delimiter between date and time - QString date; + TQString date; switch (d->dateTimeFormat->currentItem()) { case RenameCustomizerPriv::DigikamStandard: @@ -344,8 +344,8 @@ QString RenameCustomizer::newName(const QDateTime &dateTime, int index, const QS break; } - // it seems that QString::number does not support padding with zeros - QString seq; + // it seems that TQString::number does not support padding with zeros + TQString seq; seq.sprintf("-%06d", index); if (d->addDateTimeBox->isChecked()) @@ -355,7 +355,7 @@ QString RenameCustomizer::newName(const QDateTime &dateTime, int index, const QS name += seq; if (d->addCameraNameBox->isChecked()) - name += QString("-%1").arg(d->cameraTitle.simplifyWhiteSpace().replace(" ", "")); + name += TQString("-%1").tqarg(d->cameraTitle.simplifyWhiteSpace().tqreplace(" ", "")); name += d->renameCustomSuffix->text(); name += extension; @@ -378,7 +378,7 @@ RenameCustomizer::Case RenameCustomizer::changeCase() const void RenameCustomizer::slotRadioButtonClicked(int) { - QRadioButton* btn = dynamic_cast<QRadioButton*>(selected()); + TQRadioButton* btn = dynamic_cast<TQRadioButton*>(selected()); if (!btn) return; @@ -389,7 +389,7 @@ void RenameCustomizer::slotRadioButtonClicked(int) void RenameCustomizer::slotRenameOptionsChanged() { - d->focusedWidget = focusWidget(); + d->focusedWidget = tqfocusWidget(); if (d->addSeqNumberBox->isChecked()) { @@ -433,7 +433,7 @@ void RenameCustomizer::slotDateTimeFormatChanged(int index) void RenameCustomizer::slotDateTimeButtonClicked() { bool ok; - QString message = i18n("<qt><p>Enter the format for date and time.</p>" + TQString message = i18n("<qt><p>Enter the format for date and time.</p>" "<p>Use <i>dd</i> for the day, " "<i>MM</i> for the month, " "<i>yyyy</i> for the year, " @@ -446,11 +446,11 @@ void RenameCustomizer::slotDateTimeButtonClicked() "for 2006-08-24 14:24:18.</p></qt>"); #if KDE_IS_VERSION(3,2,0) - QString newFormat = KInputDialog::getText(i18n("Change Date and Time Format"), + TQString newFormat = KInputDialog::getText(i18n("Change Date and Time Format"), message, d->dateTimeFormatString, &ok, this); #else - QString newFormat = KLineEditDlg::getText(i18n("Change Date and Time Format"), + TQString newFormat = KLineEditDlg::getText(i18n("Change Date and Time Format"), message, d->dateTimeFormatString, &ok, this); #endif @@ -472,11 +472,11 @@ void RenameCustomizer::readSettings() 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 suffix = config->readEntry("Rename Postfix", QString()); + TQString prefix = config->readEntry("Rename Prefix", i18n("photo")); + TQString suffix = config->readEntry("Rename Postfix", TQString()); int startIndex = config->readNumEntry("Rename Start Index", 1); int dateTime = config->readNumEntry("Date Time Format", RenameCustomizerPriv::IsoDateFormat); - QString format = config->readEntry("Date Time Format String", "yyyyMMddThhmmss"); + TQString format = config->readEntry("Date Time Format String", "yyyyMMddThhmmss"); if (def) { |
