Added a Button for display own nick and set a menu for the status, removed nick label and status Combobox

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3409 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-08-30 19:10:07 +00:00
parent 77418bd4b6
commit 005cf957f8
2 changed files with 128 additions and 106 deletions

View File

@ -200,7 +200,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
_rsLogoBarmessenger = new LogoBar(ui.logoframe); _rsLogoBarmessenger = new LogoBar(ui.logoframe);
Widget::createLayout(ui.logoframe)->addWidget(_rsLogoBarmessenger); Widget::createLayout(ui.logoframe)->addWidget(_rsLogoBarmessenger);
ui.statuscomboBox->setMinimumWidth(20);
ui.messagelineEdit->setMinimumWidth(20); ui.messagelineEdit->setMinimumWidth(20);
itemFont = QFont("ARIAL", 10); itemFont = QFont("ARIAL", 10);
@ -214,14 +213,14 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
// add self nick // add self nick
RsPeerDetails pd; RsPeerDetails pd;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) { if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
QString titleStr("<span style=\"font-size:14pt; font-weight:500;" ui.statusButton->setText(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location));
"color:#FFFFFF;\">%1</span>");
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location)));
} }
MainWindow *pMainWindow = MainWindow::getInstance(); MainWindow *pMainWindow = MainWindow::getInstance();
if (pMainWindow) { if (pMainWindow) {
pMainWindow->initializeStatusObject(ui.statuscomboBox, true); QMenu *pStatusMenu = new QMenu();
pMainWindow->initializeStatusObject(pStatusMenu, true);
ui.statusButton->setMenu(pStatusMenu);
} }
insertPeers(); insertPeers();
updateAvatar(); updateAvatar();
@ -243,7 +242,7 @@ MessengerWindow::~MessengerWindow ()
MainWindow *pMainWindow = MainWindow::getInstance(); MainWindow *pMainWindow = MainWindow::getInstance();
if (pMainWindow) { if (pMainWindow) {
pMainWindow->removeStatusObject(ui.statuscomboBox); pMainWindow->removeStatusObject(ui.statusButton);
} }
_instance = NULL; _instance = NULL;
@ -500,7 +499,7 @@ void MessengerWindow::insertPeers()
gpg_item -> setTextAlignment(COLUMN_NAME, Qt::AlignLeft | Qt::AlignVCenter ); gpg_item -> setTextAlignment(COLUMN_NAME, Qt::AlignLeft | Qt::AlignVCenter );
gpg_item -> setSizeHint(COLUMN_NAME, QSize( 27,27 ) ); gpg_item -> setSizeHint(COLUMN_NAME, QSize( 34,34 ) );
/* not displayed, used to find back the item */ /* not displayed, used to find back the item */
gpg_item -> setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id)); gpg_item -> setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id));
@ -653,7 +652,7 @@ void MessengerWindow::insertPeers()
QPixmap avatar ; QPixmap avatar ;
avatar.loadFromData(data,size,"PNG") ; avatar.loadFromData(data,size,"PNG") ;
QIcon avatar_icon(avatar); QIcon avatar_icon(avatar);
QSize av_icon_size(100, 100); QSize av_icon_size(32, 32);
gpg_item-> setIcon(1, avatar_icon); gpg_item-> setIcon(1, avatar_icon);
delete[] data; delete[] data;

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>295</width> <width>236</width>
<height>482</height> <height>482</height>
</rect> </rect>
</property> </property>
@ -27,127 +27,147 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="messengerframetop"> <widget class="QFrame" name="messengerframetop">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>82</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">#messengerframetop { <string notr="true">QFrame#messengerframetop{
border: none; background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #05538B, stop:1 #E4F1E5);
stop: 0 #a6a6a6, stop: 0.08 #7f7f7f, }</string>
stop: 0.39999 #717171, stop: 0.4 #626262,
stop: 0.9 #4c4c4c, stop: 1 #333333);
}
</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin"> <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin"> <item row="0" column="0">
<number>6</number> <widget class="QToolButton" name="avatarButton">
</property> <property name="minimumSize">
<property name="rightMargin"> <size>
<number>6</number> <width>70</width>
</property> <height>70</height>
<property name="bottomMargin"> </size>
<number>2</number> </property>
</property> <property name="maximumSize">
<property name="spacing"> <size>
<number>0</number> <width>70</width>
</property> <height>70</height>
<item row="0" column="0" colspan="2"> </size>
<layout class="QGridLayout"> </property>
<item row="0" column="0"> <property name="toolTip">
<widget class="QToolButton" name="avatarButton"> <string>Click to Change your Avatar</string>
</property>
<property name="styleSheet">
<string notr="true">QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);}</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/user/personal64.png</normaloff>:/images/user/personal64.png</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="statusButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>70</width> <width>100</width>
<height>70</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="font">
<size> <font>
<width>70</width> <pointsize>11</pointsize>
<height>70</height> </font>
</size>
</property>
<property name="toolTip">
<string>Click to Change your Avatar</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);}</string> <string notr="true">QPushButton:hover {
border: 2px solid #8f8f91;
border-radius: 6px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #f6f7fa, stop: 1 #dadbde);
min-width: 80px;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
}</string>
</property> </property>
<property name="icon"> <property name="text">
<iconset resource="images.qrc"> <string/>
<normaloff>:/images/user/personal64.png</normaloff>:/images/user/personal64.png</iconset>
</property> </property>
<property name="iconSize"> <property name="flat">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="2">
<layout class="QGridLayout"> <spacer name="horizontalSpacer_2">
<property name="margin"> <property name="orientation">
<number>4</number> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="spacing"> <property name="sizeHint" stdset="0">
<number>6</number> <size>
<width>50</width>
<height>20</height>
</size>
</property> </property>
<item row="1" column="0"> </spacer>
<widget class="QComboBox" name="statuscomboBox"> </item>
<property name="enabled"> <item row="1" column="0" colspan="3">
<bool>true</bool> <widget class="QLineEdit" name="messagelineEdit">
</property> <property name="toolTip">
<property name="toolTip"> <string>Change your Personal Status here...</string>
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; </property>
p, li { white-space: pre-wrap; } <property name="styleSheet">
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt; <string notr="true">border: 1px solid #CCCCCC;</string>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Change your Status and your display&lt;/p&gt; </property>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;picture here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> </widget>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLineEdit" name="messagelineEdit">
<property name="toolTip">
<string>Change your Personal Status here...</string>
</property>
<property name="styleSheet">
<string notr="true">border: 1px solid #CCCCCC;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="nicklabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -423,6 +443,9 @@ border: 1px solid #CCCCCC;
<attribute name="headerShowSortIndicator" stdset="0"> <attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -435,8 +458,8 @@ border: 1px solid #CCCCCC;
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>295</width> <width>236</width>
<height>21</height> <height>20</height>
</rect> </rect>
</property> </property>
</widget> </widget>