diff options
Diffstat (limited to 'src/collectionfieldsdialog.cpp')
-rw-r--r-- | src/collectionfieldsdialog.cpp | 346 |
1 files changed, 173 insertions, 173 deletions
diff --git a/src/collectionfieldsdialog.cpp b/src/collectionfieldsdialog.cpp index cc9aede..1a5e408 100644 --- a/src/collectionfieldsdialog.cpp +++ b/src/collectionfieldsdialog.cpp @@ -29,31 +29,31 @@ #include <kpushbutton.h> #include <kaccelmanager.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qregexp.h> -#include <qwhatsthis.h> -#include <qtimer.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqregexp.h> +#include <tqwhatsthis.h> +#include <tqtimer.h> using Tellico::FieldListBox; using Tellico::CollectionFieldsDialog; -FieldListBox::FieldListBox(QListBox* listbox_, Data::FieldPtr field_) +FieldListBox::FieldListBox(TQListBox* listbox_, Data::FieldPtr field_) : GUI::ListBoxText(listbox_, field_->title()), m_field(field_) { } -FieldListBox::FieldListBox(QListBox* listbox_, Data::FieldPtr field_, QListBoxItem* after_) +FieldListBox::FieldListBox(TQListBox* listbox_, Data::FieldPtr field_, TQListBoxItem* after_) : GUI::ListBoxText(listbox_, field_->title(), after_), m_field(field_) { } -CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* parent_, const char* name_/*=0*/) - : KDialogBase(parent_, name_, false, i18n("Collection Fields"), Help|Default|Ok|Apply|Cancel, Ok, false), +CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* tqparent_, const char* name_/*=0*/) + : KDialogBase(tqparent_, name_, false, i18n("Collection Fields"), Help|Default|Ok|Apply|Cancel, Ok, false), m_coll(coll_), m_defaultCollection(0), m_currentField(0), @@ -61,13 +61,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par m_updatingValues(false), m_reordered(false), m_oldIndex(-1) { - QWidget* page = new QWidget(this); + TQWidget* page = new TQWidget(this); setMainWidget(page); - QHBoxLayout* topLayout = new QHBoxLayout(page, 0, KDialog::spacingHint()); + TQHBoxLayout* topLayout = new TQHBoxLayout(page, 0, KDialog::spacingHint()); - QGroupBox* fieldsGroup = new QGroupBox(1, Qt::Horizontal, i18n("Current Fields"), page); + TQGroupBox* fieldsGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Current Fields"), page); topLayout->addWidget(fieldsGroup, 1); - m_fieldsBox = new QListBox(fieldsGroup); + m_fieldsBox = new TQListBox(fieldsGroup); m_fieldsBox->setMinimumWidth(150); Data::FieldVec fields = m_coll->fields(); @@ -77,61 +77,61 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par (void) new FieldListBox(m_fieldsBox, it); } } - connect(m_fieldsBox, SIGNAL(highlighted(int)), SLOT(slotHighlightedChanged(int))); + connect(m_fieldsBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotHighlightedChanged(int))); - QHBox* hb1 = new QHBox(fieldsGroup); + TQHBox* hb1 = new TQHBox(fieldsGroup); hb1->setSpacing(KDialog::spacingHint()); m_btnNew = new KPushButton(i18n("New Field", "&New"), hb1); - m_btnNew->setIconSet(BarIcon(QString::fromLatin1("filenew"), KIcon::SizeSmall)); - QWhatsThis::add(m_btnNew, i18n("Add a new field to the collection")); + m_btnNew->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall)); + TQWhatsThis::add(m_btnNew, i18n("Add a new field to the collection")); m_btnDelete = new KPushButton(i18n("Delete Field", "&Delete"), hb1); - m_btnDelete->setIconSet(BarIconSet(QString::fromLatin1("editdelete"), KIcon::SizeSmall)); - QWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection")); + m_btnDelete->setIconSet(BarIconSet(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall)); + TQWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection")); - connect(m_btnNew, SIGNAL(clicked()), SLOT(slotNew()) ); - connect(m_btnDelete, SIGNAL(clicked()), SLOT(slotDelete())); + connect(m_btnNew, TQT_SIGNAL(clicked()), TQT_SLOT(slotNew()) ); + connect(m_btnDelete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDelete())); - QHBox* hb2 = new QHBox(fieldsGroup); + TQHBox* hb2 = new TQHBox(fieldsGroup); hb2->setSpacing(KDialog::spacingHint()); m_btnUp = new KPushButton(hb2); - m_btnUp->setPixmap(BarIcon(QString::fromLatin1("up"), KIcon::SizeSmall)); - QWhatsThis::add(m_btnUp, i18n("Move this field up in the list. The list order is important " - "for the layout of the entry editor.")); + m_btnUp->setPixmap(BarIcon(TQString::tqfromLatin1("up"), KIcon::SizeSmall)); + TQWhatsThis::add(m_btnUp, i18n("Move this field up in the list. The list order is important " + "for the tqlayout of the entry editor.")); m_btnDown = new KPushButton(hb2); - m_btnDown->setPixmap(BarIcon(QString::fromLatin1("down"), KIcon::SizeSmall)); - QWhatsThis::add(m_btnDown, i18n("Move this field down in the list. The list order is important " - "for the layout of the entry editor.")); + m_btnDown->setPixmap(BarIcon(TQString::tqfromLatin1("down"), KIcon::SizeSmall)); + TQWhatsThis::add(m_btnDown, i18n("Move this field down in the list. The list order is important " + "for the tqlayout of the entry editor.")); - connect(m_btnUp, SIGNAL(clicked()), SLOT(slotMoveUp()) ); - connect(m_btnDown, SIGNAL(clicked()), SLOT(slotMoveDown())); + connect(m_btnUp, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp()) ); + connect(m_btnDown, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown())); - QVBox* vbox = new QVBox(page); + TQVBox* vbox = new TQVBox(page); vbox->setSpacing(KDialog::spacingHint()); topLayout->addWidget(vbox, 2); - QGroupBox* propGroup = new QGroupBox(1, Qt::Horizontal, i18n("Field Properties"), vbox); + TQGroupBox* propGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Field Properties"), vbox); - QWidget* grid = new QWidget(propGroup); - // (parent, nrows, ncols, margin, spacing) - QGridLayout* layout = new QGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); + TQWidget* grid = new TQWidget(propGroup); + // (tqparent, nrows, ncols, margin, spacing) + TQGridLayout* tqlayout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); int row = -1; - QLabel* label = new QLabel(i18n("&Title:"), grid); - layout->addWidget(label, ++row, 0); + TQLabel* label = new TQLabel(i18n("&Title:"), grid); + tqlayout->addWidget(label, ++row, 0); m_titleEdit = new KLineEdit(grid); - layout->addWidget(m_titleEdit, row, 1); + tqlayout->addWidget(m_titleEdit, row, 1); label->setBuddy(m_titleEdit); - QString whats = i18n("The title of the field"); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_titleEdit, whats); - connect(m_titleEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified())); + TQString whats = i18n("The title of the field"); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_titleEdit, whats); + connect(m_titleEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); - label = new QLabel(i18n("T&ype:"), grid); - layout->addWidget(label, row, 2); + label = new TQLabel(i18n("T&ype:"), grid); + tqlayout->addWidget(label, row, 2); m_typeCombo = new KComboBox(grid); - layout->addWidget(m_typeCombo, row, 3); + tqlayout->addWidget(m_typeCombo, row, 3); label->setBuddy(m_typeCombo); - whats = QString::fromLatin1("<qt>"); + whats = TQString::tqfromLatin1("<qt>"); whats += i18n("The type of the field determines what values may be used. "); whats += i18n("<i>Simple Text</i> is used for most fields. "); whats += i18n("<i>Paragraph</i> is for large text blocks. "); @@ -146,27 +146,27 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par whats += i18n("A <i>Dependent</i> field depends on the values of other " "fields, and is formatted according to the field description. "); whats += i18n("A <i>Read Only</i> is for internal values, possibly useful for import and export. "); - whats += QString::fromLatin1("</qt>"); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_typeCombo, whats); + whats += TQString::tqfromLatin1("</qt>"); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_typeCombo, whats); // the typeTitles match the fieldMap().values() but in a better order m_typeCombo->insertStringList(Data::Field::typeTitles()); - connect(m_typeCombo, SIGNAL(activated(int)), SLOT(slotModified())); - connect(m_typeCombo, SIGNAL(activated(const QString&)), SLOT(slotTypeChanged(const QString&))); + connect(m_typeCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified())); + connect(m_typeCombo, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotTypeChanged(const TQString&))); - label = new QLabel(i18n("Cate&gory:"), grid); - layout->addWidget(label, ++row, 0); + label = new TQLabel(i18n("Cate&gory:"), grid); + tqlayout->addWidget(label, ++row, 0); m_catCombo = new KComboBox(true, grid); - layout->addWidget(m_catCombo, row, 1); + tqlayout->addWidget(m_catCombo, row, 1); label->setBuddy(m_catCombo); whats = i18n("The field category determines where the field is placed in the editor."); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_catCombo, whats); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_catCombo, whats); // I don't want to include the categories for singleCategory fields - QStringList cats; - const QStringList allCats = m_coll->fieldCategories(); - for(QStringList::ConstIterator it = allCats.begin(); it != allCats.end(); ++it) { + TQStringList cats; + const TQStringList allCats = m_coll->fieldCategories(); + for(TQStringList::ConstIterator it = allCats.begin(); it != allCats.end(); ++it) { Data::FieldVec fields = m_coll->fieldsByCategory(*it); if(!fields.isEmpty() && !fields.begin()->isSingleCategory()) { cats.append(*it); @@ -174,105 +174,105 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par } m_catCombo->insertStringList(cats); m_catCombo->setDuplicatesEnabled(false); - connect(m_catCombo, SIGNAL(textChanged(const QString&)), SLOT(slotModified())); + connect(m_catCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); - label = new QLabel(i18n("Descr&iption:"), grid); - layout->addWidget(label, ++row, 0); + label = new TQLabel(i18n("Descr&iption:"), grid); + tqlayout->addWidget(label, ++row, 0); m_descEdit = new KLineEdit(grid); m_descEdit->setMinimumWidth(150); - layout->addMultiCellWidget(m_descEdit, row, row, 1, 3); + tqlayout->addMultiCellWidget(m_descEdit, row, row, 1, 3); label->setBuddy(m_descEdit); /* TRANSLATORS: Do not translate %{year} and %{title}. */ whats = i18n("The description is a useful reminder of what information is contained in the " "field. For <i>Dependent</i> fields, the description is a format string such as " "\"%{year} %{title}\" where the named fields get substituted in the string."); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_descEdit, whats); - connect(m_descEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified())); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_descEdit, whats); + connect(m_descEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); - label = new QLabel(i18n("&Default value:"), grid); - layout->addWidget(label, ++row, 0); + label = new TQLabel(i18n("&Default value:"), grid); + tqlayout->addWidget(label, ++row, 0); m_defaultEdit = new KLineEdit(grid); - layout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); + tqlayout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); label->setBuddy(m_defaultEdit); whats = i18n("<qt>A default value can be set for new entries.</qt>"); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_defaultEdit, whats); - connect(m_defaultEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified())); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_defaultEdit, whats); + connect(m_defaultEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); - label = new QLabel(i18n("A&llowed values:"), grid); - layout->addWidget(label, ++row, 0); + label = new TQLabel(i18n("A&llowed values:"), grid); + tqlayout->addWidget(label, ++row, 0); m_allowEdit = new KLineEdit(grid); - layout->addMultiCellWidget(m_allowEdit, row, row, 1, 3); + tqlayout->addMultiCellWidget(m_allowEdit, row, row, 1, 3); label->setBuddy(m_allowEdit); whats = i18n("<qt>For <i>Choice</i>-type fields, these are the only values allowed. They are " "placed in a combo box. The possible values have to be separated by a semi-colon, " "for example: \"dog; cat; mouse\"</qt>"); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_allowEdit, whats); - connect(m_allowEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified())); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_allowEdit, whats); + connect(m_allowEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); - label = new QLabel(i18n("Extended &properties:"), grid); - layout->addWidget(label, ++row, 0); + label = new TQLabel(i18n("Extended &properties:"), grid); + tqlayout->addWidget(label, ++row, 0); m_btnExtended = new KPushButton(i18n("&Set..."), grid); - m_btnExtended->setIconSet(BarIcon(QString::fromLatin1("bookmark"), KIcon::SizeSmall)); - layout->addWidget(m_btnExtended, row, 1); + m_btnExtended->setIconSet(BarIcon(TQString::tqfromLatin1("bookmark"), KIcon::SizeSmall)); + tqlayout->addWidget(m_btnExtended, row, 1); label->setBuddy(m_btnExtended); whats = i18n("Extended field properties are used to specify things such as the corresponding bibtex field."); - QWhatsThis::add(label, whats); - QWhatsThis::add(m_btnExtended, whats); - connect(m_btnExtended, SIGNAL(clicked()), SLOT(slotShowExtendedProperties())); + TQWhatsThis::add(label, whats); + TQWhatsThis::add(m_btnExtended, whats); + connect(m_btnExtended, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowExtendedProperties())); - QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, i18n("Format Options"), vbox); - m_formatNone = new QRadioButton(i18n("No formatting"), bg); - QWhatsThis::add(m_formatNone, i18n("This option prevents the field from ever being " + TQButtonGroup* bg = new TQButtonGroup(1, Qt::Horizontal, i18n("Format Options"), vbox); + m_formatNone = new TQRadioButton(i18n("No formatting"), bg); + TQWhatsThis::add(m_formatNone, i18n("This option prevents the field from ever being " "automatically formatted or capitalized.")); - m_formatPlain = new QRadioButton(i18n("Allow auto-capitalization only"), bg); - QWhatsThis::add(m_formatPlain, i18n("This option allows the field to be capitalized, but " + m_formatPlain = new TQRadioButton(i18n("Allow auto-capitalization only"), bg); + TQWhatsThis::add(m_formatPlain, i18n("This option allows the field to be capitalized, but " "not specially formatted.")); - m_formatTitle = new QRadioButton(i18n("Format as a title"), bg); - QWhatsThis::add(m_formatTitle, i18n("This option capitalizes and formats the field as a " + m_formatTitle = new TQRadioButton(i18n("Format as a title"), bg); + TQWhatsThis::add(m_formatTitle, i18n("This option capitalizes and formats the field as a " "title, but only if those options are globally set.")); - m_formatName = new QRadioButton(i18n("Format as a name"), bg); - QWhatsThis::add(m_formatName, i18n("This option capitalizes and formats the field as a " + m_formatName = new TQRadioButton(i18n("Format as a name"), bg); + TQWhatsThis::add(m_formatName, i18n("This option capitalizes and formats the field as a " "name, but only if those options are globally set.")); - connect(bg, SIGNAL(clicked(int)), SLOT(slotModified())); + connect(bg, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotModified())); - QGroupBox* optionsGroup = new QGroupBox(1, Qt::Horizontal, i18n("Field Options"), vbox); - m_complete = new QCheckBox(i18n("Enable auto-completion"), optionsGroup); - QWhatsThis::add(m_complete, i18n("If checked, KDE auto-completion will be enabled in the " + TQGroupBox* optionsGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Field Options"), vbox); + m_complete = new TQCheckBox(i18n("Enable auto-completion"), optionsGroup); + TQWhatsThis::add(m_complete, i18n("If checked, KDE auto-completion will be enabled in the " "text edit box for this field.")); - m_multiple = new QCheckBox(i18n("Allow multiple values"), optionsGroup); - QWhatsThis::add(m_multiple, i18n("If checked, Tellico will parse the values in the field " + m_multiple = new TQCheckBox(i18n("Allow multiple values"), optionsGroup); + TQWhatsThis::add(m_multiple, i18n("If checked, Tellico will parse the values in the field " "for multiple values, separated by a semi-colon.")); - m_grouped = new QCheckBox(i18n("Allow grouping"), optionsGroup); - QWhatsThis::add(m_grouped, i18n("If checked, this field may be used to group the entries in " + m_grouped = new TQCheckBox(i18n("Allow grouping"), optionsGroup); + TQWhatsThis::add(m_grouped, i18n("If checked, this field may be used to group the entries in " "the group view.")); - connect(m_complete, SIGNAL(clicked()), SLOT(slotModified())); - connect(m_multiple, SIGNAL(clicked()), SLOT(slotModified())); - connect(m_grouped, SIGNAL(clicked()), SLOT(slotModified())); + connect(m_complete, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified())); + connect(m_multiple, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified())); + connect(m_grouped, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified())); // need to stretch at bottom - vbox->setStretchFactor(new QWidget(vbox), 1); + vbox->setStretchFactor(new TQWidget(vbox), 1); KAcceleratorManager::manage(vbox); // keep a default collection m_defaultCollection = CollectionFactory::collection(m_coll->type(), true); - QWhatsThis::add(actionButton(KDialogBase::Default), + TQWhatsThis::add(actionButton(KDialogBase::Default), i18n("Revert the selected field's properties to the default values.")); enableButtonOK(false); enableButtonApply(false); - setHelp(QString::fromLatin1("fields-dialog")); + setHelp(TQString::tqfromLatin1("fields-dialog")); // initially the m_typeCombo is populated with all types, but as soon as something is // selected in the fields box, the combo box is cleared and filled with the allowable // new types. The problem is that when more types are added, the size of the combo box // doesn't change. So when everything is laid out, the combo box needs to have all the // items there. - QTimer::singleShot(0, this, SLOT(slotSelectInitial())); + TQTimer::singleShot(0, this, TQT_SLOT(slotSelectInitial())); } CollectionFieldsDialog::~CollectionFieldsDialog() { @@ -310,26 +310,26 @@ void CollectionFieldsDialog::applyChanges() { field = it; // check for Choice fields with removed values to warn user if(field->type() == Data::Field::Choice || field->type() == Data::Field::Rating) { - QStringList oldValues = m_coll->fieldByName(field->name())->allowed(); - QStringList newValues = field->allowed(); - for(QStringList::ConstIterator vIt = oldValues.begin(); vIt != oldValues.end(); ++vIt) { - if(newValues.contains(*vIt)) { + TQStringList oldValues = m_coll->fieldByName(field->name())->allowed(); + TQStringList newValues = field->allowed(); + for(TQStringList::ConstIterator vIt = oldValues.begin(); vIt != oldValues.end(); ++vIt) { + if(newValues.tqcontains(*vIt)) { continue; } int ret = KMessageBox::warningContinueCancel(this, i18n("<qt>Removing allowed values from the <i>%1</i> field which " "currently exist in the collection may cause data corruption. " "Do you want to keep your modified values or cancel and revert " - "to the current ones?</qt>").arg(field->title()), - QString::null, + "to the current ones?</qt>").tqarg(field->title()), + TQString(), i18n("Keep modified values")); if(ret != KMessageBox::Continue) { if(field->type() == Data::Field::Choice) { field->setAllowed(oldValues); } else { // rating field Data::FieldPtr oldField = m_coll->fieldByName(field->name()); - field->setProperty(QString::fromLatin1("minimum"), oldField->property(QString::fromLatin1("minimum"))); - field->setProperty(QString::fromLatin1("maximum"), oldField->property(QString::fromLatin1("maximum"))); + field->setProperty(TQString::tqfromLatin1("minimum"), oldField->property(TQString::tqfromLatin1("minimum"))); + field->setProperty(TQString::tqfromLatin1("maximum"), oldField->property(TQString::tqfromLatin1("maximum"))); } } break; @@ -344,7 +344,7 @@ void CollectionFieldsDialog::applyChanges() { // set all text not to be colored, and get new list Data::FieldVec fields; - for(QListBoxItem* item = m_fieldsBox->firstItem(); item; item = item->next()) { + for(TQListBoxItem* item = m_fieldsBox->firstItem(); item; item = item->next()) { static_cast<FieldListBox*>(item)->setColored(false); if(m_reordered) { Data::FieldPtr field = static_cast<FieldListBox*>(item)->field(); @@ -384,7 +384,7 @@ void CollectionFieldsDialog::applyChanges() { // but we don't care about UI indications of changes bool wasUpdating = m_updatingValues; m_updatingValues = true; - QString currType = m_typeCombo->currentText(); + TQString currType = m_typeCombo->currentText(); m_typeCombo->clear(); m_typeCombo->insertStringList(newTypesAllowed(m_currentField->type())); m_typeCombo->setCurrentItem(currType); @@ -404,12 +404,12 @@ void CollectionFieldsDialog::slotNew() { return; } - QString name = QString::fromLatin1("custom") + QString::number(m_newFields.count()+1); + TQString name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); int count = m_newFields.count() + 1; - QString title = i18n("New Field") + QString::fromLatin1(" %1").arg(count); - while(m_fieldsBox->findItem(title)) { + TQString title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); + while(m_fieldsBox->tqfindItem(title)) { ++count; - title = i18n("New Field") + QString::fromLatin1(" %1").arg(count); + title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); } Data::FieldPtr field = new Data::Field(name, title); @@ -432,7 +432,7 @@ void CollectionFieldsDialog::slotDelete() { return; } - if(m_newFields.contains(m_currentField)) { + if(m_newFields.tqcontains(m_currentField)) { // remove field from vector before deleting item containing field m_newFields.remove(m_currentField); m_fieldsBox->removeItem(m_fieldsBox->currentItem()); @@ -453,7 +453,7 @@ void CollectionFieldsDialog::slotDelete() { } } -void CollectionFieldsDialog::slotTypeChanged(const QString& type_) { +void CollectionFieldsDialog::slotTypeChanged(const TQString& type_) { Data::Field::Type type = Data::Field::Undef; const Data::Field::FieldMap fieldMap = Data::Field::typeMap(); for(Data::Field::FieldMap::ConstIterator it = fieldMap.begin(); it != fieldMap.end(); ++it) { @@ -533,7 +533,7 @@ void CollectionFieldsDialog::slotHighlightedChanged(int index_) { // type is limited to certain types, unless it's a new field m_typeCombo->clear(); - if(m_newFields.contains(field)) { + if(m_newFields.tqcontains(field)) { m_typeCombo->insertStringList(newTypesAllowed(Data::Field::Undef)); } else { m_typeCombo->insertStringList(newTypesAllowed(field->type())); @@ -544,7 +544,7 @@ void CollectionFieldsDialog::slotHighlightedChanged(int index_) { slotTypeChanged(fieldMap[field->type()]); // just setting the text doesn't emit the activated signal if(field->type() == Data::Field::Choice) { - m_allowEdit->setText(field->allowed().join(QString::fromLatin1("; "))); + m_allowEdit->setText(field->allowed().join(TQString::tqfromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -601,19 +601,19 @@ void CollectionFieldsDialog::updateField() { } // only update name if it's one of the new ones - if(m_newFields.contains(field)) { + if(m_newFields.tqcontains(field)) { // name needs to be a valid XML element name - QString name = XML::elementName(m_titleEdit->text().lower()); + TQString name = XML::elementName(m_titleEdit->text().lower()); if(name.isEmpty()) { // might end up with empty string - name = QString::fromLatin1("custom") + QString::number(m_newFields.count()+1); + name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); } while(m_coll->hasField(name)) { // ensure name uniqueness - name += QString::fromLatin1("-new"); + name += TQString::tqfromLatin1("-new"); } field->setName(name); } - const QString title = m_titleEdit->text().simplifyWhiteSpace(); + const TQString title = m_titleEdit->text().simplifyWhiteSpace(); updateTitle(title); const Data::Field::FieldMap& fieldMap = Data::Field::typeMap(); @@ -625,25 +625,25 @@ void CollectionFieldsDialog::updateField() { } if(field->type() == Data::Field::Choice) { - const QRegExp rx(QString::fromLatin1("\\s*;\\s*")); - field->setAllowed(QStringList::split(rx, m_allowEdit->text())); - field->setProperty(QString::fromLatin1("minimum"), QString::null); - field->setProperty(QString::fromLatin1("maximum"), QString::null); + const TQRegExp rx(TQString::tqfromLatin1("\\s*;\\s*")); + field->setAllowed(TQStringList::split(rx, m_allowEdit->text())); + field->setProperty(TQString::tqfromLatin1("minimum"), TQString()); + field->setProperty(TQString::tqfromLatin1("maximum"), TQString()); } else if(field->type() == Data::Field::Rating) { - QString v = field->property(QString::fromLatin1("minimum")); + TQString v = field->property(TQString::tqfromLatin1("minimum")); if(v.isEmpty()) { - field->setProperty(QString::fromLatin1("minimum"), QString::number(1)); + field->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(1)); } - v = field->property(QString::fromLatin1("maximum")); + v = field->property(TQString::tqfromLatin1("maximum")); if(v.isEmpty()) { - field->setProperty(QString::fromLatin1("maximum"), QString::number(5)); + field->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(5)); } } if(field->isSingleCategory()) { field->setCategory(field->title()); } else { - QString category = m_catCombo->currentText().simplifyWhiteSpace(); + TQString category = m_catCombo->currentText().simplifyWhiteSpace(); field->setCategory(category); m_catCombo->setCurrentItem(category, true); // if it doesn't exist, it's added } @@ -699,13 +699,13 @@ void CollectionFieldsDialog::slotModified() { static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->setColored(true); // check if copy exists already - if(m_copiedFields.contains(m_currentField)) { + if(m_copiedFields.tqcontains(m_currentField)) { return; } // or, check if is a new field, in which case no copy is needed // check if copy exists already - if(m_newFields.contains(m_currentField)) { + if(m_newFields.tqcontains(m_currentField)) { return; } @@ -714,7 +714,7 @@ void CollectionFieldsDialog::slotModified() { static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->setField(m_currentField); } -void CollectionFieldsDialog::updateTitle(const QString& title_) { +void CollectionFieldsDialog::updateTitle(const TQString& title_) { // myDebug() << "CollectionFieldsDialog::updateTitle()" << endl; if(m_currentField && m_currentField->title() != title_) { m_fieldsBox->blockSignals(true); @@ -742,10 +742,10 @@ void CollectionFieldsDialog::slotDefault() { return; } - QString caption = i18n("Revert Field Properties"); - QString text = i18n("<qt><p>Do you really want to revert the properties for the <em>%1</em> " - "field back to their default values?</p></qt>").arg(m_currentField->title()); - QString dontAsk = QString::fromLatin1("RevertFieldProperties"); + TQString caption = i18n("Revert Field Properties"); + TQString text = i18n("<qt><p>Do you really want to revert the properties for the <em>%1</em> " + "field back to their default values?</p></qt>").tqarg(m_currentField->title()); + TQString dontAsk = TQString::tqfromLatin1("RevertFieldProperties"); int ret = KMessageBox::warningContinueCancel(this, text, caption, i18n("Revert"), dontAsk); if(ret != KMessageBox::Continue) { return; @@ -760,7 +760,7 @@ void CollectionFieldsDialog::slotDefault() { slotTypeChanged(fieldMap[defaultField->type()]); // just setting the text doesn't emit the activated signal if(defaultField->type() == Data::Field::Choice) { - m_allowEdit->setText(defaultField->allowed().join(QString::fromLatin1("; "))); + m_allowEdit->setText(defaultField->allowed().join(TQString::tqfromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -806,7 +806,7 @@ void CollectionFieldsDialog::slotDefault() { } void CollectionFieldsDialog::slotMoveUp() { - QListBoxItem* item = m_fieldsBox->selectedItem(); + TQListBoxItem* item = m_fieldsBox->selectedItem(); if(item) { FieldListBox* prev = static_cast<FieldListBox*>(item->prev()); // could be 0 if(prev) { @@ -829,7 +829,7 @@ void CollectionFieldsDialog::slotMoveUp() { void CollectionFieldsDialog::slotMoveDown() { FieldListBox* item = dynamic_cast<FieldListBox*>(m_fieldsBox->selectedItem()); if(item) { - QListBoxItem* next = item->next(); // could be 0 + TQListBoxItem* next = item->next(); // could be 0 if(next) { FieldListBox* newItem = new FieldListBox(m_fieldsBox, item->field(), next); newItem->setColored(item->isColored()); @@ -846,9 +846,9 @@ void CollectionFieldsDialog::slotMoveDown() { enableButtonApply(true); } -Tellico::FieldListBox* CollectionFieldsDialog::findItem(const QListBox* box_, Data::FieldPtr field_) { +Tellico::FieldListBox* CollectionFieldsDialog::findItem(const TQListBox* box_, Data::FieldPtr field_) { // myDebug() << "CollectionFieldsDialog::findItem()" << endl; - for(QListBoxItem* item = box_->firstItem(); item; item = item->next()) { + for(TQListBoxItem* item = box_->firstItem(); item; item = item->next()) { FieldListBox* textItem = static_cast<FieldListBox*>(item); if(textItem->field() == field_) { return textItem; @@ -864,17 +864,17 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() { // the default value is included in properties, but it has a // separate edit box - QString dv = m_currentField->defaultValue(); + TQString dv = m_currentField->defaultValue(); StringMap props = m_currentField->propertyList(); - props.remove(QString::fromLatin1("default")); + props.remove(TQString::tqfromLatin1("default")); StringMapDialog dlg(props, this, "ExtendedPropertiesDialog", true); dlg.setCaption(i18n("Extended Field Properties")); dlg.setLabels(i18n("Property"), i18n("Value")); - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { props = dlg.stringMap(); if(!dv.isEmpty()) { - props.insert(QString::fromLatin1("default"), dv); + props.insert(TQString::tqfromLatin1("default"), dv); } m_currentField->setPropertyList(props); slotModified(); @@ -888,7 +888,7 @@ bool CollectionFieldsDialog::checkValues() { return true; } - const QString title = m_currentField->title(); + const TQString title = m_currentField->title(); // find total number of boxes with this title in case multiple new ones with same title were added int titleCount = 0; for(uint i = 0; i < m_fieldsBox->count(); ++i) { @@ -904,7 +904,7 @@ bool CollectionFieldsDialog::checkValues() { return false; } - const QString category = m_currentField->category(); + const TQString category = m_currentField->category(); if(category.isEmpty()) { KMessageBox::sorry(this, i18n("<qt>The category may not be empty. Please enter a category.</qt>")); m_catCombo->lineEdit()->selectAll(); @@ -931,26 +931,26 @@ bool CollectionFieldsDialog::checkValues() { // check for rating values outside bounds if(m_currentField->type() == Data::Field::Rating) { bool ok; // ok to ignore this here - int low = Tellico::toUInt(m_currentField->property(QString::fromLatin1("minimum")), &ok); - int high = Tellico::toUInt(m_currentField->property(QString::fromLatin1("maximum")), &ok); + int low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok); + int high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); while(low < 1 || low > 9 || high < 1 || high > 10 || low >= high) { KMessageBox::sorry(this, i18n("The range for a rating field must be between 1 and 10, " "and the lower bound must be less than the higher bound. " "Please enter different low and high properties.")); if(slotShowExtendedProperties()) { - low = Tellico::toUInt(m_currentField->property(QString::fromLatin1("minimum")), &ok); - high = Tellico::toUInt(m_currentField->property(QString::fromLatin1("maximum")), &ok); + low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok); + high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); } else { return false; } } } else if(m_currentField->type() == Data::Field::Table) { bool ok; // ok to ignore this here - int ncols = Tellico::toUInt(m_currentField->property(QString::fromLatin1("columns")), &ok); + int ncols = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("columns")), &ok); // also enforced in GUI::TableFieldWidget if(ncols > 10) { KMessageBox::sorry(this, i18n("Tables are limited to a maximum of ten columns.")); - m_currentField->setProperty(QString::fromLatin1("columns"), QString::fromLatin1("10")); + m_currentField->setProperty(TQString::tqfromLatin1("columns"), TQString::tqfromLatin1("10")); } } @@ -958,7 +958,7 @@ bool CollectionFieldsDialog::checkValues() { } // only certain type changes are allowed -QStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) { +TQStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) { // Undef means return all if(type_ == Data::Field::Undef) { return Data::Field::typeTitles(); @@ -966,7 +966,7 @@ QStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) { const Data::Field::FieldMap& fieldMap = Data::Field::typeMap(); - QStringList newTypes; + TQStringList newTypes; switch(type_) { case Data::Field::Line: // might not work if converted to a number or URL, but ok case Data::Field::Number: |