summaryrefslogtreecommitdiffstats
path: root/src/collectionfieldsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/collectionfieldsdialog.cpp')
-rw-r--r--src/collectionfieldsdialog.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/collectionfieldsdialog.cpp b/src/collectionfieldsdialog.cpp
index 61102a2..ab02ea3 100644
--- a/src/collectionfieldsdialog.cpp
+++ b/src/collectionfieldsdialog.cpp
@@ -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,11 +94,11 @@ 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."));
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."));
@@ -131,7 +131,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa
m_typeCombo = new KComboBox(grid);
tqlayout->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
@@ -215,7 +215,7 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* pa
label = new TQLabel(i18n("Extended &properties:"), grid);
tqlayout->addWidget(label, ++row, 0);
m_btnExtended = new KPushButton(i18n("&Set..."), grid);
- m_btnExtended->setIconSet(BarIcon(TQString::tqfromLatin1("bookmark"), KIcon::SizeSmall));
+ m_btnExtended->setIconSet(BarIcon(TQString::fromLatin1("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.");
@@ -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
@@ -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").tqarg(count);
while(m_fieldsBox->findItem(title)) {
++count;
- title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count);
+ title = i18n("New Field") + TQString::fromLatin1(" %1").tqarg(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));
}
}
@@ -745,7 +745,7 @@ 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");
+ 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"));
}
}