From f8b154acd091636603566b46cb97a2dd63b540cb Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 17:25:33 -0600 Subject: Fix FTBFS --- .../src/linkaddressbook/nicklisttooltip.cpp | 68 ----- konversation/src/linkaddressbook/nicklisttooltip.h | 45 --- .../src/linkaddressbook/nictdelisttooltip.cpp | 68 +++++ .../src/linkaddressbook/nictdelisttooltip.h | 45 +++ konversation/src/nicklistbehavior_preferences.cpp | 108 ------- konversation/src/nicklistbehavior_preferences.h | 47 --- konversation/src/nicklistbehavior_preferencesui.ui | 160 ---------- konversation/src/nicklistview.cpp | 336 --------------------- konversation/src/nicklistview.h | 78 ----- .../src/nictdelistbehavior_preferences.cpp | 108 +++++++ konversation/src/nictdelistbehavior_preferences.h | 47 +++ .../src/nictdelistbehavior_preferencesui.ui | 160 ++++++++++ konversation/src/nictdelistview.cpp | 336 +++++++++++++++++++++ konversation/src/nictdelistview.h | 78 +++++ 14 files changed, 842 insertions(+), 842 deletions(-) delete mode 100644 konversation/src/linkaddressbook/nicklisttooltip.cpp delete mode 100644 konversation/src/linkaddressbook/nicklisttooltip.h create mode 100644 konversation/src/linkaddressbook/nictdelisttooltip.cpp create mode 100644 konversation/src/linkaddressbook/nictdelisttooltip.h delete mode 100644 konversation/src/nicklistbehavior_preferences.cpp delete mode 100644 konversation/src/nicklistbehavior_preferences.h delete mode 100644 konversation/src/nicklistbehavior_preferencesui.ui delete mode 100644 konversation/src/nicklistview.cpp delete mode 100644 konversation/src/nicklistview.h create mode 100644 konversation/src/nictdelistbehavior_preferences.cpp create mode 100644 konversation/src/nictdelistbehavior_preferences.h create mode 100644 konversation/src/nictdelistbehavior_preferencesui.ui create mode 100644 konversation/src/nictdelistview.cpp create mode 100644 konversation/src/nictdelistview.h diff --git a/konversation/src/linkaddressbook/nicklisttooltip.cpp b/konversation/src/linkaddressbook/nicklisttooltip.cpp deleted file mode 100644 index 732b32e..0000000 --- a/konversation/src/linkaddressbook/nicklisttooltip.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - The class that controls what the tooltip looks like when you hover over a person in the nicklistview. This is used to show contact information about the person from the addressbook. - begin: Sun 25 July 2004 - copyright: (C) 2004 by John Tapsell - email: john@geola.co.uk -*/ - -#include "nicklisttooltip.h" -#include "../nick.h" -#include "../nicklistview.h" -#include "../nickinfo.h" -#include "../common.h" - -#include -#include -#include - - -class NickListView; - -namespace Konversation -{ - KonversationNickListViewToolTip::KonversationNickListViewToolTip(TQWidget *parent, NickListView *lv) : TQToolTip(parent) - { - m_listView = lv; - } - - KonversationNickListViewToolTip::~KonversationNickListViewToolTip() - { - } - - void KonversationNickListViewToolTip::maybeTip( const TQPoint &pos ) - { - if( !parentWidget() || !m_listView ) - return; - - TQListViewItem *item = m_listView->itemAt( pos ); - - if( !item ) - return; - - Nick *nick = dynamic_cast( item ); - - if(! nick ) - return; - - TQString toolTip; - TQRect itemRect = m_listView->itemRect( item ); - - uint leftMargin = m_listView->treeStepSize() * - ( item->depth() + ( m_listView->rootIsDecorated() ? 1 : 0 ) ) + - m_listView->itemMargin(); - uint xAdjust = itemRect.left() + leftMargin; - uint yAdjust = itemRect.top(); - TQPoint relativePos( pos.x() - xAdjust, pos.y() - yAdjust ); - toolTip = Konversation::removeIrcMarkup(nick->getChannelNick()->tooltip()); - if(!toolTip.isEmpty()) - tip(itemRect, toolTip); - } - -} // namespace Konversation diff --git a/konversation/src/linkaddressbook/nicklisttooltip.h b/konversation/src/linkaddressbook/nicklisttooltip.h deleted file mode 100644 index 728f9c6..0000000 --- a/konversation/src/linkaddressbook/nicklisttooltip.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - nicklisttooltip.h - The class that controls what the tooltip looks like when you hover over a person in the nicklistview. This is used to show contact information about the person from the addressbook. - begin: Sun 25 July 2004 - copyright: (C) 2004 by John Tapsell - email: john@geola.co.uk -*/ - -#ifndef KONVERSATIONNICKLISTTOOLTIP_H -#define KONVERSATIONNICKLISTTOOLTIP_H - -#include "addressbook.h" - -#include -#include -#include -#include - -#include - - -class NickListView; - -namespace Konversation -{ - - class KonversationNickListViewToolTip : public TQToolTip - { - public: - KonversationNickListViewToolTip(TQWidget *parent, NickListView *lv); - virtual ~KonversationNickListViewToolTip(); - - void maybeTip( const TQPoint &pos ); - - private: - NickListView *m_listView; - }; -} -#endif diff --git a/konversation/src/linkaddressbook/nictdelisttooltip.cpp b/konversation/src/linkaddressbook/nictdelisttooltip.cpp new file mode 100644 index 0000000..732b32e --- /dev/null +++ b/konversation/src/linkaddressbook/nictdelisttooltip.cpp @@ -0,0 +1,68 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + The class that controls what the tooltip looks like when you hover over a person in the nicklistview. This is used to show contact information about the person from the addressbook. + begin: Sun 25 July 2004 + copyright: (C) 2004 by John Tapsell + email: john@geola.co.uk +*/ + +#include "nicklisttooltip.h" +#include "../nick.h" +#include "../nicklistview.h" +#include "../nickinfo.h" +#include "../common.h" + +#include +#include +#include + + +class NickListView; + +namespace Konversation +{ + KonversationNickListViewToolTip::KonversationNickListViewToolTip(TQWidget *parent, NickListView *lv) : TQToolTip(parent) + { + m_listView = lv; + } + + KonversationNickListViewToolTip::~KonversationNickListViewToolTip() + { + } + + void KonversationNickListViewToolTip::maybeTip( const TQPoint &pos ) + { + if( !parentWidget() || !m_listView ) + return; + + TQListViewItem *item = m_listView->itemAt( pos ); + + if( !item ) + return; + + Nick *nick = dynamic_cast( item ); + + if(! nick ) + return; + + TQString toolTip; + TQRect itemRect = m_listView->itemRect( item ); + + uint leftMargin = m_listView->treeStepSize() * + ( item->depth() + ( m_listView->rootIsDecorated() ? 1 : 0 ) ) + + m_listView->itemMargin(); + uint xAdjust = itemRect.left() + leftMargin; + uint yAdjust = itemRect.top(); + TQPoint relativePos( pos.x() - xAdjust, pos.y() - yAdjust ); + toolTip = Konversation::removeIrcMarkup(nick->getChannelNick()->tooltip()); + if(!toolTip.isEmpty()) + tip(itemRect, toolTip); + } + +} // namespace Konversation diff --git a/konversation/src/linkaddressbook/nictdelisttooltip.h b/konversation/src/linkaddressbook/nictdelisttooltip.h new file mode 100644 index 0000000..728f9c6 --- /dev/null +++ b/konversation/src/linkaddressbook/nictdelisttooltip.h @@ -0,0 +1,45 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + nicklisttooltip.h - The class that controls what the tooltip looks like when you hover over a person in the nicklistview. This is used to show contact information about the person from the addressbook. + begin: Sun 25 July 2004 + copyright: (C) 2004 by John Tapsell + email: john@geola.co.uk +*/ + +#ifndef KONVERSATIONNICKLISTTOOLTIP_H +#define KONVERSATIONNICKLISTTOOLTIP_H + +#include "addressbook.h" + +#include +#include +#include +#include + +#include + + +class NickListView; + +namespace Konversation +{ + + class KonversationNickListViewToolTip : public TQToolTip + { + public: + KonversationNickListViewToolTip(TQWidget *parent, NickListView *lv); + virtual ~KonversationNickListViewToolTip(); + + void maybeTip( const TQPoint &pos ); + + private: + NickListView *m_listView; + }; +} +#endif diff --git a/konversation/src/nicklistbehavior_preferences.cpp b/konversation/src/nicklistbehavior_preferences.cpp deleted file mode 100644 index 711d8c7..0000000 --- a/konversation/src/nicklistbehavior_preferences.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - Copyright (C) 2006 Dario Abatianni - Copyright (C) 2006 John Tapsell - Copyright (C) 2006 Eike Hein -*/ - -#include "nicklistbehavior_preferences.h" -#include "valuelistviewitem.h" -#include "config/preferences.h" - -#include - -#include -#include - - -NicklistBehavior_Config::NicklistBehavior_Config(TQWidget *parent, const char *name) - : NicklistBehavior_ConfigUI(parent, name) -{ - // get page widget and populate listview - loadSettings(); - - // make items react to drag & drop - sortOrder->setSorting(-1,false); - sortOrder->header()->setMovingEnabled(false); - - connect(sortOrder,TQT_SIGNAL (moved()),this,TQT_SIGNAL (modified()) ); -} - -NicklistBehavior_Config::~NicklistBehavior_Config() -{ -} - -void NicklistBehavior_Config::restorePageToDefaults() -{ - setNickList(Preferences::defaultNicknameSortingOrder()); -} - -void NicklistBehavior_Config::loadSettings() -{ - // get sorting order string from preferences - setNickList(Preferences::sortOrder()); - m_oldSortingOrder=currentSortingOrder(); -} - -void NicklistBehavior_Config::setNickList(const TQString &sortingOrder) -{ - sortOrder->clear(); - // loop through the sorting order string, insert the matching descriptions in reverse order - // to keep the correct sorting - for(unsigned int index=sortingOrder.length();index!=0;index--) - { - // get next mode char - TQChar mode=sortingOrder[index-1]; - // find appropriate description - if(mode=='-') new TDEListViewItem(sortOrder,mode,i18n("Normal Users")); - if(mode=='v') new TDEListViewItem(sortOrder,mode,i18n("Voice (+v)")); - if(mode=='h') new TDEListViewItem(sortOrder,mode,i18n("Halfops (+h)")); - if(mode=='o') new TDEListViewItem(sortOrder,mode,i18n("Operators (+o)")); - if(mode=='p') new TDEListViewItem(sortOrder,mode,i18n("Channel Admins (+p)")); - if(mode=='q') new TDEListViewItem(sortOrder,mode,i18n("Channel Owners (+q)")); - } -} - -TQString NicklistBehavior_Config::currentSortingOrder() -{ - // get the uppermost entry of the sorting list - TQListViewItem* item=sortOrder->firstChild(); - // prepare the new sorting order string - TQString currentSortingOrder; - // iterate through all items of the listview - while(item) - { - // add mode char to the sorting order string - currentSortingOrder+=item->text(0); - // go to next item in the listview - item=item->itemBelow(); - } // while - - return currentSortingOrder; -} - -// save settings permanently -void NicklistBehavior_Config::saveSettings() -{ - // get the current sorting order - TQString newSortingOrder=currentSortingOrder(); - - // update sorting order on in-memory preferences - Preferences::setSortOrder(newSortingOrder); - - // save current sorting order as a reference to hasChanged() - m_oldSortingOrder=currentSortingOrder(); -} - -bool NicklistBehavior_Config::hasChanged() -{ - return(m_oldSortingOrder!=currentSortingOrder()); -} - -#include "nicklistbehavior_preferences.moc" diff --git a/konversation/src/nicklistbehavior_preferences.h b/konversation/src/nicklistbehavior_preferences.h deleted file mode 100644 index f705cbf..0000000 --- a/konversation/src/nicklistbehavior_preferences.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - Copyright (C) 2006 Dario Abatianni - Copyright (C) 2006 John Tapsell -*/ - -#ifndef NICKLISTBEHAVIOR_Config_H -#define NICKLISTBEHAVIOR_Config_H - -#include "konvisettingspage.h" -#include "nicklistbehavior_preferencesui.h" - -#include - - -class NicklistBehavior_Config : public NicklistBehavior_ConfigUI, public KonviSettingsPage -{ - Q_OBJECT - - - public: - explicit NicklistBehavior_Config(TQWidget *parent = 0, const char *name = 0); - ~NicklistBehavior_Config(); - - virtual void saveSettings(); - virtual void loadSettings(); - virtual void restorePageToDefaults(); - - virtual bool hasChanged(); - - private: - void setNickList(const TQString &sortingOrder); - TQString currentSortingOrder(); - - TQString m_oldSortingOrder; - - signals: - void modified(); -}; - -#endif diff --git a/konversation/src/nicklistbehavior_preferencesui.ui b/konversation/src/nicklistbehavior_preferencesui.ui deleted file mode 100644 index 7d8335f..0000000 --- a/konversation/src/nicklistbehavior_preferencesui.ui +++ /dev/null @@ -1,160 +0,0 @@ - -NicklistBehavior_ConfigUI -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -Copyright (C) 2005 Peter Simonsson - - - NicklistBehavior_ConfigUI - - - - 0 - 0 - 692 - 480 - - - - - unnamed - - - 0 - - - - textLabel1_2 - - - &Command to be executed on double click: - - - kcfg_ChannelDoubleClickAction - - - - - kcfg_SortCaseInsensitive - - - Sort case &insensitive - - - - - kcfg_SortByActivity - - - Sort by &activity - - - - - kcfg_SortByStatus - - - - 4 - 0 - 0 - 0 - - - - Sort b&y user status - - - - - - Mode - - - true - - - true - - - - - Explanation - - - true - - - true - - - - sortOrder - - - false - - - true - - - true - - - true - - - true - - - false - - - - - kcfg_ChannelDoubleClickAction - - - - - orderHintLabel - - - false - - - (Reorder nick sorting order by drag and drop) - - - - - - - kcfg_SortByStatus - toggled(bool) - sortOrder - setEnabled(bool) - - - kcfg_SortByStatus - toggled(bool) - orderHintLabel - setEnabled(bool) - - - - kcfg_ChannelDoubleClickAction - kcfg_SortCaseInsensitive - kcfg_SortByStatus - sortOrder - - - - - klistview.h - klineedit.h - - diff --git a/konversation/src/nicklistview.cpp b/konversation/src/nicklistview.cpp deleted file mode 100644 index ba8cab9..0000000 --- a/konversation/src/nicklistview.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - This is the class that shows the channel nick list - begin: Fre Jun 7 2002 - copyright: (C) 2002 by Dario Abatianni - email: eisfuchs@tigress.com -*/ - -#include "nicklistview.h" -#include "konversationapplication.h" -#include "images.h" -#include "linkaddressbook/addressbook.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -NickListView::NickListView(TQWidget* parent, Channel *chan) : -TDEListView(parent) -{ - TDEListView::setSorting(-1); - setWhatsThis(); - channel=chan; - popup=new TDEPopupMenu(this,"nicklist_context_menu"); - modes=new TDEPopupMenu(this,"nicklist_modes_context_submenu"); - kickban=new TDEPopupMenu(this,"nicklist_kick_ban_context_submenu"); - addressbook= new TDEPopupMenu(this,"nicklist_addressbook_context_submenu"); - setAcceptDrops(true); - setDropHighlighter(true); - setDropVisualizer(false); - - if (popup) - { - popup->insertItem(i18n("&Whois"),Konversation::Whois); - popup->insertItem(i18n("&Version"),Konversation::Version); - popup->insertItem(i18n("&Ping"),Konversation::Ping); - - popup->insertSeparator(); - - if (modes) - { - modes->insertItem(i18n("Give Op"),Konversation::GiveOp); - modes->insertItem(i18n("Take Op"),Konversation::TakeOp); - modes->insertItem(i18n("Give HalfOp"),Konversation::GiveHalfOp); - modes->insertItem(i18n("Take HalfOp"),Konversation::TakeHalfOp); - modes->insertItem(i18n("Give Voice"),Konversation::GiveVoice); - modes->insertItem(i18n("Take Voice"),Konversation::TakeVoice); - popup->insertItem(i18n("Modes"),modes,Konversation::ModesSub); - } - - if (kickban) - { - - kickban->insertItem(i18n("Kick"),Konversation::Kick); - kickban->insertItem(i18n("Kickban"),Konversation::KickBan); - kickban->insertItem(i18n("Ban Nickname"),Konversation::BanNick); - kickban->insertSeparator(); - kickban->insertItem(i18n("Ban *!*@*.host"),Konversation::BanHost); - kickban->insertItem(i18n("Ban *!*@domain"),Konversation::BanDomain); - kickban->insertItem(i18n("Ban *!user@*.host"),Konversation::BanUserHost); - kickban->insertItem(i18n("Ban *!user@domain"),Konversation::BanUserDomain); - kickban->insertSeparator(); - kickban->insertItem(i18n("Kickban *!*@*.host"),Konversation::KickBanHost); - kickban->insertItem(i18n("Kickban *!*@domain"),Konversation::KickBanDomain); - kickban->insertItem(i18n("Kickban *!user@*.host"),Konversation::KickBanUserHost); - kickban->insertItem(i18n("Kickban *!user@domain"),Konversation::KickBanUserDomain); - popup->insertItem(i18n("Kick / Ban"),kickban,Konversation::KickBanSub); - } - - popup->insertItem(i18n("Ignore"), Konversation::IgnoreNick); - popup->insertItem(i18n("Unignore"), Konversation::UnignoreNick); - - popup->insertSeparator(); - - int newitem; - newitem = popup->insertItem(i18n("Open &Query"),Konversation::OpenQuery); - popup->setWhatsThis(newitem, "Start a private chat between you and this person.

Technical note:
The conversation between you and this person will be sent via the server. This means that the conversation will be affected by server lag, server stability, and will be terminated when you disconnect from the server."); - newitem = popup->insertItem(i18n("Open DCC &Chat"),Konversation::StartDccChat); - popup->setWhatsThis(newitem, "Start a private Direct Client Connection chat between you and this person.

Technical note:
The conversation between you and this person will be sent directly. This means it is independent from the server - so if the server connection fails, or use disconnect, your DCC Chat will be unaffected. It also means that no irc server admin can view or spy on this chat."); - - if (kapp->authorize("allow_downloading")) - { - newitem = popup->insertItem(SmallIcon("2rightarrow"),i18n("Send &File..."),Konversation::DccSend); - popup->setWhatsThis(newitem, "Send a file to this person. If you are having problem sending files, or they are sending slowly, see the Konversation Handbook and DCC preferences page."); - } - popup->insertItem(SmallIconSet("mail_generic"),i18n("&Send Email..."), Konversation::SendEmail); - - popup->insertSeparator(); - - if (addressbook) - popup->insertItem(i18n("Addressbook Associations"), addressbook, Konversation::AddressbookSub); - - popup->insertItem(i18n("Add to Watched Nicks"), Konversation::AddNotify); - - connect (popup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); - connect (modes, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); - connect (kickban, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); - connect (addressbook, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); - - } - else - { - kdWarning() << "NickListView::NickListView(): Could not create popup!" << endl; - } - - #if KDE_IS_VERSION(3,3,90) - setShadeSortColumn(false); - #endif - - // We have our own tooltips, don't use the default TQListView ones - setShowToolTips(false); - m_tooltip = new Konversation::KonversationNickListViewToolTip(viewport(), this); - - m_resortTimer = new TQTimer(this); - connect(m_resortTimer, TQT_SIGNAL(timeout()), TQT_SLOT(resort())); -} - -NickListView::~NickListView() -{ - delete m_tooltip; - m_tooltip = 0; -} - -void NickListView::setWhatsThis() -{ - Images* images = KonversationApplication::instance()->images(); - - if(images->getNickIcon( Images::Normal, false).isNull()) - { - TQWhatsThis::add(this, i18n("This shows all the people in the channel. The nick for each person is shown.
Usually an icon is shown showing the status of each person, but you do not seem to have any icon theme installed. See the Konversation settings - Configure Konversation under the Settings menu. Then view the page for Themes under Appearence.
")); - } - else - { - TQMimeSourceFactory::defaultFactory()->setImage( "admin", images->getNickIcon( Images::Admin, false ).convertToImage() ); - TQMimeSourceFactory::defaultFactory()->setImage( "owner", images->getNickIcon( Images::Owner, false ).convertToImage()); - TQMimeSourceFactory::defaultFactory()->setImage( "op", images->getNickIcon( Images::Op, false ).convertToImage() ); - TQMimeSourceFactory::defaultFactory()->setImage( "halfop", images->getNickIcon( Images::HalfOp, false ).convertToImage() ); - TQMimeSourceFactory::defaultFactory()->setImage( "voice", images->getNickIcon( Images::Voice, false ).convertToImage() ); - TQMimeSourceFactory::defaultFactory()->setImage( "normal", images->getNickIcon( Images::Normal, false ).convertToImage() ); - TQMimeSourceFactory::defaultFactory()->setImage( "normalaway", images->getNickIcon( Images::Normal, true).convertToImage() ); - - TQWhatsThis::add(this, i18n("This shows all the people in the channel. The nick for each person is shown, with a picture showing their status.

" - "" - - "" - "" - "" - "" - "" - "" - "" - "
This person has administrator privileges.
This person is a channel owner.
This person is a channel operator.
This person is a channel half-operator.
This person has voice, and can therefore talk in a moderated channel.
This person does not have any special privileges.
This indicates that this person is currently away.

" - "The meaning of admin, owner and halfop varies between different IRC servers.

" - "Hovering over any nick shows their current status, as well as any information in the addressbook for this person. See the Konversation Handbook for more information." - "" - )); - } - -} - -void NickListView::refresh() -{ - TQListViewItemIterator it(this); - - while (it.current()) - { - static_cast(it.current())->refresh(); - ++it; - } - - setWhatsThis(); -} - -void NickListView::startResortTimer() -{ - if(!m_resortTimer->isActive()) - m_resortTimer->start(3000, true /*single shot*/); -} - -void NickListView::resort() -{ - TDEListView::setSorting(m_column, m_ascending); - sort(); - TDEListView::setSorting(-1); -} - -void NickListView::contextMenuEvent(TQContextMenuEvent* ce) -{ - ce->accept(); - - if (selectedItems().count()) - { - insertAssociationSubMenu(); - updateActions(); - popup->popup(ce->globalPos()); - } -} - -void NickListView::updateActions() -{ - int ignoreCounter = 0; - int unignoreCounter = 0; - int notifyCounter = 0; - - int serverGroupId = -1; - - if (channel->getServer()->getServerGroup()) - serverGroupId = channel->getServer()->getServerGroup()->id(); - - ChannelNickList nickList=channel->getSelectedChannelNicks(); - ChannelNickList::ConstIterator it; - - for (it = nickList.begin(); it != nickList.end(); ++it) - { - if (Preferences::isIgnored((*it)->getNickname())) - ++unignoreCounter; - else - ++ignoreCounter; - - if (serverGroupId != -1 && Preferences::isNotify(serverGroupId, (*it)->getNickname())) - ++notifyCounter; - } - - if (ignoreCounter) - popup->setItemVisible(Konversation::IgnoreNick, true); - else - popup->setItemVisible(Konversation::IgnoreNick, false); - - if (unignoreCounter) - popup->setItemVisible(Konversation::UnignoreNick, true); - else - popup->setItemVisible(Konversation::UnignoreNick, false); - - if (notifyCounter || !Preferences::hasNotifyList(serverGroupId)) - popup->setItemEnabled(Konversation::AddNotify, false); - else - popup->setItemEnabled(Konversation::AddNotify, true); -} - -void NickListView::insertAssociationSubMenu() -{ - - bool existingAssociation = false; - bool noAssociation = false; - bool emailAddress = false; - - addressbook->clear(); - - ChannelNickList nickList=channel->getSelectedChannelNicks(); - for(ChannelNickList::ConstIterator it=nickList.begin();it!=nickList.end();++it) - { - KABC::Addressee addr = (*it)->getNickInfo()->getAddressee(); - if(addr.isEmpty()) - { - noAssociation=true; - if(existingAssociation && emailAddress) break; - } - else - { - if(!emailAddress && !addr.preferredEmail().isEmpty()) - emailAddress = true; - existingAssociation=true; - if(noAssociation && emailAddress) break; - } - } - - if(!noAssociation && existingAssociation) - { - addressbook->insertItem(SmallIcon("contents"), i18n("Edit Contact..."), Konversation::AddressbookEdit); - addressbook->insertSeparator(); - } - - if(noAssociation && existingAssociation) - addressbook->insertItem(i18n("Choose/Change Associations..."), Konversation::AddressbookChange); - else if(noAssociation) - addressbook->insertItem(i18n("Choose Contact..."), Konversation::AddressbookChange); - else - addressbook->insertItem(i18n("Change Association..."), Konversation::AddressbookChange); - - if(noAssociation && !existingAssociation) - addressbook->insertItem(i18n("Create New Contact..."), Konversation::AddressbookNew); - - if(existingAssociation) - addressbook->insertItem(SmallIcon("editdelete"), i18n("Delete Association"), Konversation::AddressbookDelete); - - if(!emailAddress) - popup->setItemEnabled(Konversation::SendEmail, false); - else - popup->setItemEnabled(Konversation::SendEmail, true); - -} - -void NickListView::setSorting(int column, bool ascending) -{ - m_column = column; - m_ascending = ascending; -} - -bool NickListView::acceptDrag (TQDropEvent* event) const -{ - if (event->provides("text/uri-list")) - { - if (event->source()) - { - TQStrList uris; - - if (TQUriDrag::decode(event,uris)) - { - TQString first = uris.first(); - - if (first.startsWith("irc://") || channel->getNickList().containsNick(first)) - return false; - } - else - return false; - } - - return true; - } - else - return false; -} - -#include "nicklistview.moc" diff --git a/konversation/src/nicklistview.h b/konversation/src/nicklistview.h deleted file mode 100644 index a7a2e8f..0000000 --- a/konversation/src/nicklistview.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. -*/ - -/* - Channel Nick List, including context menu - begin: Fre Jun 7 2002 - copyright: (C) 2002 by Dario Abatianni - email: eisfuchs@tigress.com -*/ - -#ifndef NICKLISTVIEW_H -#define NICKLISTVIEW_H - -#include "channel.h" -#include "nicklisttooltip.h" -#include "images.h" -#include "common.h" - -#include - - -class TQPopupMenu; -class TQContextMenuEvent; -class TQTimer; - -class NickListView : public TDEListView -{ - Q_OBJECT - - - public: - NickListView(TQWidget* parent, Channel *chan); - ~NickListView(); - - /** Call when the icons have been changed. - */ - void refresh(); - void setWhatsThis(); - - virtual void setSorting(int column, bool ascending); - - public slots: - /** When this is called, resort is guaranteed to be called within a hard-coded time (a few seconds). - * This prevents lots of calls to resort. - */ - void startResortTimer(); - - /** Resort the listview. - * It is better to call startResortTimer() which will resort with a minimum of a - * 1 second delay. - */ - void resort(); - - signals: - /* Will be connected to Channel::popupCommand(int) */ - void popupCommand(int id); - - protected: - void contextMenuEvent(TQContextMenuEvent* ce); - virtual bool acceptDrag (TQDropEvent* event) const; - void insertAssociationSubMenu(); - void updateActions(); - Konversation::KonversationNickListViewToolTip *m_tooltip; - TQPopupMenu* popup; - TQPopupMenu* modes; - TQPopupMenu* kickban; - TQPopupMenu* addressbook; - Channel *channel; - TQTimer *m_resortTimer; - - int m_column; - bool m_ascending; -}; -#endif diff --git a/konversation/src/nictdelistbehavior_preferences.cpp b/konversation/src/nictdelistbehavior_preferences.cpp new file mode 100644 index 0000000..711d8c7 --- /dev/null +++ b/konversation/src/nictdelistbehavior_preferences.cpp @@ -0,0 +1,108 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + Copyright (C) 2006 Dario Abatianni + Copyright (C) 2006 John Tapsell + Copyright (C) 2006 Eike Hein +*/ + +#include "nicklistbehavior_preferences.h" +#include "valuelistviewitem.h" +#include "config/preferences.h" + +#include + +#include +#include + + +NicklistBehavior_Config::NicklistBehavior_Config(TQWidget *parent, const char *name) + : NicklistBehavior_ConfigUI(parent, name) +{ + // get page widget and populate listview + loadSettings(); + + // make items react to drag & drop + sortOrder->setSorting(-1,false); + sortOrder->header()->setMovingEnabled(false); + + connect(sortOrder,TQT_SIGNAL (moved()),this,TQT_SIGNAL (modified()) ); +} + +NicklistBehavior_Config::~NicklistBehavior_Config() +{ +} + +void NicklistBehavior_Config::restorePageToDefaults() +{ + setNickList(Preferences::defaultNicknameSortingOrder()); +} + +void NicklistBehavior_Config::loadSettings() +{ + // get sorting order string from preferences + setNickList(Preferences::sortOrder()); + m_oldSortingOrder=currentSortingOrder(); +} + +void NicklistBehavior_Config::setNickList(const TQString &sortingOrder) +{ + sortOrder->clear(); + // loop through the sorting order string, insert the matching descriptions in reverse order + // to keep the correct sorting + for(unsigned int index=sortingOrder.length();index!=0;index--) + { + // get next mode char + TQChar mode=sortingOrder[index-1]; + // find appropriate description + if(mode=='-') new TDEListViewItem(sortOrder,mode,i18n("Normal Users")); + if(mode=='v') new TDEListViewItem(sortOrder,mode,i18n("Voice (+v)")); + if(mode=='h') new TDEListViewItem(sortOrder,mode,i18n("Halfops (+h)")); + if(mode=='o') new TDEListViewItem(sortOrder,mode,i18n("Operators (+o)")); + if(mode=='p') new TDEListViewItem(sortOrder,mode,i18n("Channel Admins (+p)")); + if(mode=='q') new TDEListViewItem(sortOrder,mode,i18n("Channel Owners (+q)")); + } +} + +TQString NicklistBehavior_Config::currentSortingOrder() +{ + // get the uppermost entry of the sorting list + TQListViewItem* item=sortOrder->firstChild(); + // prepare the new sorting order string + TQString currentSortingOrder; + // iterate through all items of the listview + while(item) + { + // add mode char to the sorting order string + currentSortingOrder+=item->text(0); + // go to next item in the listview + item=item->itemBelow(); + } // while + + return currentSortingOrder; +} + +// save settings permanently +void NicklistBehavior_Config::saveSettings() +{ + // get the current sorting order + TQString newSortingOrder=currentSortingOrder(); + + // update sorting order on in-memory preferences + Preferences::setSortOrder(newSortingOrder); + + // save current sorting order as a reference to hasChanged() + m_oldSortingOrder=currentSortingOrder(); +} + +bool NicklistBehavior_Config::hasChanged() +{ + return(m_oldSortingOrder!=currentSortingOrder()); +} + +#include "nicklistbehavior_preferences.moc" diff --git a/konversation/src/nictdelistbehavior_preferences.h b/konversation/src/nictdelistbehavior_preferences.h new file mode 100644 index 0000000..f705cbf --- /dev/null +++ b/konversation/src/nictdelistbehavior_preferences.h @@ -0,0 +1,47 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + Copyright (C) 2006 Dario Abatianni + Copyright (C) 2006 John Tapsell +*/ + +#ifndef NICKLISTBEHAVIOR_Config_H +#define NICKLISTBEHAVIOR_Config_H + +#include "konvisettingspage.h" +#include "nicklistbehavior_preferencesui.h" + +#include + + +class NicklistBehavior_Config : public NicklistBehavior_ConfigUI, public KonviSettingsPage +{ + Q_OBJECT + + + public: + explicit NicklistBehavior_Config(TQWidget *parent = 0, const char *name = 0); + ~NicklistBehavior_Config(); + + virtual void saveSettings(); + virtual void loadSettings(); + virtual void restorePageToDefaults(); + + virtual bool hasChanged(); + + private: + void setNickList(const TQString &sortingOrder); + TQString currentSortingOrder(); + + TQString m_oldSortingOrder; + + signals: + void modified(); +}; + +#endif diff --git a/konversation/src/nictdelistbehavior_preferencesui.ui b/konversation/src/nictdelistbehavior_preferencesui.ui new file mode 100644 index 0000000..7d8335f --- /dev/null +++ b/konversation/src/nictdelistbehavior_preferencesui.ui @@ -0,0 +1,160 @@ + +NicklistBehavior_ConfigUI +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Copyright (C) 2005 Peter Simonsson + + + NicklistBehavior_ConfigUI + + + + 0 + 0 + 692 + 480 + + + + + unnamed + + + 0 + + + + textLabel1_2 + + + &Command to be executed on double click: + + + kcfg_ChannelDoubleClickAction + + + + + kcfg_SortCaseInsensitive + + + Sort case &insensitive + + + + + kcfg_SortByActivity + + + Sort by &activity + + + + + kcfg_SortByStatus + + + + 4 + 0 + 0 + 0 + + + + Sort b&y user status + + + + + + Mode + + + true + + + true + + + + + Explanation + + + true + + + true + + + + sortOrder + + + false + + + true + + + true + + + true + + + true + + + false + + + + + kcfg_ChannelDoubleClickAction + + + + + orderHintLabel + + + false + + + (Reorder nick sorting order by drag and drop) + + + + + + + kcfg_SortByStatus + toggled(bool) + sortOrder + setEnabled(bool) + + + kcfg_SortByStatus + toggled(bool) + orderHintLabel + setEnabled(bool) + + + + kcfg_ChannelDoubleClickAction + kcfg_SortCaseInsensitive + kcfg_SortByStatus + sortOrder + + + + + klistview.h + klineedit.h + + diff --git a/konversation/src/nictdelistview.cpp b/konversation/src/nictdelistview.cpp new file mode 100644 index 0000000..ba8cab9 --- /dev/null +++ b/konversation/src/nictdelistview.cpp @@ -0,0 +1,336 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + This is the class that shows the channel nick list + begin: Fre Jun 7 2002 + copyright: (C) 2002 by Dario Abatianni + email: eisfuchs@tigress.com +*/ + +#include "nicklistview.h" +#include "konversationapplication.h" +#include "images.h" +#include "linkaddressbook/addressbook.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +NickListView::NickListView(TQWidget* parent, Channel *chan) : +TDEListView(parent) +{ + TDEListView::setSorting(-1); + setWhatsThis(); + channel=chan; + popup=new TDEPopupMenu(this,"nicklist_context_menu"); + modes=new TDEPopupMenu(this,"nicklist_modes_context_submenu"); + kickban=new TDEPopupMenu(this,"nicklist_kick_ban_context_submenu"); + addressbook= new TDEPopupMenu(this,"nicklist_addressbook_context_submenu"); + setAcceptDrops(true); + setDropHighlighter(true); + setDropVisualizer(false); + + if (popup) + { + popup->insertItem(i18n("&Whois"),Konversation::Whois); + popup->insertItem(i18n("&Version"),Konversation::Version); + popup->insertItem(i18n("&Ping"),Konversation::Ping); + + popup->insertSeparator(); + + if (modes) + { + modes->insertItem(i18n("Give Op"),Konversation::GiveOp); + modes->insertItem(i18n("Take Op"),Konversation::TakeOp); + modes->insertItem(i18n("Give HalfOp"),Konversation::GiveHalfOp); + modes->insertItem(i18n("Take HalfOp"),Konversation::TakeHalfOp); + modes->insertItem(i18n("Give Voice"),Konversation::GiveVoice); + modes->insertItem(i18n("Take Voice"),Konversation::TakeVoice); + popup->insertItem(i18n("Modes"),modes,Konversation::ModesSub); + } + + if (kickban) + { + + kickban->insertItem(i18n("Kick"),Konversation::Kick); + kickban->insertItem(i18n("Kickban"),Konversation::KickBan); + kickban->insertItem(i18n("Ban Nickname"),Konversation::BanNick); + kickban->insertSeparator(); + kickban->insertItem(i18n("Ban *!*@*.host"),Konversation::BanHost); + kickban->insertItem(i18n("Ban *!*@domain"),Konversation::BanDomain); + kickban->insertItem(i18n("Ban *!user@*.host"),Konversation::BanUserHost); + kickban->insertItem(i18n("Ban *!user@domain"),Konversation::BanUserDomain); + kickban->insertSeparator(); + kickban->insertItem(i18n("Kickban *!*@*.host"),Konversation::KickBanHost); + kickban->insertItem(i18n("Kickban *!*@domain"),Konversation::KickBanDomain); + kickban->insertItem(i18n("Kickban *!user@*.host"),Konversation::KickBanUserHost); + kickban->insertItem(i18n("Kickban *!user@domain"),Konversation::KickBanUserDomain); + popup->insertItem(i18n("Kick / Ban"),kickban,Konversation::KickBanSub); + } + + popup->insertItem(i18n("Ignore"), Konversation::IgnoreNick); + popup->insertItem(i18n("Unignore"), Konversation::UnignoreNick); + + popup->insertSeparator(); + + int newitem; + newitem = popup->insertItem(i18n("Open &Query"),Konversation::OpenQuery); + popup->setWhatsThis(newitem, "Start a private chat between you and this person.

Technical note:
The conversation between you and this person will be sent via the server. This means that the conversation will be affected by server lag, server stability, and will be terminated when you disconnect from the server."); + newitem = popup->insertItem(i18n("Open DCC &Chat"),Konversation::StartDccChat); + popup->setWhatsThis(newitem, "Start a private Direct Client Connection chat between you and this person.

Technical note:
The conversation between you and this person will be sent directly. This means it is independent from the server - so if the server connection fails, or use disconnect, your DCC Chat will be unaffected. It also means that no irc server admin can view or spy on this chat."); + + if (kapp->authorize("allow_downloading")) + { + newitem = popup->insertItem(SmallIcon("2rightarrow"),i18n("Send &File..."),Konversation::DccSend); + popup->setWhatsThis(newitem, "Send a file to this person. If you are having problem sending files, or they are sending slowly, see the Konversation Handbook and DCC preferences page."); + } + popup->insertItem(SmallIconSet("mail_generic"),i18n("&Send Email..."), Konversation::SendEmail); + + popup->insertSeparator(); + + if (addressbook) + popup->insertItem(i18n("Addressbook Associations"), addressbook, Konversation::AddressbookSub); + + popup->insertItem(i18n("Add to Watched Nicks"), Konversation::AddNotify); + + connect (popup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + connect (modes, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + connect (kickban, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + connect (addressbook, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + + } + else + { + kdWarning() << "NickListView::NickListView(): Could not create popup!" << endl; + } + + #if KDE_IS_VERSION(3,3,90) + setShadeSortColumn(false); + #endif + + // We have our own tooltips, don't use the default TQListView ones + setShowToolTips(false); + m_tooltip = new Konversation::KonversationNickListViewToolTip(viewport(), this); + + m_resortTimer = new TQTimer(this); + connect(m_resortTimer, TQT_SIGNAL(timeout()), TQT_SLOT(resort())); +} + +NickListView::~NickListView() +{ + delete m_tooltip; + m_tooltip = 0; +} + +void NickListView::setWhatsThis() +{ + Images* images = KonversationApplication::instance()->images(); + + if(images->getNickIcon( Images::Normal, false).isNull()) + { + TQWhatsThis::add(this, i18n("This shows all the people in the channel. The nick for each person is shown.
Usually an icon is shown showing the status of each person, but you do not seem to have any icon theme installed. See the Konversation settings - Configure Konversation under the Settings menu. Then view the page for Themes under Appearence.
")); + } + else + { + TQMimeSourceFactory::defaultFactory()->setImage( "admin", images->getNickIcon( Images::Admin, false ).convertToImage() ); + TQMimeSourceFactory::defaultFactory()->setImage( "owner", images->getNickIcon( Images::Owner, false ).convertToImage()); + TQMimeSourceFactory::defaultFactory()->setImage( "op", images->getNickIcon( Images::Op, false ).convertToImage() ); + TQMimeSourceFactory::defaultFactory()->setImage( "halfop", images->getNickIcon( Images::HalfOp, false ).convertToImage() ); + TQMimeSourceFactory::defaultFactory()->setImage( "voice", images->getNickIcon( Images::Voice, false ).convertToImage() ); + TQMimeSourceFactory::defaultFactory()->setImage( "normal", images->getNickIcon( Images::Normal, false ).convertToImage() ); + TQMimeSourceFactory::defaultFactory()->setImage( "normalaway", images->getNickIcon( Images::Normal, true).convertToImage() ); + + TQWhatsThis::add(this, i18n("This shows all the people in the channel. The nick for each person is shown, with a picture showing their status.

" + "" + + "" + "" + "" + "" + "" + "" + "" + "
This person has administrator privileges.
This person is a channel owner.
This person is a channel operator.
This person is a channel half-operator.
This person has voice, and can therefore talk in a moderated channel.
This person does not have any special privileges.
This indicates that this person is currently away.

" + "The meaning of admin, owner and halfop varies between different IRC servers.

" + "Hovering over any nick shows their current status, as well as any information in the addressbook for this person. See the Konversation Handbook for more information." + "" + )); + } + +} + +void NickListView::refresh() +{ + TQListViewItemIterator it(this); + + while (it.current()) + { + static_cast(it.current())->refresh(); + ++it; + } + + setWhatsThis(); +} + +void NickListView::startResortTimer() +{ + if(!m_resortTimer->isActive()) + m_resortTimer->start(3000, true /*single shot*/); +} + +void NickListView::resort() +{ + TDEListView::setSorting(m_column, m_ascending); + sort(); + TDEListView::setSorting(-1); +} + +void NickListView::contextMenuEvent(TQContextMenuEvent* ce) +{ + ce->accept(); + + if (selectedItems().count()) + { + insertAssociationSubMenu(); + updateActions(); + popup->popup(ce->globalPos()); + } +} + +void NickListView::updateActions() +{ + int ignoreCounter = 0; + int unignoreCounter = 0; + int notifyCounter = 0; + + int serverGroupId = -1; + + if (channel->getServer()->getServerGroup()) + serverGroupId = channel->getServer()->getServerGroup()->id(); + + ChannelNickList nickList=channel->getSelectedChannelNicks(); + ChannelNickList::ConstIterator it; + + for (it = nickList.begin(); it != nickList.end(); ++it) + { + if (Preferences::isIgnored((*it)->getNickname())) + ++unignoreCounter; + else + ++ignoreCounter; + + if (serverGroupId != -1 && Preferences::isNotify(serverGroupId, (*it)->getNickname())) + ++notifyCounter; + } + + if (ignoreCounter) + popup->setItemVisible(Konversation::IgnoreNick, true); + else + popup->setItemVisible(Konversation::IgnoreNick, false); + + if (unignoreCounter) + popup->setItemVisible(Konversation::UnignoreNick, true); + else + popup->setItemVisible(Konversation::UnignoreNick, false); + + if (notifyCounter || !Preferences::hasNotifyList(serverGroupId)) + popup->setItemEnabled(Konversation::AddNotify, false); + else + popup->setItemEnabled(Konversation::AddNotify, true); +} + +void NickListView::insertAssociationSubMenu() +{ + + bool existingAssociation = false; + bool noAssociation = false; + bool emailAddress = false; + + addressbook->clear(); + + ChannelNickList nickList=channel->getSelectedChannelNicks(); + for(ChannelNickList::ConstIterator it=nickList.begin();it!=nickList.end();++it) + { + KABC::Addressee addr = (*it)->getNickInfo()->getAddressee(); + if(addr.isEmpty()) + { + noAssociation=true; + if(existingAssociation && emailAddress) break; + } + else + { + if(!emailAddress && !addr.preferredEmail().isEmpty()) + emailAddress = true; + existingAssociation=true; + if(noAssociation && emailAddress) break; + } + } + + if(!noAssociation && existingAssociation) + { + addressbook->insertItem(SmallIcon("contents"), i18n("Edit Contact..."), Konversation::AddressbookEdit); + addressbook->insertSeparator(); + } + + if(noAssociation && existingAssociation) + addressbook->insertItem(i18n("Choose/Change Associations..."), Konversation::AddressbookChange); + else if(noAssociation) + addressbook->insertItem(i18n("Choose Contact..."), Konversation::AddressbookChange); + else + addressbook->insertItem(i18n("Change Association..."), Konversation::AddressbookChange); + + if(noAssociation && !existingAssociation) + addressbook->insertItem(i18n("Create New Contact..."), Konversation::AddressbookNew); + + if(existingAssociation) + addressbook->insertItem(SmallIcon("editdelete"), i18n("Delete Association"), Konversation::AddressbookDelete); + + if(!emailAddress) + popup->setItemEnabled(Konversation::SendEmail, false); + else + popup->setItemEnabled(Konversation::SendEmail, true); + +} + +void NickListView::setSorting(int column, bool ascending) +{ + m_column = column; + m_ascending = ascending; +} + +bool NickListView::acceptDrag (TQDropEvent* event) const +{ + if (event->provides("text/uri-list")) + { + if (event->source()) + { + TQStrList uris; + + if (TQUriDrag::decode(event,uris)) + { + TQString first = uris.first(); + + if (first.startsWith("irc://") || channel->getNickList().containsNick(first)) + return false; + } + else + return false; + } + + return true; + } + else + return false; +} + +#include "nicklistview.moc" diff --git a/konversation/src/nictdelistview.h b/konversation/src/nictdelistview.h new file mode 100644 index 0000000..a7a2e8f --- /dev/null +++ b/konversation/src/nictdelistview.h @@ -0,0 +1,78 @@ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +*/ + +/* + Channel Nick List, including context menu + begin: Fre Jun 7 2002 + copyright: (C) 2002 by Dario Abatianni + email: eisfuchs@tigress.com +*/ + +#ifndef NICKLISTVIEW_H +#define NICKLISTVIEW_H + +#include "channel.h" +#include "nicklisttooltip.h" +#include "images.h" +#include "common.h" + +#include + + +class TQPopupMenu; +class TQContextMenuEvent; +class TQTimer; + +class NickListView : public TDEListView +{ + Q_OBJECT + + + public: + NickListView(TQWidget* parent, Channel *chan); + ~NickListView(); + + /** Call when the icons have been changed. + */ + void refresh(); + void setWhatsThis(); + + virtual void setSorting(int column, bool ascending); + + public slots: + /** When this is called, resort is guaranteed to be called within a hard-coded time (a few seconds). + * This prevents lots of calls to resort. + */ + void startResortTimer(); + + /** Resort the listview. + * It is better to call startResortTimer() which will resort with a minimum of a + * 1 second delay. + */ + void resort(); + + signals: + /* Will be connected to Channel::popupCommand(int) */ + void popupCommand(int id); + + protected: + void contextMenuEvent(TQContextMenuEvent* ce); + virtual bool acceptDrag (TQDropEvent* event) const; + void insertAssociationSubMenu(); + void updateActions(); + Konversation::KonversationNickListViewToolTip *m_tooltip; + TQPopupMenu* popup; + TQPopupMenu* modes; + TQPopupMenu* kickban; + TQPopupMenu* addressbook; + Channel *channel; + TQTimer *m_resortTimer; + + int m_column; + bool m_ascending; +}; +#endif -- cgit v1.2.1