~ubuntu-branches/ubuntu/utopic/dianara/utopic-backports

« back to all changes in this revision

Viewing changes to src/contactcard.cpp

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2015-06-09 11:55:30 UTC
  • mfrom: (8.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20150609115530-n1r0s0z83yxdmsc5
Tags: 1.3.0-2~ubuntu14.10.1
No-change backport to utopic (LP: #1462684)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *   This file is part of Dianara
3
 
 *   Copyright 2012-2014  JanKusanagi <janjabber@gmail.com>
 
3
 *   Copyright 2012-2015  JanKusanagi JRR <jancoding@gmx.com>
4
4
 *
5
5
 *   This program is free software; you can redistribute it and/or modify
6
6
 *   it under the terms of the GNU General Public License as published by
37
37
 
38
38
 
39
39
    // Left widget, user avatar
40
 
    avatarLabel = new QLabel();
 
40
    avatarLabel = new QLabel(this);
41
41
 
42
42
    this->contactAvatarUrl = asPerson->getAvatar();
43
43
 
88
88
                              + "</small>");
89
89
    }
90
90
 
91
 
    userInfoLabel = new QLabel();
 
91
    userInfoLabel = new QLabel(this);
92
92
    userInfoLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
93
93
    userInfoLabel->setText(userInfoString);
94
94
    userInfoLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
95
95
    userInfoLabel->setWordWrap(true);
 
96
    userInfoLabel->setSizePolicy(QSizePolicy::Ignored,
 
97
                                 QSizePolicy::MinimumExpanding);
96
98
 
97
99
 
98
100
    // Bio as tooltip for the whole contact card
124
126
 
125
127
 
126
128
    // Right column, buttons
127
 
    followButton = new QPushButton("*follow*");
 
129
    followButton = new QPushButton("*follow*", this);
128
130
    followButton->setFlat(true);    
129
131
    if (asPerson->isFollowed())
130
132
    {
136
138
    }
137
139
 
138
140
 
139
 
    openProfileAction = new QAction(QIcon::fromTheme("internet-web-browser"),
 
141
    openProfileAction = new QAction(QIcon::fromTheme("internet-web-browser",
 
142
                                                     QIcon(":/images/button-download.png")),
140
143
                                    tr("Open Profile in Web Browser"),
141
144
                                    this);
142
145
    connect(openProfileAction, SIGNAL(triggered()),
149
152
    connect(sendMessageAction, SIGNAL(triggered()),
150
153
            this, SLOT(setMessagingModeForContact()));
151
154
 
152
 
    addToListMenu = new QMenu(tr("In Lists..."));
 
155
    addToListMenu = new QMenu(tr("In Lists..."), this);
153
156
    addToListMenu->setIcon(QIcon::fromTheme("format-list-unordered"));
154
157
    addToListMenu->addAction("fake list 1")->setCheckable(true); // FIXME...
155
158
    addToListMenu->addAction("fake list 2")->setCheckable(true);
156
159
    addToListMenu->addAction("fake list 3")->setCheckable(true);
157
160
 
158
161
 
159
 
    optionsMenu = new QMenu("*options*");
 
162
    optionsMenu = new QMenu("*options*", this);
160
163
    optionsMenu->addAction(openProfileAction);
161
164
    optionsMenu->addAction(sendMessageAction);
162
165
    //optionsMenu->addMenu(addToListMenu); // Don't include it for now, until 1.3 /FIXME
164
167
 
165
168
    optionsButton = new QPushButton(QIcon::fromTheme("user-properties",
166
169
                                                     QIcon(":/images/no-avatar.png")),
167
 
                                    tr("User Options"));
 
170
                                    tr("User Options"),
 
171
                                    this);
168
172
    optionsButton->setFlat(true);
169
173
    optionsButton->setMenu(optionsMenu);
170
174
 
289
293
 
290
294
void ContactCard::setMessagingModeForContact()
291
295
{
292
 
    this->globalObj->createMessageForContact(this->contactName,
293
 
                                             this->contactId);
 
296
    this->globalObj->createMessageForContact(this->contactId,
 
297
                                             this->contactName,
 
298
                                             this->contactUrl);
294
299
}
295
300
 
296
301