diff options
Diffstat (limited to 'kplato/kptaccountspanel.cc')
| -rw-r--r-- | kplato/kptaccountspanel.cc | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/kplato/kptaccountspanel.cc b/kplato/kptaccountspanel.cc index 70fba38e2..1d38ac793 100644 --- a/kplato/kptaccountspanel.cc +++ b/kplato/kptaccountspanel.cc @@ -22,12 +22,12 @@ #include "kptcommand.h" #include "kptproject.h" -#include <qcombobox.h> -#include <qheader.h> -#include <qlistview.h> -#include <qpushbutton.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlistview.h> +#include <tqpushbutton.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <klistview.h> #include <klocale.h> @@ -39,29 +39,29 @@ namespace KPlato class AccountItem : public KListViewItem { public: - AccountItem(AccountsPanel &pan, QListView *parent) - : KListViewItem(parent), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent) + : KListViewItem(tqparent), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent) - : KListViewItem(parent), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent) + : KListViewItem(tqparent), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListView *parent, QString label1, QString label2 = QString::null) - : KListViewItem(parent, label1, label2), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent, TQString label1, TQString label2 = TQString()) + : KListViewItem(tqparent, label1, label2), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent, QString label1, QString label2 = QString::null) - : KListViewItem(parent, label1, label2), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent, TQString label1, TQString label2 = TQString()) + : KListViewItem(tqparent, label1, label2), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListView *parent, QListViewItem *after) - : KListViewItem(parent, after), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListView *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), account(0), panel(pan) { init(); } - AccountItem(AccountsPanel &pan, QListViewItem *parent, QListViewItem *after) - : KListViewItem(parent, after), account(0), panel(pan) + AccountItem(AccountsPanel &pan, TQListViewItem *tqparent, TQListViewItem *after) + : KListViewItem(tqparent, after), account(0), panel(pan) { init(); } Account *account; bool isDefault; - QString oldText; + TQString oldText; AccountsPanel &panel; protected: virtual void cancelRename(int col) { @@ -71,7 +71,7 @@ protected: return; } panel.renameStopped(this); - QListViewItem::cancelRename(col); + TQListViewItem::cancelRename(col); setRenameEnabled(col, false); } private: @@ -84,7 +84,7 @@ private: } }; -AccountsPanel::AccountsPanel(Accounts &acc, QWidget *p, const char *n) +AccountsPanel::AccountsPanel(Accounts &acc, TQWidget *p, const char *n) : AccountsPanelBase(p, n), m_accounts(acc), m_currentIndex(0), @@ -94,34 +94,34 @@ AccountsPanel::AccountsPanel(Accounts &acc, QWidget *p, const char *n) accountList->setRootIsDecorated(true); accountList->header()->setStretchEnabled(true, 1); accountList->setItemMargin(2); - accountList->setDefaultRenameAction(QListView::Accept); + accountList->setDefaultRenameAction(TQListView::Accept); addItems(accountList, acc); slotSelectionChanged(); - connect(accountList, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); - connect(accountList, SIGNAL(itemRenamed(QListViewItem*, int)), SLOT(slotItemRenamed(QListViewItem*, int))); - connect(accountList, SIGNAL(doubleClicked(QListViewItem*, const QPoint &, int)), SLOT(slotListDoubleClicked(QListViewItem*, const QPoint &, int))); + connect(accountList, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); + connect(accountList, TQT_SIGNAL(itemRenamed(TQListViewItem*, int)), TQT_SLOT(slotItemRenamed(TQListViewItem*, int))); + connect(accountList, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint &, int)), TQT_SLOT(slotListDoubleClicked(TQListViewItem*, const TQPoint &, int))); - connect(removeBtn, SIGNAL(clicked()), SLOT(slotRemoveBtn())); - connect(newBtn, SIGNAL(clicked()), SLOT(slotNewBtn())); - connect(subBtn, SIGNAL(clicked()), SLOT(slotSubBtn())); + connect(removeBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveBtn())); + connect(newBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewBtn())); + connect(subBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSubBtn())); - connect(accountsComboBox, SIGNAL(activated(int)), SLOT(slotActivated(int))); + connect(accountsComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(slotActivated(int))); // Internal hacks, to get renaming to behave along with unique names - // Uses signals to not get in the way of QListView - connect(this, SIGNAL(renameStarted(QListViewItem*, int)), SLOT(slotRenameStarted(QListViewItem*, int))); - connect(this, SIGNAL(startRename(QListViewItem*, int)), SLOT(slotStartRename(QListViewItem*, int))); - connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); + // Uses signals to not get in the way of TQListView + connect(this, TQT_SIGNAL(renameStarted(TQListViewItem*, int)), TQT_SLOT(slotRenameStarted(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(startRename(TQListViewItem*, int)), TQT_SLOT(slotStartRename(TQListViewItem*, int))); + connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged())); } -void AccountsPanel::addItems(QListView *lv, Accounts &acc) { +void AccountsPanel::addItems(TQListView *lv, Accounts &acc) { //kdDebug()<<k_funcinfo<<"No of accs: "<<acc.accountList().count()<<endl; AccountListIterator it = acc.accountList(); for (; it.current(); ++it) { - QString n = it.current()->name(); - QString d = it.current()->description(); + TQString n = it.current()->name(); + TQString d = it.current()->description(); AccountItem *item = new AccountItem(*this, lv, n, d); item->account = it.current(); item->isDefault = (it.current() == acc.defaultAccount()); @@ -132,11 +132,11 @@ void AccountsPanel::addItems(QListView *lv, Accounts &acc) { } } -void AccountsPanel::addItems(QListViewItem *item, Account *acc) { +void AccountsPanel::addItems(TQListViewItem *item, Account *acc) { AccountListIterator it = acc->accountList(); for (; it.current(); ++it) { - QString n = it.current()->name(); - QString d = it.current()->description(); + TQString n = it.current()->name(); + TQString d = it.current()->description(); AccountItem *ai = new AccountItem(*this, item, n, d); ai->account = it.current(); ai->isDefault = (it.current() == acc->list()->defaultAccount()); @@ -147,16 +147,16 @@ void AccountsPanel::addItems(QListViewItem *item, Account *acc) { } } -void AccountsPanel::addElement(const QListViewItem *item) { - if (item->parent()) { - removeElement(item->parent()); +void AccountsPanel::addElement(const TQListViewItem *item) { + if (item->tqparent()) { + removeElement(item->tqparent()); } - m_elements.replace(item->text(0), item); + m_elements.tqreplace(item->text(0), item); //kdDebug()<<k_funcinfo<<item->text(0)<<endl; refreshDefaultAccount(); } -void AccountsPanel::removeElement(QListViewItem *item) { +void AccountsPanel::removeElement(TQListViewItem *item) { static_cast<AccountItem*>(item)->isDefault = false; m_elements.remove(item->text(0)); refreshDefaultAccount(); @@ -166,7 +166,7 @@ void AccountsPanel::refreshDefaultAccount() { accountsComboBox->clear(); m_currentIndex = 0; accountsComboBox->insertItem(i18n("None")); - QDictIterator<QListViewItem> it(m_elements); + TQDictIterator<TQListViewItem> it(m_elements); for(int i=1; it.current(); ++it, ++i) { accountsComboBox->insertItem(it.currentKey()); if (static_cast<AccountItem*>(it.current())->isDefault) { @@ -217,13 +217,13 @@ void AccountsPanel::slotSelectionChanged() { subBtn->setEnabled(false); return; } - QListViewItem *i = accountList->selectedItem(); + TQListViewItem *i = accountList->selectedItem(); removeBtn->setEnabled((bool)i); newBtn->setEnabled(true); subBtn->setEnabled((bool)i); } -void AccountsPanel::slotItemRenamed(QListViewItem *item, int col) { +void AccountsPanel::slotItemRenamed(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<item->text(0)<<endl; item->setRenameEnabled(col, false); m_renameItem = 0; @@ -254,8 +254,8 @@ void AccountsPanel::slotItemRenamed(QListViewItem *item, int col) { slotChanged(); } -bool AccountsPanel::isUnique(QListViewItem *item) { - QListViewItemIterator it(accountList); +bool AccountsPanel::isUnique(TQListViewItem *item) { + TQListViewItemIterator it(accountList); for (; it.current(); ++it) { if (it.current() != item && it.current()->text(0) == item->text(0)) { return false; @@ -271,42 +271,42 @@ void AccountsPanel::slotRemoveBtn() { void AccountsPanel::slotNewBtn() { //kdDebug()<<k_funcinfo<<endl; - QListViewItem *item = accountList->selectedItem(); + TQListViewItem *item = accountList->selectedItem(); if (item && item->text(0).isEmpty()) { return; } - QListViewItem *n; + TQListViewItem *n; if (item) { - if (item->parent()) { - n = new AccountItem(*this, item->parent(), item); + if (item->tqparent()) { + n = new AccountItem(*this, item->tqparent(), item); } else { n = new AccountItem(*this, accountList, item); } } else { n = new AccountItem(*this, accountList); } - slotListDoubleClicked(n, QPoint(), 0); + slotListDoubleClicked(n, TQPoint(), 0); } void AccountsPanel::slotSubBtn() { //kdDebug()<<k_funcinfo<<endl; - QListViewItem *item = accountList->selectedItem(); + TQListViewItem *item = accountList->selectedItem(); if (item && item->text(0).isEmpty()) { return; } - QListViewItem *n; + TQListViewItem *n; if (item) { n = new AccountItem(*this, item); } else { n = new AccountItem(*this, accountList); } - slotListDoubleClicked(n, QPoint(), 0); + slotListDoubleClicked(n, TQPoint(), 0); } KCommand *AccountsPanel::buildCommand(Part *part) { KMacroCommand *cmd = 0; // First remove - QPtrListIterator<QListViewItem> rit = m_removedItems; + TQPtrListIterator<TQListViewItem> rit = m_removedItems; for (;rit.current(); ++rit) { AccountItem *item = static_cast<AccountItem*>(rit.current()); //kdDebug()<<k_funcinfo<<"Removed item"<<endl; @@ -325,7 +325,7 @@ KCommand *AccountsPanel::buildCommand(Part *part) { KCommand *AccountsPanel::save(Part *part, Project &project) { KMacroCommand *cmd=0; - QListViewItem *myChild = accountList->firstChild(); + TQListViewItem *myChild = accountList->firstChild(); for (; myChild; myChild = myChild->nextSibling()) { KCommand *c = save(part, project, myChild); if (c) { @@ -336,7 +336,7 @@ KCommand *AccountsPanel::save(Part *part, Project &project) { return cmd; } -KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { +KCommand *AccountsPanel::save(Part *part, Project &project, TQListViewItem *i) { KMacroCommand *cmd=0; AccountItem *item = static_cast<AccountItem*>(i); if (item->account == 0) { @@ -344,9 +344,9 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { //kdDebug()<<k_funcinfo<<"New account: "<<item->text(0)<<endl; if (!cmd) cmd = new KMacroCommand(""); item->account = new Account(item->text(0), item->text(1)); - if (item->parent()) { + if (item->tqparent()) { //kdDebug()<<k_funcinfo<<"New account: "<<item->text(0)<<endl; - cmd->addCommand(new AddAccountCmd(part, project, item->account, item->parent()->text(0))); + cmd->addCommand(new AddAccountCmd(part, project, item->account, item->tqparent()->text(0))); } else { cmd->addCommand(new AddAccountCmd(part, project, item->account)); } @@ -363,7 +363,7 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { cmd->addCommand(new ModifyAccountDescriptionCmd(part, item->account, item->text(1))); } } - QListViewItem *myChild = item->firstChild(); + TQListViewItem *myChild = item->firstChild(); for (; myChild; myChild = myChild->nextSibling()) { KCommand *c = save(part, project, myChild); if (c) { @@ -383,14 +383,14 @@ KCommand *AccountsPanel::save(Part *part, Project &project, QListViewItem *i) { return cmd; } -void AccountsPanel::slotListDoubleClicked(QListViewItem* item, const QPoint&, int col) { +void AccountsPanel::slotListDoubleClicked(TQListViewItem* item, const TQPoint&, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (m_renameItem) return; slotStartRename(item, col); } -void AccountsPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { +void AccountsPanel::slotRenameStarted(TQListViewItem */*item*/, int /*col*/) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; if (accountList->isRenaming()) { removeBtn->setEnabled(false); @@ -399,7 +399,7 @@ void AccountsPanel::slotRenameStarted(QListViewItem */*item*/, int /*col*/) { } } -void AccountsPanel::slotStartRename(QListViewItem *item, int col) { +void AccountsPanel::slotStartRename(TQListViewItem *item, int col) { //kdDebug()<<k_funcinfo<<(item?item->text(0):"")<<endl; static_cast<AccountItem*>(item)->oldText = item->text(col); item->setRenameEnabled(col, true); @@ -409,13 +409,13 @@ void AccountsPanel::slotStartRename(QListViewItem *item, int col) { emit renameStarted(item, col); } -void AccountsPanel::slotRemoveItem(QListViewItem *i) { +void AccountsPanel::slotRemoveItem(TQListViewItem *i) { AccountItem *item = static_cast<AccountItem*>(i); if (item == 0) return; //kdDebug()<<k_funcinfo<<item->text(0)<<endl; removeElement(item); - QListViewItem *p = item->parent(); + TQListViewItem *p = item->tqparent(); if (p) { p->takeItem(item); if (item->account) { @@ -437,7 +437,7 @@ void AccountsPanel::slotRemoveItem(QListViewItem *i) { } // We don't get notified when rename is cancelled, this is called from the item -void AccountsPanel::renameStopped(QListViewItem */*item*/) { +void AccountsPanel::renameStopped(TQListViewItem */*item*/) { //kdDebug()<<k_funcinfo<<endl; m_renameItem = 0; emit selectionChanged(); |
