mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-20 05:14:25 -05:00
Enabled save() function in SubFileItems.
Improved Channel Menu Item: added Icon and popularity. Reduced most of the margins in Channel Feed. updated libretroshare interface files. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@845 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f5fa2f9a68
commit
99c038a4db
@ -53,6 +53,9 @@ ChannelFeed::ChannelFeed(QWidget *parent)
|
|||||||
/*************** Setup Left Hand Side (List of Channels) ****************/
|
/*************** Setup Left Hand Side (List of Channels) ****************/
|
||||||
|
|
||||||
mGroupLayout = new QVBoxLayout;
|
mGroupLayout = new QVBoxLayout;
|
||||||
|
mGroupLayout->setSpacing(0);
|
||||||
|
mGroupLayout->setMargin(0);
|
||||||
|
mGroupLayout->setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
mGroupOwn = new ChanGroupItem("Own Channels");
|
mGroupOwn = new ChanGroupItem("Own Channels");
|
||||||
mGroupSub = new ChanGroupItem("Subscribed Channels");
|
mGroupSub = new ChanGroupItem("Subscribed Channels");
|
||||||
@ -80,12 +83,17 @@ ChannelFeed::ChannelFeed(QWidget *parent)
|
|||||||
layout2->addWidget(scrollArea);
|
layout2->addWidget(scrollArea);
|
||||||
layout2->setSpacing(0);
|
layout2->setSpacing(0);
|
||||||
layout2->setMargin(0);
|
layout2->setMargin(0);
|
||||||
|
layout2->setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
|
|
||||||
chanFrame->setLayout(layout2);
|
chanFrame->setLayout(layout2);
|
||||||
|
|
||||||
/*************** Setup Left Hand Side (List of Channels) ****************/
|
/*************** Setup Left Hand Side (List of Channels) ****************/
|
||||||
|
|
||||||
mMsgLayout = new QVBoxLayout;
|
mMsgLayout = new QVBoxLayout;
|
||||||
|
mMsgLayout->setSpacing(0);
|
||||||
|
mMsgLayout->setMargin(0);
|
||||||
|
mMsgLayout->setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
QWidget *middleWidget2 = new QWidget();
|
QWidget *middleWidget2 = new QWidget();
|
||||||
middleWidget2->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
middleWidget2->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
|
||||||
@ -101,6 +109,8 @@ ChannelFeed::ChannelFeed(QWidget *parent)
|
|||||||
layout3->addWidget(scrollArea2);
|
layout3->addWidget(scrollArea2);
|
||||||
layout3->setSpacing(0);
|
layout3->setSpacing(0);
|
||||||
layout3->setMargin(0);
|
layout3->setMargin(0);
|
||||||
|
layout3->setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
|
|
||||||
msgFrame->setLayout(layout3);
|
msgFrame->setLayout(layout3);
|
||||||
|
|
||||||
|
@ -98,11 +98,17 @@ LibraryDialog::LibraryDialog(QWidget *parent)
|
|||||||
void LibraryDialog::PopulateList()
|
void LibraryDialog::PopulateList()
|
||||||
{
|
{
|
||||||
QDir DwnlFolder,ShrFolder,retroshareLib,treePath;
|
QDir DwnlFolder,ShrFolder,retroshareLib,treePath;
|
||||||
|
|
||||||
|
#if 0
|
||||||
retroshareLib.mkdir("RetroShare Library");
|
retroshareLib.mkdir("RetroShare Library");
|
||||||
DwnlFolder.mkdir("RetroShare Library/Download");
|
DwnlFolder.mkdir("RetroShare Library/Download");
|
||||||
ShrFolder.mkdir("RetroShare Library/SharedFolder");
|
ShrFolder.mkdir("RetroShare Library/SharedFolder");
|
||||||
LibShared=treePath.currentPath();
|
LibShared=treePath.currentPath();
|
||||||
LibShared.append("/RetroShare Library");
|
LibShared.append("/RetroShare Library");
|
||||||
|
#else
|
||||||
|
LibShared=treePath.currentPath();
|
||||||
|
#endif
|
||||||
|
|
||||||
QDirModel * dmodel=new QDirModel;
|
QDirModel * dmodel=new QDirModel;
|
||||||
ui.organizertreeView->setModel(dmodel);
|
ui.organizertreeView->setModel(dmodel);
|
||||||
ui.organizertreeView->setRootIndex(dmodel->index(LibShared));
|
ui.organizertreeView->setRootIndex(dmodel->index(LibShared));
|
||||||
|
@ -61,6 +61,10 @@ void ChanMenuItem::updateItemStatic()
|
|||||||
{
|
{
|
||||||
titleLabel->setText(QString::fromStdWString(ci.channelName));
|
titleLabel->setText(QString::fromStdWString(ci.channelName));
|
||||||
descLabel->setText(QString::fromStdWString(ci.channelDesc));
|
descLabel->setText(QString::fromStdWString(ci.channelDesc));
|
||||||
|
pop_lcd->display((int) ci.pop);
|
||||||
|
/* TODO */
|
||||||
|
fetches_lcd->display(9999);
|
||||||
|
avail_lcd->display(9999);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -77,6 +81,7 @@ void ChanMenuItem::updateItem()
|
|||||||
std::cerr << "ChanMenuItem::updateItem()";
|
std::cerr << "ChanMenuItem::updateItem()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>290</width>
|
<width>216</width>
|
||||||
<height>226</height>
|
<height>367</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
@ -39,7 +39,10 @@
|
|||||||
<property name="frameShadow" >
|
<property name="frameShadow" >
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<property name="leftMargin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -52,130 +55,242 @@
|
|||||||
<property name="bottomMargin" >
|
<property name="bottomMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalSpacing" >
|
<item>
|
||||||
<number>0</number>
|
<layout class="QVBoxLayout" >
|
||||||
</property>
|
<property name="spacing" >
|
||||||
<property name="verticalSpacing" >
|
<number>0</number>
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" colspan="3" >
|
|
||||||
<widget class="QPushButton" name="expandButton" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize" >
|
<item>
|
||||||
<size>
|
<widget class="QPushButton" name="expandButton" >
|
||||||
<width>16777215</width>
|
<property name="sizePolicy" >
|
||||||
<height>14</height>
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
</size>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
<property name="toolTip" >
|
</sizepolicy>
|
||||||
<string>Expand</string>
|
</property>
|
||||||
</property>
|
<property name="maximumSize" >
|
||||||
<property name="text" >
|
<size>
|
||||||
<string/>
|
<width>16777215</width>
|
||||||
</property>
|
<height>14</height>
|
||||||
<property name="icon" >
|
</size>
|
||||||
<iconset/>
|
</property>
|
||||||
</property>
|
<property name="toolTip" >
|
||||||
</widget>
|
<string>Expand</string>
|
||||||
</item>
|
</property>
|
||||||
<item row="1" column="0" >
|
<property name="text" >
|
||||||
<spacer>
|
<string/>
|
||||||
<property name="orientation" >
|
</property>
|
||||||
<enum>Qt::Horizontal</enum>
|
<property name="icon" >
|
||||||
</property>
|
<iconset/>
|
||||||
<property name="sizeType" >
|
</property>
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
<property name="sizeHint" >
|
<item>
|
||||||
<size>
|
<layout class="QHBoxLayout" >
|
||||||
<width>21</width>
|
<property name="spacing" >
|
||||||
<height>28</height>
|
<number>0</number>
|
||||||
</size>
|
</property>
|
||||||
</property>
|
<item>
|
||||||
</spacer>
|
<spacer>
|
||||||
</item>
|
<property name="orientation" >
|
||||||
<item row="1" column="1" >
|
<enum>Qt::Horizontal</enum>
|
||||||
<widget class="QLabel" name="titleLabel" >
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizeType" >
|
||||||
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
<horstretch>0</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
<property name="sizeHint" >
|
||||||
</sizepolicy>
|
<size>
|
||||||
</property>
|
<width>21</width>
|
||||||
<property name="maximumSize" >
|
<height>28</height>
|
||||||
<size>
|
</size>
|
||||||
<width>200</width>
|
</property>
|
||||||
<height>16777215</height>
|
</spacer>
|
||||||
</size>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
<property name="font" >
|
<widget class="QLabel" name="titleLabel" >
|
||||||
<font>
|
<property name="sizePolicy" >
|
||||||
<weight>75</weight>
|
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
||||||
<italic>true</italic>
|
<horstretch>0</horstretch>
|
||||||
<bold>true</bold>
|
<verstretch>0</verstretch>
|
||||||
</font>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="maximumSize" >
|
||||||
<string>Connected</string>
|
<size>
|
||||||
</property>
|
<width>200</width>
|
||||||
</widget>
|
<height>16777215</height>
|
||||||
</item>
|
</size>
|
||||||
<item row="1" column="2" >
|
</property>
|
||||||
<spacer>
|
<property name="font" >
|
||||||
<property name="orientation" >
|
<font>
|
||||||
<enum>Qt::Horizontal</enum>
|
<weight>75</weight>
|
||||||
</property>
|
<italic>true</italic>
|
||||||
<property name="sizeType" >
|
<bold>true</bold>
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="text" >
|
||||||
<size>
|
<string>Connected</string>
|
||||||
<width>341</width>
|
</property>
|
||||||
<height>28</height>
|
</widget>
|
||||||
</size>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
</spacer>
|
<spacer>
|
||||||
</item>
|
<property name="orientation" >
|
||||||
<item row="2" column="0" colspan="3" >
|
<enum>Qt::Horizontal</enum>
|
||||||
<widget class="QFrame" name="expandFrame" >
|
</property>
|
||||||
<property name="frameShape" >
|
<property name="sizeType" >
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow" >
|
<property name="sizeHint" >
|
||||||
<enum>QFrame::Raised</enum>
|
<size>
|
||||||
</property>
|
<width>341</width>
|
||||||
<layout class="QVBoxLayout" >
|
<height>28</height>
|
||||||
<property name="spacing" >
|
</size>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
</spacer>
|
||||||
<property name="leftMargin" >
|
</item>
|
||||||
<number>0</number>
|
</layout>
|
||||||
</property>
|
</item>
|
||||||
<property name="topMargin" >
|
<item>
|
||||||
<number>0</number>
|
<widget class="QFrame" name="expandFrame" >
|
||||||
</property>
|
<property name="frameShape" >
|
||||||
<property name="rightMargin" >
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
<property name="frameShadow" >
|
||||||
<property name="bottomMargin" >
|
<enum>QFrame::Raised</enum>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
<layout class="QVBoxLayout" >
|
||||||
<item>
|
<property name="spacing" >
|
||||||
<layout class="QHBoxLayout" >
|
<number>0</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>
|
<item>
|
||||||
<widget class="QLabel" name="iconLabel" >
|
<layout class="QGridLayout" >
|
||||||
<property name="text" >
|
<property name="horizontalSpacing" >
|
||||||
<string/>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap" >
|
<property name="verticalSpacing" >
|
||||||
<pixmap/>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<item row="0" column="0" colspan="2" >
|
||||||
|
<widget class="QLabel" name="label" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Popularity:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" >
|
||||||
|
<widget class="QLCDNumber" name="pop_lcd" />
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2" >
|
||||||
|
<widget class="QLabel" name="label_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Fetches:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" >
|
||||||
|
<widget class="QLCDNumber" name="fetches_lcd" />
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2" >
|
||||||
|
<widget class="QLabel" name="label_4" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Available:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2" >
|
||||||
|
<widget class="QLCDNumber" name="avail_lcd" />
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3" >
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="chanIcon" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap" >
|
||||||
|
<pixmap resource="../images.qrc" >:/images/friendsfolder24.png</pixmap>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="descLabel" >
|
<widget class="QLabel" name="descLabel" >
|
||||||
@ -201,9 +316,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
</item>
|
||||||
</widget>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -558,6 +558,28 @@ void SubFileItem::save()
|
|||||||
std::cerr << "SubFileItem::save()";
|
std::cerr << "SubFileItem::save()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (mType == SFI_TYPE_CHANNEL)
|
||||||
|
{
|
||||||
|
/* only enable these function for Channels. */
|
||||||
|
|
||||||
|
/* find out where they want to save it */
|
||||||
|
QString startpath = "";
|
||||||
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Save Channel File"),
|
||||||
|
startpath,
|
||||||
|
QFileDialog::ShowDirsOnly
|
||||||
|
| QFileDialog::DontResolveSymlinks);
|
||||||
|
|
||||||
|
std::string destpath = dir.toStdString();
|
||||||
|
|
||||||
|
if (destpath != "")
|
||||||
|
{
|
||||||
|
rsFiles->ExtraFileMove(mFileName, mFileHash, mFileSize, destpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,6 +119,9 @@ virtual bool ExtraFileRemove(std::string hash, uint32_t flags) = 0;
|
|||||||
virtual bool ExtraFileHash(std::string localpath,
|
virtual bool ExtraFileHash(std::string localpath,
|
||||||
uint32_t period, uint32_t flags) = 0;
|
uint32_t period, uint32_t flags) = 0;
|
||||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
||||||
|
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||||
|
std::string destpath) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
Loading…
Reference in New Issue
Block a user