diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/loandialog.cpp | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/loandialog.cpp')
-rw-r--r-- | src/loandialog.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/loandialog.cpp b/src/loandialog.cpp index e34ecc7..5835c53 100644 --- a/src/loandialog.cpp +++ b/src/loandialog.cpp @@ -28,22 +28,22 @@ #include <kiconloader.h> #include <kabc/stdaddressbook.h> -#include <qlayout.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qwhatsthis.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> using Tellico::LoanDialog; -LoanDialog::LoanDialog(const Data::EntryVec& entries_, QWidget* parent_, const char* name_/*=0*/) - : KDialogBase(parent_, name_, true, i18n("Loan Dialog"), Ok|Cancel), +LoanDialog::LoanDialog(const Data::EntryVec& entries_, TQWidget* tqparent_, const char* name_/*=0*/) + : KDialogBase(tqparent_, name_, true, i18n("Loan Dialog"), Ok|Cancel), m_mode(Add), m_borrower(0), m_entries(entries_), m_loan(0) { init(); } -LoanDialog::LoanDialog(Data::LoanPtr loan_, QWidget* parent_, const char* name_/*=0*/) - : KDialogBase(parent_, name_, true, i18n("Modify Loan"), Ok|Cancel), +LoanDialog::LoanDialog(Data::LoanPtr loan_, TQWidget* tqparent_, const char* name_/*=0*/) + : KDialogBase(tqparent_, name_, true, i18n("Modify Loan"), Ok|Cancel), m_mode(Modify), m_borrower(loan_->borrower()), m_loan(loan_) { m_entries.append(m_loan->entry()); @@ -62,117 +62,117 @@ LoanDialog::LoanDialog(Data::LoanPtr loan_, QWidget* parent_, const char* name_/ } void LoanDialog::init() { - QWidget* mainWidget = new QWidget(this, "LoanDialog mainWidget"); + TQWidget* mainWidget = new TQWidget(this, "LoanDialog mainWidget"); setMainWidget(mainWidget); - QGridLayout* topLayout = new QGridLayout(mainWidget, 7, 2, 0, KDialog::spacingHint()); + TQGridLayout* topLayout = new TQGridLayout(mainWidget, 7, 2, 0, KDialog::spacingHint()); - QHBox* hbox = new QHBox(mainWidget); + TQHBox* hbox = new TQHBox(mainWidget); hbox->setSpacing(KDialog::spacingHint()); - QLabel* pixLabel = new QLabel(hbox); - pixLabel->setPixmap(DesktopIcon(QString::fromLatin1("tellico"), 64)); - pixLabel->setAlignment(Qt::AlignAuto | Qt::AlignTop); + TQLabel* pixLabel = new TQLabel(hbox); + pixLabel->setPixmap(DesktopIcon(TQString::tqfromLatin1("tellico"), 64)); + pixLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignTop); hbox->setStretchFactor(pixLabel, 0); - QString entryString = QString::fromLatin1("<qt><p>"); + TQString entryString = TQString::tqfromLatin1("<qt><p>"); if(m_mode == Add) { entryString += i18n("The following items are being checked out:"); - entryString += QString::fromLatin1("</p><ol>"); + entryString += TQString::tqfromLatin1("</p><ol>"); for(Data::EntryVec::ConstIterator entry = m_entries.constBegin(); entry != m_entries.constEnd(); ++entry) { - entryString += QString::fromLatin1("<li>") + entry->title() + QString::fromLatin1("</li>"); + entryString += TQString::tqfromLatin1("<li>") + entry->title() + TQString::tqfromLatin1("</li>"); } } else { entryString += i18n("The following item is on-loan:"); - entryString += QString::fromLatin1("</p><ol>"); - entryString += QString::fromLatin1("<li>") + m_loan->entry()->title() + QString::fromLatin1("</li>"); + entryString += TQString::tqfromLatin1("</p><ol>"); + entryString += TQString::tqfromLatin1("<li>") + m_loan->entry()->title() + TQString::tqfromLatin1("</li>"); } - entryString += QString::fromLatin1("</ol></qt>"); + entryString += TQString::tqfromLatin1("</ol></qt>"); GUI::RichTextLabel* entryLabel = new GUI::RichTextLabel(entryString, hbox); hbox->setStretchFactor(entryLabel, 1); topLayout->addMultiCellWidget(hbox, 0, 0, 0, 1); - QLabel* l = new QLabel(i18n("&Lend to:"), mainWidget); + TQLabel* l = new TQLabel(i18n("&Lend to:"), mainWidget); topLayout->addWidget(l, 1, 0); - hbox = new QHBox(mainWidget); + hbox = new TQHBox(mainWidget); hbox->setSpacing(KDialog::spacingHint()); topLayout->addWidget(hbox, 1, 1); m_borrowerEdit = new KLineEdit(hbox); l->setBuddy(m_borrowerEdit); m_borrowerEdit->completionObject()->setIgnoreCase(true); - connect(m_borrowerEdit, SIGNAL(textChanged(const QString&)), - SLOT(slotBorrowerNameChanged(const QString&))); + connect(m_borrowerEdit, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(slotBorrowerNameChanged(const TQString&))); actionButton(Ok)->setEnabled(false); // disable until a name is entered - KPushButton* pb = new KPushButton(SmallIconSet(QString::fromLatin1("kaddressbook")), QString::null, hbox); - connect(pb, SIGNAL(clicked()), SLOT(slotGetBorrower())); - QString whats = i18n("Enter the name of the person borrowing the items from you. " + KPushButton* pb = new KPushButton(SmallIconSet(TQString::tqfromLatin1("kaddressbook")), TQString(), hbox); + connect(pb, TQT_SIGNAL(clicked()), TQT_SLOT(slotGetBorrower())); + TQString whats = i18n("Enter the name of the person borrowing the items from you. " "Clicking the button allows you to select from your address book."); - QWhatsThis::add(l, whats); - QWhatsThis::add(hbox, whats); + TQWhatsThis::add(l, whats); + TQWhatsThis::add(hbox, whats); // only enable for new loans if(m_mode == Modify) { m_borrowerEdit->setEnabled(false); pb->setEnabled(false); } - l = new QLabel(i18n("&Loan date:"), mainWidget); + l = new TQLabel(i18n("&Loan date:"), mainWidget); topLayout->addWidget(l, 2, 0); m_loanDate = new GUI::DateWidget(mainWidget); - m_loanDate->setDate(QDate::currentDate()); + m_loanDate->setDate(TQDate::tqcurrentDate()); l->setBuddy(m_loanDate); topLayout->addWidget(m_loanDate, 2, 1); whats = i18n("The check-out date is the date that you lent the items. By default, " "today's date is used."); - QWhatsThis::add(l, whats); - QWhatsThis::add(m_loanDate, whats); + TQWhatsThis::add(l, whats); + TQWhatsThis::add(m_loanDate, whats); // only enable for new loans if(m_mode == Modify) { m_loanDate->setEnabled(false); } - l = new QLabel(i18n("D&ue date:"), mainWidget); + l = new TQLabel(i18n("D&ue date:"), mainWidget); topLayout->addWidget(l, 3, 0); m_dueDate = new GUI::DateWidget(mainWidget); l->setBuddy(m_dueDate); topLayout->addWidget(m_dueDate, 3, 1); // valid due dates will enable the calendar adding checkbox - connect(m_dueDate, SIGNAL(signalModified()), SLOT(slotDueDateChanged())); + connect(m_dueDate, TQT_SIGNAL(signalModified()), TQT_SLOT(slotDueDateChanged())); whats = i18n("The due date is when the items are due to be returned. The due date " "is not required, unless you want to add the loan to your active calendar."); - QWhatsThis::add(l, whats); - QWhatsThis::add(m_dueDate, whats); + TQWhatsThis::add(l, whats); + TQWhatsThis::add(m_dueDate, whats); - l = new QLabel(i18n("&Note:"), mainWidget); + l = new TQLabel(i18n("&Note:"), mainWidget); topLayout->addWidget(l, 4, 0); m_note = new KTextEdit(mainWidget); l->setBuddy(m_note); topLayout->addMultiCellWidget(m_note, 5, 5, 0, 1); topLayout->setRowStretch(5, 1); whats = i18n("You can add notes about the loan, as well."); - QWhatsThis::add(l, whats); - QWhatsThis::add(m_note, whats); + TQWhatsThis::add(l, whats); + TQWhatsThis::add(m_note, whats); - m_addEvent = new QCheckBox(i18n("&Add a reminder to the active calendar"), mainWidget); + m_addEvent = new TQCheckBox(i18n("&Add a reminder to the active calendar"), mainWidget); topLayout->addMultiCellWidget(m_addEvent, 6, 6, 0, 1); m_addEvent->setEnabled(false); // gets enabled when valid due date is entered - QWhatsThis::add(m_addEvent, i18n("<qt>Checking this box will add a <em>To-do</em> item " + TQWhatsThis::add(m_addEvent, i18n("<qt>Checking this box will add a <em>To-do</em> item " "to your active calendar, which can be viewed using KOrganizer. " "The box is only active if you set a due date.")); - resize(configDialogSize(QString::fromLatin1("Loan Dialog Options"))); + resize(configDialogSize(TQString::tqfromLatin1("Loan Dialog Options"))); KABC::AddressBook* abook = KABC::StdAddressBook::self(true); - connect(abook, SIGNAL(addressBookChanged(AddressBook*)), - SLOT(slotLoadAddressBook())); - connect(abook, SIGNAL(loadingFinished(Resource*)), - SLOT(slotLoadAddressBook())); + connect(abook, TQT_SIGNAL(addressBookChanged(AddressBook*)), + TQT_SLOT(slotLoadAddressBook())); + connect(abook, TQT_SIGNAL(loadingFinished(Resource*)), + TQT_SLOT(slotLoadAddressBook())); slotLoadAddressBook(); } LoanDialog::~LoanDialog() { - saveDialogSize(QString::fromLatin1("Loan Dialog Options")); + saveDialogSize(TQString::tqfromLatin1("Loan Dialog Options")); } -void LoanDialog::slotBorrowerNameChanged(const QString& str_) { +void LoanDialog::slotBorrowerNameChanged(const TQString& str_) { actionButton(Ok)->setEnabled(!str_.isEmpty()); } @@ -200,11 +200,11 @@ void LoanDialog::slotLoadAddressBook() { } // add current borrowers, too - QStringList items = m_borrowerEdit->completionObject()->items(); + TQStringList items = m_borrowerEdit->completionObject()->items(); Data::BorrowerVec borrowers = m_entries.begin()->collection()->borrowers(); for(Data::BorrowerVec::ConstIterator it = borrowers.constBegin(), end = borrowers.constEnd(); it != end; ++it) { - if(items.findIndex(it->name()) == -1) { + if(items.tqfindIndex(it->name()) == -1) { m_borrowerEdit->completionObject()->addItem(it->name()); } } @@ -212,7 +212,7 @@ void LoanDialog::slotLoadAddressBook() { KCommand* LoanDialog::createCommand() { // first, check to see if the borrower is empty - QString name = m_borrowerEdit->text(); + TQString name = m_borrowerEdit->text(); if(name.isEmpty()) { return 0; } @@ -230,7 +230,7 @@ KCommand* LoanDialog::addLoansCommand() { return 0; } - const QString name = m_borrowerEdit->text(); + const TQString name = m_borrowerEdit->text(); // see if there's a borrower with this name already m_borrower = 0; |