~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to src/gcuserview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "psiiconset.h"
33
33
#include "groupchatdlg.h"
34
34
#include "common.h"
 
35
#include "psioptions.h"
35
36
 
36
37
static bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
37
38
{
74
75
{
75
76
        QColorGroup xcg = cg;
76
77
        QFont f = p->font();
77
 
        f.setPointSize(option.smallFontSize);
 
78
        f.setPointSize(common_smallFontSize);
78
79
        p->setFont(f);
79
 
        xcg.setColor(QColorGroup::Text, option.color[cGroupFore]);
80
 
        if (!option.clNewHeadings) {
 
80
        xcg.setColor(QColorGroup::Text, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-foreground").value<QColor>());
 
81
        if (!PsiOptions::instance()->getOption("options.ui.look.contactlist.use-slim-group-headings").toBool()) {
81
82
                #if QT_VERSION < 0x040301
82
 
                        xcg.setColor(QColorGroup::Background, option.color[cGroupBack]);
 
83
                        xcg.setColor(QColorGroup::Background, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>());
83
84
                #else
84
 
                        xcg.setColor(QColorGroup::Base, option.color[cGroupBack]);
 
85
                        xcg.setColor(QColorGroup::Base, PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>());
85
86
                #endif
86
87
        }
87
88
        Q3ListViewItem::paintCell(p, xcg, column, width, alignment);
88
 
        if (option.clNewHeadings && !isSelected()) {
 
89
        if (PsiOptions::instance()->getOption("options.ui.look.contactlist.use-slim-group-headings").toBool() && !isSelected()) {
89
90
                QFontMetrics fm(p->font());
90
91
                int x = fm.width(text(column)) + 8;
91
92
                if(x < width - 8) {
92
93
                        int h = (height() / 2) - 1;
93
 
                        p->setPen(QPen(option.color[cGroupBack]));
 
94
                        p->setPen(QPen(PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-background").value<QColor>()));
94
95
                        p->drawLine(x, h, width - 8, h);
95
96
                        h++;
96
 
                        p->setPen(QPen(option.color[cGroupFore]));
 
97
                        p->setPen(QPen(PsiOptions::instance()->getOption("options.ui.look.colors.contactlist.grouping.header-foreground").value<QColor>()));
97
98
                        p->drawLine(x, h, width - 8, h);
98
99
                }
99
100
        }
270
271
        const Status &s = lvi->s;
271
272
        UserListItem u;
272
273
        // SICK SICK SICK SICK
273
 
        GCMainDlg* dlg = (GCMainDlg*) window();
 
274
        GCMainDlg* dlg = gcDlg_;
 
275
        if (!dlg) {
 
276
                qDebug("Calling maybetip on an entity without an owning dialog");
 
277
                return false;
 
278
        }
274
279
        u.setJid(dlg->jid().withResource(nick));
275
280
        u.setName(nick);
276
281
 
306
311
                return;
307
312
 
308
313
        GCUserViewItem *lvi = (GCUserViewItem *)i;
309
 
        if(option.defaultAction == 0)
 
314
        if(PsiOptions::instance()->getOption("options.messages.default-outgoing-message-type").toString() == "message")
310
315
                action(lvi->text(0), lvi->s, 0);
311
316
        else
312
317
                action(lvi->text(0), lvi->s, 1);