diff options
author | Timothy Pearson <[email protected]> | 2011-12-15 15:34:15 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-15 15:34:15 -0600 |
commit | 031454e56009d576589c28757f6c6fcf4884095e (patch) | |
tree | ad4c9959d05a814c9090e8fe63ba27057903271b /src/collectionfieldsdialog.cpp | |
parent | 54011e0e1af8cd96162160ecf5d361a59a2c733e (diff) | |
download | tellico-031454e56009d576589c28757f6c6fcf4884095e.tar.gz tellico-031454e56009d576589c28757f6c6fcf4884095e.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/collectionfieldsdialog.cpp')
-rw-r--r-- | src/collectionfieldsdialog.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/collectionfieldsdialog.cpp b/src/collectionfieldsdialog.cpp index 61102a2..fec6fe7 100644 --- a/src/collectionfieldsdialog.cpp +++ b/src/collectionfieldsdialog.cpp @@ -30,7 +30,7 @@ #include <kaccelmanager.h> #include <tqgroupbox.h> -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqvbox.h> #include <tqlabel.h> @@ -82,10 +82,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQHBox* hb1 = new TQHBox(fieldsGroup); hb1->setSpacing(KDialog::spacingHint()); m_btnNew = new KPushButton(i18n("New Field", "&New"), hb1); - m_btnNew->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall)); + m_btnNew->setIconSet(BarIcon(TQString::fromLatin1("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(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall)); + m_btnDelete->setIconSet(BarIconSet(TQString::fromLatin1("editdelete"), KIcon::SizeSmall)); TQWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection")); connect(m_btnNew, TQT_SIGNAL(clicked()), TQT_SLOT(slotNew()) ); @@ -94,13 +94,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQHBox* hb2 = new TQHBox(fieldsGroup); hb2->setSpacing(KDialog::spacingHint()); m_btnUp = new KPushButton(hb2); - m_btnUp->setPixmap(BarIcon(TQString::tqfromLatin1("up"), KIcon::SizeSmall)); + m_btnUp->setPixmap(BarIcon(TQString::fromLatin1("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.")); + "for the layout of the entry editor.")); m_btnDown = new KPushButton(hb2); - m_btnDown->setPixmap(BarIcon(TQString::tqfromLatin1("down"), KIcon::SizeSmall)); + m_btnDown->setPixmap(BarIcon(TQString::fromLatin1("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.")); + "for the layout of the entry editor.")); connect(m_btnUp, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp()) ); connect(m_btnDown, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown())); @@ -113,13 +113,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa TQWidget* grid = new TQWidget(propGroup); // (parent, nrows, ncols, margin, spacing) - TQGridLayout* tqlayout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); + TQGridLayout* layout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint()); int row = -1; TQLabel* label = new TQLabel(i18n("&Title:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_titleEdit = new KLineEdit(grid); - tqlayout->addWidget(m_titleEdit, row, 1); + layout->addWidget(m_titleEdit, row, 1); label->setBuddy(m_titleEdit); TQString whats = i18n("The title of the field"); TQWhatsThis::add(label, whats); @@ -127,11 +127,11 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_titleEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("T&ype:"), grid); - tqlayout->addWidget(label, row, 2); + layout->addWidget(label, row, 2); m_typeCombo = new KComboBox(grid); - tqlayout->addWidget(m_typeCombo, row, 3); + layout->addWidget(m_typeCombo, row, 3); label->setBuddy(m_typeCombo); - whats = TQString::tqfromLatin1("<qt>"); + whats = TQString::fromLatin1("<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,7 +146,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa 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 += TQString::tqfromLatin1("</qt>"); + whats += TQString::fromLatin1("</qt>"); TQWhatsThis::add(label, whats); TQWhatsThis::add(m_typeCombo, whats); // the typeTitles match the fieldMap().values() but in a better order @@ -155,9 +155,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_typeCombo, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotTypeChanged(const TQString&))); label = new TQLabel(i18n("Cate&gory:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_catCombo = new KComboBox(true, grid); - tqlayout->addWidget(m_catCombo, row, 1); + layout->addWidget(m_catCombo, row, 1); label->setBuddy(m_catCombo); whats = i18n("The field category determines where the field is placed in the editor."); TQWhatsThis::add(label, whats); @@ -177,10 +177,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_catCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("Descr&iption:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_descEdit = new KLineEdit(grid); m_descEdit->setMinimumWidth(150); - tqlayout->addMultiCellWidget(m_descEdit, row, row, 1, 3); + layout->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 " @@ -191,9 +191,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_descEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("&Default value:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_defaultEdit = new KLineEdit(grid); - tqlayout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); + layout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3); label->setBuddy(m_defaultEdit); whats = i18n("<qt>A default value can be set for new entries.</qt>"); TQWhatsThis::add(label, whats); @@ -201,9 +201,9 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_defaultEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("A&llowed values:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_allowEdit = new KLineEdit(grid); - tqlayout->addMultiCellWidget(m_allowEdit, row, row, 1, 3); + layout->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, " @@ -213,10 +213,10 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa connect(m_allowEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified())); label = new TQLabel(i18n("Extended &properties:"), grid); - tqlayout->addWidget(label, ++row, 0); + layout->addWidget(label, ++row, 0); m_btnExtended = new KPushButton(i18n("&Set..."), grid); - m_btnExtended->setIconSet(BarIcon(TQString::tqfromLatin1("bookmark"), KIcon::SizeSmall)); - tqlayout->addWidget(m_btnExtended, row, 1); + m_btnExtended->setIconSet(BarIcon(TQString::fromLatin1("bookmark"), KIcon::SizeSmall)); + layout->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."); TQWhatsThis::add(label, whats); @@ -265,7 +265,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa enableButtonOK(false); enableButtonApply(false); - setHelp(TQString::tqfromLatin1("fields-dialog")); + setHelp(TQString::fromLatin1("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 @@ -320,7 +320,7 @@ void CollectionFieldsDialog::applyChanges() { 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>").tqarg(field->title()), + "to the current ones?</qt>").arg(field->title()), TQString(), i18n("Keep modified values")); if(ret != KMessageBox::Continue) { @@ -328,8 +328,8 @@ void CollectionFieldsDialog::applyChanges() { field->setAllowed(oldValues); } else { // rating field Data::FieldPtr oldField = m_coll->fieldByName(field->name()); - field->setProperty(TQString::tqfromLatin1("minimum"), oldField->property(TQString::tqfromLatin1("minimum"))); - field->setProperty(TQString::tqfromLatin1("maximum"), oldField->property(TQString::tqfromLatin1("maximum"))); + field->setProperty(TQString::fromLatin1("minimum"), oldField->property(TQString::fromLatin1("minimum"))); + field->setProperty(TQString::fromLatin1("maximum"), oldField->property(TQString::fromLatin1("maximum"))); } } break; @@ -404,12 +404,12 @@ void CollectionFieldsDialog::slotNew() { return; } - TQString name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); + TQString name = TQString::fromLatin1("custom") + TQString::number(m_newFields.count()+1); int count = m_newFields.count() + 1; - TQString title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); + TQString title = i18n("New Field") + TQString::fromLatin1(" %1").arg(count); while(m_fieldsBox->findItem(title)) { ++count; - title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count); + title = i18n("New Field") + TQString::fromLatin1(" %1").arg(count); } Data::FieldPtr field = new Data::Field(name, title); @@ -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(TQString::tqfromLatin1("; "))); + m_allowEdit->setText(field->allowed().join(TQString::fromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -605,10 +605,10 @@ void CollectionFieldsDialog::updateField() { // name needs to be a valid XML element name TQString name = XML::elementName(m_titleEdit->text().lower()); if(name.isEmpty()) { // might end up with empty string - name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1); + name = TQString::fromLatin1("custom") + TQString::number(m_newFields.count()+1); } while(m_coll->hasField(name)) { // ensure name uniqueness - name += TQString::tqfromLatin1("-new"); + name += TQString::fromLatin1("-new"); } field->setName(name); } @@ -625,18 +625,18 @@ void CollectionFieldsDialog::updateField() { } if(field->type() == Data::Field::Choice) { - const TQRegExp rx(TQString::tqfromLatin1("\\s*;\\s*")); + const TQRegExp rx(TQString::fromLatin1("\\s*;\\s*")); field->setAllowed(TQStringList::split(rx, m_allowEdit->text())); - field->setProperty(TQString::tqfromLatin1("minimum"), TQString()); - field->setProperty(TQString::tqfromLatin1("maximum"), TQString()); + field->setProperty(TQString::fromLatin1("minimum"), TQString()); + field->setProperty(TQString::fromLatin1("maximum"), TQString()); } else if(field->type() == Data::Field::Rating) { - TQString v = field->property(TQString::tqfromLatin1("minimum")); + TQString v = field->property(TQString::fromLatin1("minimum")); if(v.isEmpty()) { - field->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(1)); + field->setProperty(TQString::fromLatin1("minimum"), TQString::number(1)); } - v = field->property(TQString::tqfromLatin1("maximum")); + v = field->property(TQString::fromLatin1("maximum")); if(v.isEmpty()) { - field->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(5)); + field->setProperty(TQString::fromLatin1("maximum"), TQString::number(5)); } } @@ -744,8 +744,8 @@ void CollectionFieldsDialog::slotDefault() { 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"); + "field back to their default values?</p></qt>").arg(m_currentField->title()); + TQString dontAsk = TQString::fromLatin1("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(TQString::tqfromLatin1("; "))); + m_allowEdit->setText(defaultField->allowed().join(TQString::fromLatin1("; "))); } else { m_allowEdit->clear(); } @@ -866,7 +866,7 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() { // separate edit box TQString dv = m_currentField->defaultValue(); StringMap props = m_currentField->propertyList(); - props.remove(TQString::tqfromLatin1("default")); + props.remove(TQString::fromLatin1("default")); StringMapDialog dlg(props, this, "ExtendedPropertiesDialog", true); dlg.setCaption(i18n("Extended Field Properties")); @@ -874,7 +874,7 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() { if(dlg.exec() == TQDialog::Accepted) { props = dlg.stringMap(); if(!dv.isEmpty()) { - props.insert(TQString::tqfromLatin1("default"), dv); + props.insert(TQString::fromLatin1("default"), dv); } m_currentField->setPropertyList(props); slotModified(); @@ -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(TQString::tqfromLatin1("minimum")), &ok); - int high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); + int low = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("minimum")), &ok); + int high = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("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(TQString::tqfromLatin1("minimum")), &ok); - high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok); + low = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("minimum")), &ok); + high = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("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(TQString::tqfromLatin1("columns")), &ok); + int ncols = Tellico::toUInt(m_currentField->property(TQString::fromLatin1("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(TQString::tqfromLatin1("columns"), TQString::tqfromLatin1("10")); + m_currentField->setProperty(TQString::fromLatin1("columns"), TQString::fromLatin1("10")); } } |