fixed items not editable and added again a splitter

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2302 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-02-13 22:13:13 +00:00
parent 5926c79822
commit 6c7ce4f3e2
2 changed files with 415 additions and 411 deletions

View File

@ -645,8 +645,7 @@ void MessagesDialog::insertMessages()
} }
/* make a widget per friend */ /* make a widget per friend */
//QModelIndex index;
QStandardItem *item0 = new QStandardItem(); QStandardItem *item0 = new QStandardItem();
QStandardItem *item1 = new QStandardItem(); QStandardItem *item1 = new QStandardItem();
QStandardItem *item2 = new QStandardItem(); QStandardItem *item2 = new QStandardItem();
@ -654,6 +653,13 @@ void MessagesDialog::insertMessages()
QStandardItem *item4 = new QStandardItem(); QStandardItem *item4 = new QStandardItem();
QStandardItem *item5 = new QStandardItem(); QStandardItem *item5 = new QStandardItem();
//set this false if you want to expand on double click
item0->setEditable(false);
item1->setEditable(false);
item2->setEditable(false);
item3->setEditable(false);
item4->setEditable(false);
/* So Text should be: /* So Text should be:
* (1) Msg / Broadcast * (1) Msg / Broadcast
@ -672,19 +678,16 @@ void MessagesDialog::insertMessages()
qtime.setTime_t(it->ts); qtime.setTime_t(it->ts);
QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss"); QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss");
item3 -> setText(timestamp); item3 -> setText(timestamp);
//index = MessagesModel->index(c, 3);
//MessagesModel->setData(index, timestamp);
} }
// From .... // From ....
{ {
item2 -> setText(QString::fromStdString(rsPeers->getPeerName(it->srcId))); item2 -> setText(QString::fromStdString(rsPeers->getPeerName(it->srcId)));
//index = MessagesModel->index(c, 2);
//MessagesModel->setData(index, QString::fromStdString(rsPeers->getPeerName(it->srcId)));
} }
// Subject // Subject
item1 -> setText(QString::fromStdWString(it->title)); item1 -> setText(QString::fromStdWString(it->title));
if ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW) if ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW)
{ {
QFont qf = item1->font(); QFont qf = item1->font();
@ -692,8 +695,6 @@ void MessagesDialog::insertMessages()
item1->setFont(qf); item1->setFont(qf);
} }
//index = MessagesModel->index(c, 1);
//MessagesModel->setData(index, QString::fromStdWString(it->title));
// Change Message icon when Subject is Re: or Fwd: // Change Message icon when Subject is Re: or Fwd:
QString text = QString::fromStdWString(it->title); QString text = QString::fromStdWString(it->title);

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>675</width> <width>675</width>
<height>553</height> <height>462</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -505,8 +505,8 @@
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum> <enum>Qt::DefaultContextMenu</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_3">
<property name="verticalSpacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
@ -876,7 +876,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QSplitter" name="splitter_2"> <widget class="QSplitter" name="splitter_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -963,410 +963,413 @@ p, li { white-space: pre-wrap; }
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="QWidget" name="layoutWidget"> <widget class="QSplitter" name="msgSplitter_2">
<layout class="QVBoxLayout"> <property name="orientation">
<item> <enum>Qt::Vertical</enum>
<widget class="QTreeView" name="messagestreeView"> </property>
<property name="font"> <widget class="QTreeView" name="messagestreeView">
<font> <property name="font">
<pointsize>9</pointsize> <font>
</font> <pointsize>9</pointsize>
</property> </font>
<property name="contextMenuPolicy"> </property>
<enum>Qt::CustomContextMenu</enum> <property name="contextMenuPolicy">
</property> <enum>Qt::CustomContextMenu</enum>
<property name="selectionMode"> </property>
<enum>QAbstractItemView::ExtendedSelection</enum> <property name="selectionMode">
</property> <enum>QAbstractItemView::ExtendedSelection</enum>
<property name="sortingEnabled"> </property>
<bool>true</bool> <property name="sortingEnabled">
</property> <bool>true</bool>
</widget> </property>
</item> </widget>
<item> <widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="gridLayout_2">
<property name="spacing"> <item row="0" column="0">
<number>6</number> <layout class="QHBoxLayout">
</property> <property name="spacing">
<property name="leftMargin"> <number>6</number>
<number>0</number> </property>
</property> <property name="leftMargin">
<property name="topMargin"> <number>0</number>
<number>0</number> </property>
</property> <property name="topMargin">
<property name="bottomMargin"> <number>0</number>
<number>0</number> </property>
</property> <property name="bottomMargin">
<item> <number>0</number>
<layout class="QVBoxLayout"> </property>
<item> <item>
<spacer> <layout class="QVBoxLayout">
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <spacer>
</property> <property name="orientation">
<property name="sizeType"> <enum>Qt::Vertical</enum>
<enum>QSizePolicy::Preferred</enum> </property>
</property> <property name="sizeType">
<property name="sizeHint" stdset="0"> <enum>QSizePolicy::Preferred</enum>
<size> </property>
<width>20</width> <property name="sizeHint" stdset="0">
<height>40</height> <size>
</size> <width>20</width>
</property> <height>40</height>
</spacer> </size>
</item> </property>
</layout> </spacer>
</item> </item>
<item> </layout>
<layout class="QGridLayout"> </item>
<property name="horizontalSpacing"> <item>
<number>0</number> <layout class="QGridLayout">
</property> <property name="horizontalSpacing">
<property name="verticalSpacing"> <number>0</number>
<number>3</number> </property>
</property> <property name="verticalSpacing">
<item row="0" column="0"> <number>3</number>
<widget class="QLabel" name="subjectlabel"> </property>
<property name="sizePolicy"> <item row="0" column="0">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <widget class="QLabel" name="subjectlabel">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>60</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>60</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>10</height> <size>
</size> <width>16777215</width>
</property> <height>10</height>
<property name="font"> </size>
<font> </property>
<pointsize>10</pointsize> <property name="font">
<weight>75</weight> <font>
<bold>true</bold> <pointsize>10</pointsize>
</font> <weight>75</weight>
</property> <bold>true</bold>
<property name="text"> </font>
<string>Subject:</string> </property>
</property> <property name="text">
</widget> <string>Subject:</string>
</item> </property>
<item row="0" column="2"> </widget>
<widget class="QLabel" name="subjectText"> </item>
<property name="sizePolicy"> <item row="0" column="2">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <widget class="QLabel" name="subjectText">
<horstretch>2</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</sizepolicy> <horstretch>2</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>0</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>0</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>12</height> <size>
</size> <width>16777215</width>
</property> <height>12</height>
<property name="font"> </size>
<font> </property>
<pointsize>9</pointsize> <property name="font">
</font> <font>
</property> <pointsize>9</pointsize>
<property name="text"> </font>
<string/> </property>
</property> <property name="text">
</widget> <string/>
</item> </property>
<item row="1" column="0"> </widget>
<widget class="QLabel" name="fromlabel"> </item>
<property name="sizePolicy"> <item row="1" column="0">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <widget class="QLabel" name="fromlabel">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>60</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>60</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>10</height> <size>
</size> <width>16777215</width>
</property> <height>10</height>
<property name="font"> </size>
<font> </property>
<pointsize>10</pointsize> <property name="font">
<weight>75</weight> <font>
<bold>true</bold> <pointsize>10</pointsize>
</font> <weight>75</weight>
</property> <bold>true</bold>
<property name="text"> </font>
<string>From:</string> </property>
</property> <property name="text">
</widget> <string>From:</string>
</item> </property>
<item row="1" column="2"> </widget>
<widget class="QLabel" name="fromText"> </item>
<property name="sizePolicy"> <item row="1" column="2">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <widget class="QLabel" name="fromText">
<horstretch>2</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</sizepolicy> <horstretch>2</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>0</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>0</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>12</height> <size>
</size> <width>16777215</width>
</property> <height>12</height>
<property name="font"> </size>
<font> </property>
<pointsize>9</pointsize> <property name="font">
</font> <font>
</property> <pointsize>9</pointsize>
<property name="text"> </font>
<string/> </property>
</property> <property name="text">
<property name="scaledContents"> <string/>
<bool>true</bool> </property>
</property> <property name="scaledContents">
</widget> <bool>true</bool>
</item> </property>
<item row="2" column="0"> </widget>
<widget class="QLabel" name="datelabel"> </item>
<property name="sizePolicy"> <item row="2" column="0">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <widget class="QLabel" name="datelabel">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>60</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>60</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>10</height> <size>
</size> <width>16777215</width>
</property> <height>10</height>
<property name="font"> </size>
<font> </property>
<pointsize>10</pointsize> <property name="font">
<weight>75</weight> <font>
<bold>true</bold> <pointsize>10</pointsize>
</font> <weight>75</weight>
</property> <bold>true</bold>
<property name="text"> </font>
<string>Date:</string> </property>
</property> <property name="text">
</widget> <string>Date:</string>
</item> </property>
<item row="2" column="2"> </widget>
<widget class="QLabel" name="dateText"> </item>
<property name="sizePolicy"> <item row="2" column="2">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <widget class="QLabel" name="dateText">
<horstretch>2</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</sizepolicy> <horstretch>2</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>0</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>0</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>12</height> <size>
</size> <width>16777215</width>
</property> <height>12</height>
<property name="font"> </size>
<font> </property>
<pointsize>9</pointsize> <property name="font">
</font> <font>
</property> <pointsize>9</pointsize>
<property name="text"> </font>
<string/> </property>
</property> <property name="text">
</widget> <string/>
</item> </property>
<item row="3" column="0"> </widget>
<widget class="QLabel" name="tolabel"> </item>
<property name="sizePolicy"> <item row="3" column="0">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <widget class="QLabel" name="tolabel">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>0</verstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="minimumSize"> </sizepolicy>
<size> </property>
<width>60</width> <property name="minimumSize">
<height>12</height> <size>
</size> <width>60</width>
</property> <height>12</height>
<property name="maximumSize"> </size>
<size> </property>
<width>16777215</width> <property name="maximumSize">
<height>10</height> <size>
</size> <width>16777215</width>
</property> <height>10</height>
<property name="font"> </size>
<font> </property>
<pointsize>10</pointsize> <property name="font">
<weight>75</weight> <font>
<bold>true</bold> <pointsize>10</pointsize>
</font> <weight>75</weight>
</property> <bold>true</bold>
<property name="text"> </font>
<string>To:</string> </property>
</property> <property name="text">
</widget> <string>To:</string>
</item> </property>
<item row="3" column="2"> </widget>
<widget class="QTextBrowser" name="toText"> </item>
<property name="maximumSize"> <item row="3" column="2">
<size> <widget class="QTextBrowser" name="toText">
<width>16777215</width> <property name="maximumSize">
<height>22</height> <size>
</size> <width>16777215</width>
</property> <height>22</height>
<property name="font"> </size>
<font> </property>
<pointsize>9</pointsize> <property name="font">
</font> <font>
</property> <pointsize>9</pointsize>
</widget> </font>
</item> </property>
</layout> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> </layout>
<widget class="QTextBrowser" name="msgText"> </item>
<property name="sizePolicy"> <item row="1" column="0">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <widget class="QTextBrowser" name="msgText">
<horstretch>0</horstretch> <property name="sizePolicy">
<verstretch>10</verstretch> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</sizepolicy> <horstretch>0</horstretch>
</property> <verstretch>10</verstretch>
<property name="openExternalLinks"> </sizepolicy>
<bool>true</bool> </property>
</property> <property name="openExternalLinks">
</widget> <bool>true</bool>
</item> </property>
<item> </widget>
<layout class="QHBoxLayout"> </item>
<item> <item row="2" column="0">
<layout class="QGridLayout"> <layout class="QHBoxLayout">
<property name="margin"> <item>
<number>0</number> <layout class="QGridLayout">
</property> <property name="margin">
<property name="spacing"> <number>0</number>
<number>6</number> </property>
</property> <property name="spacing">
<item row="0" column="1"> <number>6</number>
<widget class="QLabel" name="label_6"> </property>
<property name="text"> <item row="0" column="1">
<string/> <widget class="QLabel" name="label_6">
</property> <property name="text">
<property name="pixmap"> <string/>
<pixmap resource="images.qrc">:/images/attachment.png</pixmap> </property>
</property> <property name="pixmap">
</widget> <pixmap resource="images.qrc">:/images/attachment.png</pixmap>
</item> </property>
<item row="0" column="2"> </widget>
<widget class="QLabel" name="label_2"> </item>
<property name="text"> <item row="0" column="2">
<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; <widget class="QLabel" name="label_2">
<property name="text">
<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;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&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; &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;
&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;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;Recommended Files&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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;&lt;span style=&quot; font-size:10pt; font-weight:600;&quot;&gt;Recommended Files&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QLabel" name="filesText"> <widget class="QLabel" name="filesText">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>
<italic>true</italic> <italic>true</italic>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QPushButton" name="expandFilesButton"> <widget class="QPushButton" name="expandFilesButton">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset> <normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>351</width> <width>351</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="downloadButton"> <widget class="QPushButton" name="downloadButton">
<property name="toolTip"> <property name="toolTip">
<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; <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;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&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;Download all Recommended Files&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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;Download all Recommended Files&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/down.png</normaloff>:/images/down.png</iconset> <normaloff>:/images/down.png</normaloff>:/images/down.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget>
</widget> </widget>
<widget class="QTreeWidget" name="msgList"> <widget class="QTreeWidget" name="msgList">
<property name="font"> <property name="font">