From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kalarm/birthdaydlg.cpp | 120 ++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'kalarm/birthdaydlg.cpp') diff --git a/kalarm/birthdaydlg.cpp b/kalarm/birthdaydlg.cpp index 3c4f28ab0..98a4b629c 100644 --- a/kalarm/birthdaydlg.cpp +++ b/kalarm/birthdaydlg.cpp @@ -20,12 +20,12 @@ #include "kalarm.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -58,72 +58,72 @@ class AddresseeItem : public QListViewItem { public: enum columns { NAME = 0, BIRTHDAY = 1 }; - AddresseeItem(QListView* parent, const QString& name, const QDate& birthday); - QDate birthday() const { return mBirthday; } - virtual QString key(int column, bool ascending) const; + AddresseeItem(TQListView* parent, const TQString& name, const TQDate& birthday); + TQDate birthday() const { return mBirthday; } + virtual TQString key(int column, bool ascending) const; private: - QDate mBirthday; - QString mBirthdayOrder; + TQDate mBirthday; + TQString mBirthdayOrder; }; const KABC::AddressBook* BirthdayDlg::mAddressBook = 0; -BirthdayDlg::BirthdayDlg(QWidget* parent) +BirthdayDlg::BirthdayDlg(TQWidget* parent) : KDialogBase(KDialogBase::Plain, i18n("Import Birthdays From KAddressBook"), Ok|Cancel, Ok, parent, "BirthdayDlg"), mSpecialActionsButton(0) { - QWidget* topWidget = plainPage(); - QBoxLayout* topLayout = new QVBoxLayout(topWidget); + TQWidget* topWidget = plainPage(); + TQBoxLayout* topLayout = new TQVBoxLayout(topWidget); topLayout->setSpacing(spacingHint()); // Prefix and suffix to the name in the alarm text // Get default prefix and suffix texts from config file KConfig* config = kapp->config(); - config->setGroup(QString::fromLatin1("General")); - mPrefixText = config->readEntry(QString::fromLatin1("BirthdayPrefix"), i18n("Birthday: ")); - mSuffixText = config->readEntry(QString::fromLatin1("BirthdaySuffix")); + config->setGroup(TQString::fromLatin1("General")); + mPrefixText = config->readEntry(TQString::fromLatin1("BirthdayPrefix"), i18n("Birthday: ")); + mSuffixText = config->readEntry(TQString::fromLatin1("BirthdaySuffix")); - QGroupBox* textGroup = new QGroupBox(2, Qt::Horizontal, i18n("Alarm Text"), topWidget); + TQGroupBox* textGroup = new TQGroupBox(2, Qt::Horizontal, i18n("Alarm Text"), topWidget); topLayout->addWidget(textGroup); - QLabel* label = new QLabel(i18n("Pre&fix:"), textGroup); + TQLabel* label = new TQLabel(i18n("Pre&fix:"), textGroup); mPrefix = new BLineEdit(mPrefixText, textGroup); mPrefix->setMinimumSize(mPrefix->sizeHint()); label->setBuddy(mPrefix); - connect(mPrefix, SIGNAL(focusLost()), SLOT(slotTextLostFocus())); - QWhatsThis::add(mPrefix, + connect(mPrefix, TQT_SIGNAL(focusLost()), TQT_SLOT(slotTextLostFocus())); + TQWhatsThis::add(mPrefix, i18n("Enter text to appear before the person's name in the alarm message, " "including any necessary trailing spaces.")); - label = new QLabel(i18n("S&uffix:"), textGroup); + label = new TQLabel(i18n("S&uffix:"), textGroup); mSuffix = new BLineEdit(mSuffixText, textGroup); mSuffix->setMinimumSize(mSuffix->sizeHint()); label->setBuddy(mSuffix); - connect(mSuffix, SIGNAL(focusLost()), SLOT(slotTextLostFocus())); - QWhatsThis::add(mSuffix, + connect(mSuffix, TQT_SIGNAL(focusLost()), TQT_SLOT(slotTextLostFocus())); + TQWhatsThis::add(mSuffix, i18n("Enter text to appear after the person's name in the alarm message, " "including any necessary leading spaces.")); - QGroupBox* group = new QGroupBox(1, Qt::Horizontal, i18n("Select Birthdays"), topWidget); + TQGroupBox* group = new TQGroupBox(1, Qt::Horizontal, i18n("Select Birthdays"), topWidget); topLayout->addWidget(group); mAddresseeList = new BListView(group); mAddresseeList->setMultiSelection(true); - mAddresseeList->setSelectionMode(QListView::Extended); + mAddresseeList->setSelectionMode(TQListView::Extended); mAddresseeList->setAllColumnsShowFocus(true); mAddresseeList->setFullWidth(true); mAddresseeList->addColumn(i18n("Name")); mAddresseeList->addColumn(i18n("Birthday")); - connect(mAddresseeList, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); - QWhatsThis::add(mAddresseeList, + connect(mAddresseeList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); + TQWhatsThis::add(mAddresseeList, i18n("Select birthdays to set alarms for.\n" "This list shows all birthdays in KAddressBook except those for which alarms already exist.\n\n" "You can select multiple birthdays at one time by dragging the mouse over the list, " "or by clicking the mouse while pressing Ctrl or Shift.")); - group = new QGroupBox(i18n("Alarm Configuration"), topWidget); + group = new TQGroupBox(i18n("Alarm Configuration"), topWidget); topLayout->addWidget(group); - QBoxLayout* groupLayout = new QVBoxLayout(group, marginHint(), spacingHint()); + TQBoxLayout* groupLayout = new TQVBoxLayout(group, marginHint(), spacingHint()); groupLayout->addSpacing(fontMetrics().lineSpacing()/2); // Font and colour choice button and sample text @@ -148,7 +148,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent) groupLayout->addWidget(mReminder, 0, Qt::AlignAuto); // Acknowledgement confirmation required - default = no confirmation - QHBoxLayout* layout = new QHBoxLayout(groupLayout, 2*spacingHint()); + TQHBoxLayout* layout = new TQHBoxLayout(groupLayout, 2*spacingHint()); mConfirmAck = EditAlarmDlg::createConfirmAckCheckbox(group); layout->addWidget(mConfirmAck); layout->addSpacing(2*spacingHint()); @@ -162,7 +162,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent) } // Late display checkbox - default = allow late display - layout = new QHBoxLayout(groupLayout, 2*spacingHint()); + layout = new TQHBoxLayout(groupLayout, 2*spacingHint()); mLateCancel = new LateCancelSelector(false, group); layout->addWidget(mLateCancel); layout->addStretch(); @@ -170,7 +170,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent) // Sub-repetition button mSubRepetition = new RepetitionButton(i18n("Sub-Repetition"), false, group); mSubRepetition->set(0, 0, true, 364*24*60); - QWhatsThis::add(mSubRepetition, i18n("Set up an additional alarm repetition")); + TQWhatsThis::add(mSubRepetition, i18n("Set up an additional alarm repetition")); layout->addWidget(mSubRepetition); // Set the values to their defaults @@ -198,7 +198,7 @@ void BirthdayDlg::loadAddressBook() #if KDE_IS_VERSION(3,1,90) mAddressBook = KABC::StdAddressBook::self(true); if (mAddressBook) - connect(mAddressBook, SIGNAL(addressBookChanged(AddressBook*)), SLOT(updateSelectionList())); + connect(mAddressBook, TQT_SIGNAL(addressBookChanged(AddressBook*)), TQT_SLOT(updateSelectionList())); #else mAddressBook = KABC::StdAddressBook::self(); if (mAddressBook) @@ -230,7 +230,7 @@ void BirthdayDlg::close() void BirthdayDlg::updateSelectionList() { // Compile a list of all pending alarm messages which look like birthdays - QStringList messageList; + TQStringList messageList; KAEvent event; Event::List events = AlarmCalendar::activeCalendar()->events(); for (Event::List::ConstIterator it = events.begin(); it != events.end(); ++it) @@ -250,17 +250,17 @@ void BirthdayDlg::updateSelectionList() if (addressee.birthday().isValid()) { // Create a list entry for this birthday - QDate birthday = addressee.birthday().date(); - QString name = addressee.nickName(); + TQDate birthday = addressee.birthday().date(); + TQString name = addressee.nickName(); if (name.isEmpty()) name = addressee.realName(); // Check if the birthday already has an alarm - QString text = mPrefixText + name + mSuffixText; + TQString text = mPrefixText + name + mSuffixText; bool alarmExists = (messageList.find(text) != messageList.end()); // Check if the birthday is already in the selection list bool inSelectionList = false; AddresseeItem* item = 0; - for (QListViewItem* qitem = mAddresseeList->firstChild(); qitem; qitem = qitem->nextSibling()) + for (TQListViewItem* qitem = mAddresseeList->firstChild(); qitem; qitem = qitem->nextSibling()) { item = dynamic_cast(qitem); if (item && item->text(AddresseeItem::NAME) == name && item->birthday() == birthday) @@ -280,7 +280,7 @@ void BirthdayDlg::updateSelectionList() // Enable/disable OK button according to whether anything is currently selected bool selection = false; - for (QListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) + for (TQListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) if (mAddresseeList->isSelected(item)) { selection = true; @@ -292,22 +292,22 @@ void BirthdayDlg::updateSelectionList() /****************************************************************************** * Return a list of events for birthdays chosen. */ -QValueList BirthdayDlg::events() const +TQValueList BirthdayDlg::events() const { - QValueList list; - QDate today = QDate::currentDate(); - QDateTime todayNoon(today, QTime(12, 0, 0)); + TQValueList list; + TQDate today = TQDate::currentDate(); + TQDateTime todayNoon(today, TQTime(12, 0, 0)); int thisYear = today.year(); int reminder = mReminder->minutes(); - for (QListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) + for (TQListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) { if (mAddresseeList->isSelected(item)) { AddresseeItem* aItem = dynamic_cast(item); if (aItem) { - QDate date = aItem->birthday(); + TQDate date = aItem->birthday(); date.setYMD(thisYear, date.month(), date.day()); if (date <= today) date.setYMD(thisYear + 1, date.month(), date.day()); @@ -320,9 +320,9 @@ QValueList BirthdayDlg::events() const int fadeSecs; float volume = mSoundPicker->volume(fadeVolume, fadeSecs); event.setAudioFile(mSoundPicker->file(), volume, fadeVolume, fadeSecs); - QValueList months; + TQValueList months; months.append(date.month()); - event.setRecurAnnualByDate(1, months, 0, Preferences::defaultFeb29Type(), -1, QDate()); + event.setRecurAnnualByDate(1, months, 0, Preferences::defaultFeb29Type(), -1, TQDate()); event.setRepetition(mSubRepetition->interval(), mSubRepetition->count()); event.setNextOccurrence(todayNoon); if (reminder) @@ -344,9 +344,9 @@ void BirthdayDlg::slotOk() { // Save prefix and suffix texts to use as future defaults KConfig* config = kapp->config(); - config->setGroup(QString::fromLatin1("General")); - config->writeEntry(QString::fromLatin1("BirthdayPrefix"), mPrefix->text()); - config->writeEntry(QString::fromLatin1("BirthdaySuffix"), mSuffix->text()); + config->setGroup(TQString::fromLatin1("General")); + config->writeEntry(TQString::fromLatin1("BirthdayPrefix"), mPrefix->text()); + config->writeEntry(TQString::fromLatin1("BirthdaySuffix"), mSuffix->text()); config->sync(); mFlags = (mSoundPicker->sound() == SoundPicker::BEEP ? KAEvent::BEEP : 0) @@ -363,7 +363,7 @@ void BirthdayDlg::slotOk() */ void BirthdayDlg::slotSelectionChanged() { - for (QListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) + for (TQListViewItem* item = mAddresseeList->firstChild(); item; item = item->nextSibling()) if (mAddresseeList->isSelected(item)) { enableButtonOK(true); @@ -380,8 +380,8 @@ void BirthdayDlg::slotSelectionChanged() */ void BirthdayDlg::slotTextLostFocus() { - QString prefix = mPrefix->text(); - QString suffix = mSuffix->text(); + TQString prefix = mPrefix->text(); + TQString suffix = mSuffix->text(); if (prefix != mPrefixText || suffix != mSuffixText) { // Text has changed - re-evaluate the selection list @@ -396,8 +396,8 @@ void BirthdayDlg::slotTextLostFocus() = Class: AddresseeItem =============================================================================*/ -AddresseeItem::AddresseeItem(QListView* parent, const QString& name, const QDate& birthday) - : QListViewItem(parent), +AddresseeItem::AddresseeItem(TQListView* parent, const TQString& name, const TQDate& birthday) + : TQListViewItem(parent), mBirthday(birthday) { setText(NAME, name); @@ -405,7 +405,7 @@ AddresseeItem::AddresseeItem(QListView* parent, const QString& name, const QDate mBirthdayOrder.sprintf("%04d%03d", mBirthday.year(), mBirthday.dayOfYear()); } -QString AddresseeItem::key(int column, bool) const +TQString AddresseeItem::key(int column, bool) const { if (column == BIRTHDAY) return mBirthdayOrder; @@ -417,11 +417,11 @@ QString AddresseeItem::key(int column, bool) const = Class: BListView =============================================================================*/ -BListView::BListView(QWidget* parent, const char* name) +BListView::BListView(TQWidget* parent, const char* name) : KListView(parent, name) { KAccel* accel = new KAccel(this); - accel->insert(KStdAccel::SelectAll, this, SLOT(slotSelectAll())); - accel->insert(KStdAccel::Deselect, this, SLOT(slotDeselect())); + accel->insert(KStdAccel::SelectAll, this, TQT_SLOT(slotSelectAll())); + accel->insert(KStdAccel::Deselect, this, TQT_SLOT(slotDeselect())); accel->readSettings(); } -- cgit v1.2.1