-Removed the status dropdown from BlogDialog.ui

Added a button to set the users status
-Changed the setStatus code for testing (just prints the users status)
-Fixed a typo in one of the comments in rsQblog.h
-Renamed a few of the Qt objects and a few of the variables/functions in 
the code so that they made more logical sense.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@542 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
rwoodruff91 2008-05-10 12:16:34 +00:00
parent ae96b742b1
commit 4450f1e911
4 changed files with 53 additions and 107 deletions

View File

@ -21,6 +21,7 @@
#include <QtGui>
#include "BlogDialog.h"
#include "rsiface/rsQblog.h"
/** Constructor */
BlogDialog::BlogDialog(QWidget *parent)
@ -30,27 +31,23 @@ BlogDialog::BlogDialog(QWidget *parent)
setupUi(this);
connect(sendBtn, SIGNAL(clicked()), this, SLOT(sendBlog()));
connect(statusBtn, SIGNAL(clicked()), this, SLOT(setStatus()));
connect(boldBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(underlineBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(italicBtn, SIGNAL(clicked()), this, SLOT(setFont()));
connect(statusBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setStatus()));
/* Current Font */
mCurrentFont = QFont("Comic Sans MS", 8);
/* Current user status - online by default */
currentStatus = "Online";
}
void BlogDialog::sendBlog()
{
QString msg = lineEdit->toPlainText();
QString blogMsg = lineEdit->toPlainText();
msgText->setCurrentFont(mCurrentFont);
blogText->setCurrentFont(mCurrentFont);
/* Write text into windows */
msgText->append(msg);
/* Write blog message to window */
blogText->append(blogMsg);
/* Clear lineEdit */
lineEdit->clear();
@ -69,10 +66,16 @@ void BlogDialog::setFont()
void BlogDialog::setStatus()
{
currentStatus = statusBox->currentText();
QString statusMsg = lineEdit->toPlainText();
blogText->setCurrentFont(mCurrentFont);
/* Write status to window */
blogText->append(statusMsg);
/* Clear lineEdit */
lineEdit->clear();
/* for testing */
/* msgText->append(currentStatus); */
}

View File

@ -50,10 +50,6 @@ private:
/* Current Font */
QFont mCurrentFont;
/* Current status, online by default */
QString currentStatus;
};
#endif

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>757</width>
<height>494</height>
<width>618</width>
<height>424</height>
</rect>
</property>
<property name="sizePolicy" >
@ -509,8 +509,8 @@
<rect>
<x>460</x>
<y>6</y>
<width>211</width>
<height>356</height>
<width>151</width>
<height>389</height>
</rect>
</property>
<layout class="QGridLayout" >
@ -604,7 +604,7 @@
</font>
</property>
<property name="text" >
<string>User status:</string>
<string>Users:</string>
</property>
</widget>
</item>
@ -653,11 +653,6 @@
<string>User</string>
</property>
</column>
<column>
<property name="text" >
<string>Status</string>
</property>
</column>
</widget>
</item>
</layout>
@ -763,7 +758,7 @@
</layout>
</item>
<item row="1" column="0" >
<widget class="QTextBrowser" name="msgText" >
<widget class="QTextBrowser" name="blogText" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
@ -783,65 +778,7 @@
</item>
</layout>
</widget>
<widget class="QComboBox" name="statusBox" >
<property name="geometry" >
<rect>
<x>600</x>
<y>368</y>
<width>71</width>
<height>27</height>
</rect>
</property>
<property name="font" >
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentIndex" >
<number>0</number>
</property>
<item>
<property name="text" >
<string>Online</string>
</property>
</item>
<item>
<property name="text" >
<string>Away</string>
</property>
</item>
<item>
<property name="text" >
<string>Busy</string>
</property>
</item>
<item>
<property name="text" >
<string>Offline</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label_3" >
<property name="geometry" >
<rect>
<x>503</x>
<y>371</y>
<width>101</width>
<height>20</height>
</rect>
</property>
<property name="font" >
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Current Status:</string>
</property>
</widget>
<widget class="QWidget" name="" >
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>0</x>
@ -857,7 +794,7 @@
<property name="verticalSpacing" >
<number>1</number>
</property>
<item row="0" column="0" >
<item row="0" column="0" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@ -870,7 +807,7 @@
</property>
</spacer>
</item>
<item row="0" column="1" >
<item row="0" column="2" >
<widget class="QPushButton" name="boldBtn" >
<property name="minimumSize" >
<size>
@ -898,7 +835,7 @@
</property>
</widget>
</item>
<item row="0" column="2" >
<item row="0" column="3" >
<widget class="QPushButton" name="underlineBtn" >
<property name="minimumSize" >
<size>
@ -926,7 +863,7 @@
</property>
</widget>
</item>
<item row="0" column="3" >
<item row="0" column="4" >
<widget class="QPushButton" name="italicBtn" >
<property name="minimumSize" >
<size>
@ -954,7 +891,7 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="4" >
<item row="1" column="0" colspan="5" >
<widget class="QTextEdit" name="lineEdit" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Expanding" >
@ -982,26 +919,36 @@
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>360</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="3" >
<item row="2" column="2" colspan="3" >
<widget class="QPushButton" name="sendBtn" >
<property name="text" >
<string>Send</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QPushButton" name="statusBtn" >
<property name="text" >
<string>Set Status</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>245</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<action name="actionSend" >
@ -1016,7 +963,7 @@
</action>
</widget>
<tabstops>
<tabstop>msgText</tabstop>
<tabstop>blogText</tabstop>
</tabstops>
<resources>
<include location="images.qrc" />

View File

@ -32,7 +32,7 @@
#include <map>
/* delcare interafce for everyone o use */
/* delcare interface for everyone to use */
class RsQblog;
extern RsQblog *rsQblog;