split transfers into uploads and downloads.

corrected serverdialog layout.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@346 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-02-11 16:32:02 +00:00
parent 98a14ba715
commit a56f9266f8
3 changed files with 296 additions and 369 deletions

View File

@ -5,8 +5,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>416</width> <width>459</width>
<height>345</height> <height>409</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -498,27 +498,178 @@
<property name="contextMenuPolicy" > <property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<widget class="QGroupBox" name="groupBox_3" > <layout class="QVBoxLayout" >
<property name="geometry" > <item>
<rect> <widget class="QGroupBox" name="groupBox_2" >
<x>0</x> <property name="title" >
<y>270</y> <string>Network Address Configuration (takes effect after restart)</string>
<width>411</width>
<height>71</height>
</rect>
</property> </property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QComboBox" name="netModeComboBox" >
<item>
<property name="text" >
<string>Automatic (Firewalled)</string>
</property>
</item>
<item>
<property name="text" >
<string>Firewalled + No UPnP</string>
</property>
</item>
<item>
<property name="text" >
<string>External (Forwarded) Port</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4" >
<property name="title" >
<string>External Visibility / Discovery Configuration</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QComboBox" name="dhtComboBox" >
<item>
<property name="text" >
<string>DHT Enabled</string>
</property>
</item>
<item>
<property name="text" >
<string>DHT Disabled</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="discComboBox" >
<item>
<property name="text" >
<string>Discovery Enabled</string>
</property>
</item>
<item>
<property name="text" >
<string>Discovery Disabled</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Server Status And Network Settings</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>Network Status</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="netStatusBox" />
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Local Address</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>External Address</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLineEdit" name="localAddress" />
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QSpinBox" name="localPort" >
<property name="minimum" >
<number>0</number>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>7812</number>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLineEdit" name="extAddress" />
</item>
<item row="1" column="1" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QSpinBox" name="extPort" >
<property name="minimum" >
<number>0</number>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>7812</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3" >
<property name="title" > <property name="title" >
<string>Transfer Rates</string> <string>Transfer Rates</string>
</property> </property>
<widget class="QWidget" name="layoutWidget" > <layout class="QGridLayout" >
<property name="geometry" > <item row="0" column="0" >
<rect>
<x>10</x>
<y>20</y>
<width>170</width>
<height>23</height>
</rect>
</property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
@ -556,16 +707,8 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </item>
<widget class="QWidget" name="layoutWidget" > <item row="0" column="1" >
<property name="geometry" >
<rect>
<x>200</x>
<y>20</y>
<width>170</width>
<height>23</height>
</rect>
</property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
@ -603,271 +746,11 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_4" >
<property name="geometry" >
<rect>
<x>0</x>
<y>40</y>
<width>411</width>
<height>41</height>
</rect>
</property>
<property name="title" >
<string>External Visibility / Discovery Configuration</string>
</property>
<widget class="QComboBox" name="dhtComboBox" >
<property name="geometry" >
<rect>
<x>30</x>
<y>10</y>
<width>161</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text" >
<string>DHT Enabled</string>
</property>
</item>
<item>
<property name="text" >
<string>DHT Disabled</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="discComboBox" >
<property name="geometry" >
<rect>
<x>220</x>
<y>10</y>
<width>161</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text" >
<string>Discovery Enabled</string>
</property>
</item>
<item>
<property name="text" >
<string>Discovery Disabled</string>
</property>
</item>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
<height>41</height>
</rect>
</property>
<property name="title" >
<string>Network Address Configuration (takes effect after restart)</string>
</property>
<widget class="QComboBox" name="netModeComboBox" >
<property name="geometry" >
<rect>
<x>30</x>
<y>10</y>
<width>351</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text" >
<string>Automatic (Firewalled)</string>
</property>
</item>
<item>
<property name="text" >
<string>Firewalled + No UPnP</string>
</property>
</item>
<item>
<property name="text" >
<string>External (Forwarded) Port</string>
</property>
</item>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox" >
<property name="geometry" >
<rect>
<x>0</x>
<y>80</y>
<width>411</width>
<height>191</height>
</rect>
</property>
<property name="title" >
<string>Server Status And Network Settings</string>
</property>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>93</x>
<y>20</y>
<width>291</width>
<height>152</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QTextEdit" name="netStatusBox" />
</item>
<item>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLineEdit" name="localAddress" />
</item>
<item row="0" column="2" >
<widget class="QSpinBox" name="localPort" >
<property name="minimum" >
<number>0</number>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>7812</number>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Port:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLineEdit" name="extAddress" />
</item>
<item row="0" column="2" >
<widget class="QSpinBox" name="extPort" >
<property name="minimum" >
<number>0</number>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>7812</number>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Port:</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QLabel" name="label_2" > </item>
<property name="geometry" > </layout>
<rect>
<x>10</x>
<y>150</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="text" >
<string>External Address</string>
</property>
</widget>
<widget class="QLabel" name="label_6" >
<property name="geometry" >
<rect>
<x>10</x>
<y>30</y>
<width>80</width>
<height>21</height>
</rect>
</property>
<property name="text" >
<string>Network Status</string>
</property>
</widget>
<widget class="QLabel" name="label" >
<property name="geometry" >
<rect>
<x>10</x>
<y>130</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="text" >
<string>Local Address</string>
</property>
</widget>
</widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>localAddress</tabstop> <tabstop>localAddress</tabstop>

View File

@ -203,11 +203,37 @@ int TransfersDialog::addItem(QString symbol, QString name, QString coreID, qlong
return row; return row;
} }
int TransfersDialog::addUploadItem(QString symbol, QString name, QString coreID, qlonglong fileSize, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining)
{
int row;
QString sl;
//QIcon icon(symbol);
name.insert(0, " ");
row = ULListModel->rowCount();
ULListModel->insertRow(row);
ULListModel->setData(ULListModel->index(row, UNAME), QVariant((QString)name), Qt::DisplayRole);
ULListModel->setData(ULListModel->index(row, USIZE), QVariant((qlonglong)fileSize));
ULListModel->setData(ULListModel->index(row, USERNAME), QVariant((QString)sources));
ULListModel->setData(ULListModel->index(row, UPROGRESS), QVariant((double)progress));
ULListModel->setData(ULListModel->index(row, ULSPEED), QVariant((double)dlspeed));
ULListModel->setData(ULListModel->index(row, USTATUS), QVariant((QString)status));
ULListModel->setData(ULListModel->index(row, UTRANSFERRED), QVariant((qlonglong)remaining));
return row;
}
void TransfersDialog::delItem(int row) void TransfersDialog::delItem(int row)
{ {
DLListModel->removeRow(row, QModelIndex()); DLListModel->removeRow(row, QModelIndex());
} }
void TransfersDialog::delUploadItem(int row)
{
ULListModel->removeRow(row, QModelIndex());
}
void TransfersDialog::editItem(int row, int column, QVariant data) void TransfersDialog::editItem(int row, int column, QVariant data)
{ {
//QIcon *icon; //QIcon *icon;
@ -260,6 +286,11 @@ void TransfersDialog::insertTransfers()
delItem(i); delItem(i);
} }
for(int i = ULListModel->rowCount(); i >= 0; i--)
{
delUploadItem(i);
}
//nun aktuelle DownloadListe hinzufügen //nun aktuelle DownloadListe hinzufügen
rsiface->lockData(); /* Lock Interface */ rsiface->lockData(); /* Lock Interface */
@ -310,7 +341,16 @@ void TransfersDialog::insertTransfers()
progress = it->transfered * 100.0 / it->size; progress = it->transfered * 100.0 / it->size;
remaining = (it->size - it->transfered) / (it->tfRate * 1024.0); remaining = (it->size - it->transfered) / (it->tfRate * 1024.0);
addItem(symbol, name, coreId, fileSize, progress, dlspeed, sources, status, completed, remaining); if (it->download)
{
addItem(symbol, name, coreId, fileSize, progress,
dlspeed, sources, status, completed, remaining);
}
else
{
addUploadItem(symbol, name, coreId, fileSize, progress,
dlspeed, sources, status, completed, remaining);
}
} }
rsiface->unlockData(); /* UnLock Interface */ rsiface->unlockData(); /* UnLock Interface */

View File

@ -97,6 +97,10 @@ private:
public slots: public slots:
int addItem(QString symbol, QString name, QString coreID, qlonglong size, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining); int addItem(QString symbol, QString name, QString coreID, qlonglong size, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining);
void delItem(int row); void delItem(int row);
int addUploadItem(QString symbol, QString name, QString coreID, qlonglong size, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining);
void delUploadItem(int row);
void editItem(int row, int column, QVariant data); void editItem(int row, int column, QVariant data);
void updateProgress(int value); void updateProgress(int value);