clean up SecurityItem, removed unused old stuff

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7020 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-01-16 17:52:41 +00:00
parent 7f71619c93
commit 6fa0d894d0
3 changed files with 19 additions and 130 deletions

View File

@ -50,8 +50,6 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
messageframe->setVisible(false);
sendmsgButton->setEnabled(false);
quickmsgButton->hide();
chatButton->hide();
removeFriendButton->setEnabled(false);
@ -66,10 +64,6 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
/* specific ones */
connect( chatButton, SIGNAL( clicked( void ) ), this, SLOT( openChat ( void ) ) );
// connect( actionNew_Message, SIGNAL( triggered( ) ), this, SLOT( sendMsg ( void ) ) );
// connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
// connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( quickmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMsg() ) );
@ -79,9 +73,6 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
//QMenu *msgmenu = new QMenu();
//msgmenu->addAction(actionNew_Message);
//quickmsgButton->setMenu(msgmenu);
avatar->setId(mSslId, false);
@ -401,42 +392,3 @@ void SecurityItem::openChat()
mParent->openChat(mGpgId);
}
}
void SecurityItem::togglequickmessage()
{
if (messageframe->isHidden())
{
messageframe->setVisible(true);
}
else
{
messageframe->setVisible(false);
}
}
void SecurityItem::sendMessage()
{
/* construct a message */
MessageInfo mi;
mi.title = tr("Quick Message").toStdWString();
mi.msg = quickmsgText->toHtml().toStdWString();
mi.msgto.push_back(mGpgId);
rsMsgs->MessageSend(mi);
quickmsgText->clear();
messageframe->setVisible(false);
}
void SecurityItem::on_quickmsgText_textChanged()
{
if (quickmsgText->toPlainText().isEmpty())
{
sendmsgButton->setEnabled(false);
}
else
{
sendmsgButton->setEnabled(true);
}
}

View File

@ -57,10 +57,7 @@ private slots:
void updateItem();
void togglequickmessage();
void sendMessage();
void on_quickmsgText_textChanged();
private:
FeedHolder *mParent;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>961</width>
<height>406</height>
<width>856</width>
<height>268</height>
</rect>
</property>
<layout class="QGridLayout">
@ -17,7 +17,7 @@
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -74,14 +74,17 @@
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0" rowspan="2">
@ -98,6 +101,9 @@
<height>70</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="0" column="1">
@ -113,7 +119,7 @@
<string notr="true">Peer Name</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -150,16 +156,16 @@
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>14</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>wants to be friend with you on RetroShare</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -395,72 +401,6 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="messageframe">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>130</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout">
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QPushButton" name="cancelButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="sendmsgButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Send</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>469</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QTextEdit" name="quickmsgText"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="expandFrame">
<layout class="QGridLayout">
<item row="0" column="0">