diff options
Diffstat (limited to 'src/tellico_kernel.cpp')
-rw-r--r-- | src/tellico_kernel.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/tellico_kernel.cpp b/src/tellico_kernel.cpp index e0e42b5..a1f8200 100644 --- a/src/tellico_kernel.cpp +++ b/src/tellico_kernel.cpp @@ -46,8 +46,8 @@ using Tellico::Kernel; Kernel* Kernel::s_self = 0; -Kernel::Kernel(MainWindow* parent) : m_widget(parent) - , m_commandHistory(parent->actionCollection()) +Kernel::Kernel(MainWindow* tqparent) : m_widget(tqparent) + , m_commandHistory(tqparent->actionCollection()) , m_commandGroup(0) { } @@ -55,19 +55,19 @@ const KURL& Kernel::URL() const { return Data::Document::self()->URL(); } -const QStringList& Kernel::fieldTitles() const { +const TQStringList& Kernel::fieldTitles() const { return Data::Document::self()->collection()->fieldTitles(); } -QString Kernel::fieldNameByTitle(const QString& title_) const { +TQString Kernel::fieldNameByTitle(const TQString& title_) const { return Data::Document::self()->collection()->fieldNameByTitle(title_); } -QString Kernel::fieldTitleByName(const QString& name_) const { +TQString Kernel::fieldTitleByName(const TQString& name_) const { return Data::Document::self()->collection()->fieldTitleByName(name_); } -QStringList Kernel::valuesByFieldName(const QString& name_) const { +TQStringList Kernel::valuesByFieldName(const TQString& name_) const { return Data::Document::self()->collection()->valuesByFieldName(name_); } @@ -75,19 +75,19 @@ int Kernel::collectionType() const { return Data::Document::self()->collection()->type(); } -QString Kernel::collectionTypeName() const { +TQString Kernel::collectionTypeName() const { return Data::Document::self()->collection()->typeName(); } -void Kernel::sorry(const QString& text_, QWidget* widget_/* =0 */) { +void Kernel::sorry(const TQString& text_, TQWidget* widget_/* =0 */) { if(text_.isEmpty()) { return; } - GUI::CursorSaver cs(Qt::arrowCursor); + GUI::CursorSaver cs(TQt::arrowCursor); KMessageBox::sorry(widget_ ? widget_ : m_widget, text_); } -void Kernel::beginCommandGroup(const QString& name_) { +void Kernel::beginCommandGroup(const TQString& name_) { if(m_commandGroup) { myDebug() << "Kernel::beginCommandGroup() - there's an uncommitted group!" << endl; delete m_commandGroup; @@ -162,7 +162,7 @@ void Kernel::addEntries(Data::EntryVec entries_, bool checkFields_) { Data::CollPtr c = Data::Document::self()->collection(); Data::FieldVec fields = entries_[0]->collection()->fields(); - QPair<Data::FieldVec, Data::FieldVec> p = mergeFields(c, fields, entries_); + TQPair<Data::FieldVec, Data::FieldVec> p = mergeFields(c, fields, entries_); Data::FieldVec modifiedFields = p.first; Data::FieldVec addedFields = p.second; @@ -213,7 +213,7 @@ bool Kernel::addLoans(Data::EntryVec entries_) { } LoanDialog dlg(entries_, m_widget); - if(dlg.exec() != QDialog::Accepted) { + if(dlg.exec() != TQDialog::Accepted) { return false; } @@ -231,7 +231,7 @@ bool Kernel::modifyLoan(Data::LoanPtr loan_) { } LoanDialog dlg(loan_, m_widget); - if(dlg.exec() != QDialog::Accepted) { + if(dlg.exec() != TQDialog::Accepted) { return false; } @@ -269,7 +269,7 @@ bool Kernel::modifyFilter(FilterPtr filter_) { // need to create a new filter object FilterPtr newFilter = new Filter(*filter_); filterDlg.setFilter(newFilter); - if(filterDlg.exec() != QDialog::Accepted) { + if(filterDlg.exec() != TQDialog::Accepted) { return false; } @@ -282,8 +282,8 @@ bool Kernel::removeFilter(FilterPtr filter_) { return false; } - QString str = i18n("Do you really want to delete this filter?"); - QString dontAsk = QString::fromLatin1("DeleteFilter"); + TQString str = i18n("Do you really want to delete this filter?"); + TQString dontAsk = TQString::tqfromLatin1("DeleteFilter"); int ret = KMessageBox::questionYesNo(m_widget, str, i18n("Delete Filter?"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk); if(ret != KMessageBox::Yes) { @@ -320,7 +320,7 @@ void Kernel::replaceCollection(Data::CollPtr coll_) { void Kernel::renameCollection() { bool ok; - QString newTitle = KInputDialog::getText(i18n("Rename Collection"), i18n("New collection name:"), + TQString newTitle = KInputDialog::getText(i18n("Rename Collection"), i18n("New collection name:"), Data::Document::self()->collection()->title(), &ok, m_widget); if(ok) { doCommand(new Command::RenameCollection(Data::Document::self()->collection(), newTitle)); @@ -336,7 +336,7 @@ void Kernel::doCommand(KCommand* command_) { } } -QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data::CollPtr coll_, +TQPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data::CollPtr coll_, Data::FieldVec fields_, Data::EntryVec entries_) { Data::FieldVec modified, created; @@ -345,8 +345,8 @@ QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data if(coll_->hasField(field->name()) || CollectionFactory::isDefaultField(coll_->type(), field->name())) { // special case for choice fields, since we might want to add a value if(field->type() == Data::Field::Choice && coll_->hasField(field->name())) { - QStringList a1 = field->allowed(); - QStringList a2 = coll_->fieldByName(field->name())->allowed(); + TQStringList a1 = field->allowed(); + TQStringList a2 = coll_->fieldByName(field->name())->allowed(); if(a1 != a2) { StringSet a; a.add(a1); @@ -366,13 +366,13 @@ QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data } } } - return qMakePair(modified, created); + return tqMakePair(modified, created); } int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::FieldPtr field_, - QString value1_, QString value2_) { - QString title1 = entry1_->field(QString::fromLatin1("title")); - QString title2 = entry2_->field(QString::fromLatin1("title")); + TQString value1_, TQString value2_) { + TQString title1 = entry1_->field(TQString::tqfromLatin1("title")); + TQString title2 = entry2_->field(TQString::tqfromLatin1("title")); if(title1 == title2) { title1 = i18n("Entry 1"); title2 = i18n("Entry 2"); @@ -383,21 +383,21 @@ int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::Fi if(value2_.isEmpty()) { value2_ = entry2_->field(field_); } - QString text = QString::fromLatin1("<qt>") - + i18n("Conflicting values for %1 were found while merging entries.").arg(field_->title()) - + QString::fromLatin1("<br/><center><table><tr>" + TQString text = TQString::tqfromLatin1("<qt>") + + i18n("Conflicting values for %1 were found while merging entries.").tqarg(field_->title()) + + TQString::tqfromLatin1("<br/><center><table><tr>" "<th>%1</th>" - "<th>%2</th></tr>").arg(title1, title2) - + QString::fromLatin1("<tr><td><em>%1</em></td>").arg(value1_) - + QString::fromLatin1("<td><em>%1</em></td></tr></table></center>").arg(value2_) + "<th>%2</th></tr>").tqarg(title1, title2) + + TQString::tqfromLatin1("<tr><td><em>%1</em></td>").tqarg(value1_) + + TQString::tqfromLatin1("<td><em>%1</em></td></tr></table></center>").tqarg(value2_) + i18n("Please choose which value to keep.") - + QString::fromLatin1("</qt>"); + + TQString::tqfromLatin1("</qt>"); int ret = KMessageBox::warningYesNoCancel(Kernel::self()->widget(), text, i18n("Merge Entries"), - i18n("Select value from %1").arg(title1), - i18n("Select value from %1").arg(title2)); + i18n("Select value from %1").tqarg(title1), + i18n("Select value from %1").tqarg(title2)); switch(ret) { case KMessageBox::Cancel: return 0; case KMessageBox::Yes: return -1; // keep original value |