diff -ur ../psi-cvs/psi/src/avatars.h ./psi/src/avatars.h --- ../psi-cvs/psi/src/avatars.h 2005-04-07 14:46:14.000000000 +0200 +++ ./psi/src/avatars.h 2005-06-26 09:29:21.000000000 +0200 @@ -1,7 +1,7 @@ #ifndef AVATARS_H #define AVATARS_H -//#define AVATARS +#define AVATARS #include #include diff -ur ../psi-cvs/psi/src/contactview.cpp ./psi/src/contactview.cpp --- ../psi-cvs/psi/src/contactview.cpp 2005-06-24 22:32:05.000000000 +0200 +++ ./psi/src/contactview.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -554,6 +554,17 @@ removeUnneededContactItems(e); } +void ContactProfile::resetAllContactItemNames() +{ + QPtrListIterator it(d->roster); + for(Entry *e; (e = it.current()); ++it) { + QPtrListIterator cvi_it(e->cvi); + for(ContactViewItem *i; (i = cvi_it.current()); ++cvi_it) { + i->resetName(); + } + } +} + void ContactProfile::removeEntry(const Jid &j) { Entry *e = findEntry(j); @@ -1512,6 +1523,7 @@ if((i->type() == ContactViewItem::Contact && i->u()->inList()) || (i->type() == ContactViewItem::Group && i->groupType() == ContactViewItem::gUser && i->groupName() != ContactView::tr("Hidden"))) { + i->resetName(true); i->setRenameEnabled(0, true); i->startRename(0); i->setRenameEnabled(0, false); @@ -1607,6 +1619,7 @@ //e->u.setName(text); //i->setContact(&e->u); actionRename(e->u.jid(), text); + i->resetName(); // to put the status message in if needed } else { // no change? @@ -1856,6 +1869,7 @@ v_showHidden = true; v_showAgents = true; v_showSelf = true; + v_showStatusMsg = true; d->lastSize = QSize( 0, 0 ); @@ -2043,6 +2057,19 @@ } } +void ContactView::setShowStatusMsg(bool x) +{ + if (v_showStatusMsg != x) { + v_showStatusMsg = x; + emit showStatusMsg(v_showStatusMsg); + + QPtrListIterator it(d->profiles); + for(ContactProfile *cp; (cp = it.current()); ++it) { + cp->resetAllContactItemNames(); + } + } +} + void ContactView::setShowAgents(bool x) { @@ -2891,15 +2918,34 @@ if ( !d->alerting && d->u ) { setIcon(is->statusPtr(d->u)); } + + // If the status is shown, update the text of the item too + if (static_cast(QListViewItem::listView())->isShowStatusMsg()) { + resetName(); + } } -void ContactViewItem::resetName() +void ContactViewItem::resetName(bool forceNoStatusMsg) { - resetStatus(); if ( d->u ) { QString s = jidnick(d->u->jid().full(), d->u->name()); - if ( s != text(0) ) + + // Add the status message if wanted + if (!forceNoStatusMsg && static_cast(QListViewItem::listView())->isShowStatusMsg()) { + QString statusMsg; + if (d->u->priority() != d->u->userResourceList().end()) + statusMsg = (*d->u->priority()).status().status(); + else + statusMsg = d->u->lastUnavailableStatus().status(); + + statusMsg = statusMsg.simplifyWhiteSpace(); + if (!statusMsg.isEmpty()) + s += " (" + statusMsg + ")"; + } + + if ( s != text(0) ) { setText(0, s); + } } } @@ -3144,6 +3190,12 @@ } } +void ContactViewItem::cancelRename (int i) +{ + QListViewItem::cancelRename(i); + resetName(); +} + int ContactViewItem::rtti() const { return 5103; Tylko w ./psi/src: contactview.cpp~ diff -ur ../psi-cvs/psi/src/contactview.h ./psi/src/contactview.h --- ../psi-cvs/psi/src/contactview.h 2005-06-24 22:32:05.000000000 +0200 +++ ./psi/src/contactview.h 2005-06-26 09:29:22.000000000 +0200 @@ -71,6 +71,7 @@ void addAllNeededContactItems(); void removeAllUnneededContactItems(); + void resetAllContactItemNames(); void ensureVisible(const Jid &); void clear(); @@ -182,6 +183,7 @@ bool isShowAway() const { return v_showAway; } bool isShowHidden() const { return v_showHidden; } bool isShowSelf() const { return v_showSelf; } + bool isShowStatusMsg() const { return v_showStatusMsg; } void clear(); void resetAnim(); @@ -205,6 +207,7 @@ void showHidden(bool); void showAgents(bool); void showSelf(bool); + void showStatusMsg(bool); public slots: void setShowOffline(bool); @@ -212,6 +215,7 @@ void setShowAway(bool); void setShowHidden(bool); void setShowSelf(bool); + void setShowStatusMsg(bool); void optionsUpdate(); void recalculateSize(); @@ -244,7 +248,7 @@ Private *d; QPoint mousePressPos; // store pressed position, idea taken from Licq - bool v_showOffline, v_showAgents, v_showAway, v_showHidden, v_showSelf; + bool v_showOffline, v_showAgents, v_showAway, v_showHidden, v_showSelf, v_showStatusMsg; bool lcto_active; // double click active? QPoint lcto_pos; QListViewItem *lcto_item; @@ -294,7 +298,7 @@ void setIcon(const Icon *, bool alert = false); void resetStatus(); - void resetName(); // use this to cancel a rename + void resetName(bool forceNoStatusMsg = false); // use this to cancel a rename void resetGroupName(); void updatePosition(); @@ -321,6 +325,7 @@ void dragEntered(); void dragLeft(); void dropped(QDropEvent *); + void cancelRename (int); private: class Private; Tylko w ./psi/src: contactview.h~ diff -ur ../psi-cvs/psi/src/mainwin.cpp ./psi/src/mainwin.cpp --- ../psi-cvs/psi/src/mainwin.cpp 2005-06-09 22:44:05.000000000 +0200 +++ ./psi/src/mainwin.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -278,6 +278,8 @@ d->getAction("show_hidden")->addTo(viewMenu); d->getAction("show_agents")->addTo(viewMenu); d->getAction("show_self")->addTo(viewMenu); + viewMenu->insertSeparator(); + d->getAction("show_statusmsg")->addTo(viewMenu); // Mac-only menus #ifdef Q_WS_MAC @@ -344,6 +346,7 @@ { "show_hidden", toggled, cvlist, SLOT( setShowHidden(bool) ) }, { "show_agents", toggled, cvlist, SLOT( setShowAgents(bool) ) }, { "show_self", toggled, cvlist, SLOT( setShowSelf(bool) ) }, + { "show_statusmsg", toggled, cvlist, SLOT( setShowStatusMsg(bool) ) }, { "button_options", activated, this, SIGNAL( doOptions() ) }, @@ -394,6 +397,7 @@ { "show_offline", cvlist, SIGNAL( showOffline(bool) ), setOn }, { "show_self", cvlist, SIGNAL( showSelf(bool) ), setOn }, { "show_agents", cvlist, SIGNAL( showAgents(bool) ), setOn }, + { "show_statusmsg", cvlist, SIGNAL( showStatusMsg(bool) ), setOn }, { "", 0, 0, 0 } }; Tylko w ./psi/src: mainwin.cpp~ diff -ur ../psi-cvs/psi/src/profiles.h ./psi/src/profiles.h --- ../psi-cvs/psi/src/profiles.h 2005-06-03 12:54:19.000000000 +0200 +++ ./psi/src/profiles.h 2005-06-26 09:31:16.000000000 +0200 @@ -43,7 +43,7 @@ QString jid, pass, host, resource; int port, priority; bool opt_enabled, opt_ssl, opt_pass, opt_host, opt_auto, opt_keepAlive, opt_plain, opt_log, opt_reconn, opt_ignoreSSLWarnings; - bool tog_offline, tog_away, tog_agents, tog_hidden, tog_self; + bool tog_offline, tog_away, tog_agents, tog_hidden, tog_self, tog_statusmsg; int proxy_index; int proxy_type, proxy_port; Tylko w ./psi/src: profiles.h~ Tylko w ./psi/src: profiles.h.rej diff -ur ../psi-cvs/psi/src/psiaccount.cpp ./psi/src/psiaccount.cpp --- ../psi-cvs/psi/src/psiaccount.cpp 2005-06-10 22:12:50.000000000 +0200 +++ ./psi/src/psiaccount.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -513,7 +513,7 @@ connect(d->psi, SIGNAL(pgpToggled(bool)), SLOT(pgpToggled(bool))); connect(d->psi, SIGNAL(pgpKeysUpdated()), SLOT(pgpKeysUpdated())); - d->psi->setToggles(d->acc.tog_offline, d->acc.tog_away, d->acc.tog_agents, d->acc.tog_hidden,d->acc.tog_self); + d->psi->setToggles(d->acc.tog_offline, d->acc.tog_away, d->acc.tog_agents, d->acc.tog_hidden,d->acc.tog_self, d->acc.tog_statusmsg); d->setEnabled(d->acc.opt_enabled); @@ -620,7 +620,7 @@ const UserAccount & PsiAccount::userAccount() const { - d->psi->getToggles(&d->acc.tog_offline, &d->acc.tog_away, &d->acc.tog_agents, &d->acc.tog_hidden,&d->acc.tog_self); + d->psi->getToggles(&d->acc.tog_offline, &d->acc.tog_away, &d->acc.tog_agents, &d->acc.tog_hidden,&d->acc.tog_self,&d->acc.tog_statusmsg); // save the roster and pgp key bindings d->acc.roster.clear(); diff -ur ../psi-cvs/psi/src/psiactionlist.cpp ./psi/src/psiactionlist.cpp --- ../psi-cvs/psi/src/psiactionlist.cpp 2004-08-12 13:26:24.000000000 +0200 +++ ./psi/src/psiactionlist.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -127,6 +127,9 @@ IconAction *showSelf = new IconAction (tr("Show Self Contact"), "psi/self", tr("Show Self Contact"), 0, viewGroups, 0, true); showSelf->setWhatsThis (tr("Toggles visibility of self contact in roster")); + IconAction *showStatusMsg = new IconAction (tr("Show Status Messages"), "psi/statusmsg", tr("Show Status Messages"), 0, viewGroups, 0, true); + showSelf->setWhatsThis (tr("Toggles visibility of status messages of contacts")); + ActionNames actions[] = { { "view_groups", viewGroups }, { "show_offline", showOffline }, @@ -134,6 +137,7 @@ { "show_hidden", showHidden }, { "show_agents", showAgents }, { "show_self", showSelf }, + { "show_statusmsg", showStatusMsg }, { "", 0 } }; diff -ur ../psi-cvs/psi/src/psicon.cpp ./psi/src/psicon.cpp --- ../psi-cvs/psi/src/psicon.cpp 2005-06-24 22:32:06.000000000 +0200 +++ ./psi/src/psicon.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -1054,7 +1054,7 @@ } } -void PsiCon::setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self) +void PsiCon::setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self, bool tog_statusmsg) { if(d->listEnabled.count() > 1) return; @@ -1064,15 +1064,17 @@ d->mainwin->cvlist->setShowAgents(tog_agents); d->mainwin->cvlist->setShowHidden(tog_hidden); d->mainwin->cvlist->setShowSelf(tog_self); + d->mainwin->cvlist->setShowStatusMsg(tog_statusmsg); } -void PsiCon::getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self) +void PsiCon::getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self, bool *tog_statusmsg) { *tog_offline = d->mainwin->cvlist->isShowOffline(); *tog_away = d->mainwin->cvlist->isShowAway(); *tog_agents = d->mainwin->cvlist->isShowAgents(); *tog_hidden = d->mainwin->cvlist->isShowHidden(); *tog_self = d->mainwin->cvlist->isShowSelf(); + *tog_statusmsg = d->mainwin->cvlist->isShowStatusMsg(); } void PsiCon::doOptions() Tylko w ./psi/src: psicon.cpp~ diff -ur ../psi-cvs/psi/src/psicon.h ./psi/src/psicon.h --- ../psi-cvs/psi/src/psicon.h 2005-02-28 16:45:12.000000000 +0100 +++ ./psi/src/psicon.h 2005-06-26 09:29:22.000000000 +0200 @@ -197,8 +197,8 @@ friend class PsiAccount; void link(PsiAccount *); void unlink(PsiAccount *); - void setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self); - void getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self); + void setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self, bool tog_statusmsg); + void getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self, bool *tog_statusmsg); friend class EventQueue; int getId(); diff -ur ../psi-cvs/psi/src/psi_profiles.cpp ./psi/src/psi_profiles.cpp --- ../psi-cvs/psi/src/psi_profiles.cpp 2005-06-24 22:32:05.000000000 +0200 +++ ./psi/src/psi_profiles.cpp 2005-06-26 09:29:22.000000000 +0200 @@ -66,6 +66,7 @@ opt_reconn = FALSE; opt_ignoreSSLWarnings = false; pgpSecretKeyID = ""; + tog_statusmsg = TRUE; proxy_index = 0; proxy_type = PROXY_NONE; @@ -96,6 +97,7 @@ setBoolAttribute(a, "showHidden", tog_hidden); setBoolAttribute(a, "showAgents", tog_agents); setBoolAttribute(a, "showSelf", tog_self); + setBoolAttribute(a, "showStatusMsg", tog_statusmsg); setBoolAttribute(a, "keepAlive", opt_keepAlive); setBoolAttribute(a, "plain", opt_plain); setBoolAttribute(a, "log", opt_log); @@ -203,6 +205,7 @@ readBoolAttribute(a, "showHidden", &tog_hidden); readBoolAttribute(a, "showAgents", &tog_agents); readBoolAttribute(a, "showSelf", &tog_self); + readBoolAttribute(a, "showStatusMsg", &tog_statusmsg); readBoolAttribute(a, "keepAlive", &opt_keepAlive); readBoolAttribute(a, "plain", &opt_plain); readBoolAttribute(a, "log", &opt_log); @@ -384,7 +387,7 @@ prefs.showGroupCounts = true; prefs.smallChats = false; prefs.chatLineEdit = false; - prefs.useTabs = false; + prefs.useTabs = true; prefs.putTabsAtBottom = false; prefs.autoRosterSize = false; prefs.autoResolveNicksOnAdd = false; @@ -518,7 +521,7 @@ tb[1].name = QObject::tr("Show contacts"); tb[1].on = defaultEnableToolbars; tb[1].locked = true; - tb[1].keys << "show_offline" << "show_away" << "show_agents" << "show_self"; + tb[1].keys << "show_offline" << "show_away" << "show_agents" << "spacer" << "show_statusmsg"; tb[2].name = QObject::tr("Event notifier"); tb[2].on = false;