mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 20:34:25 -04:00
Merge pull request #1639 from csoler/v0.6-ImprovedGUI
V0.6 improved gui
This commit is contained in:
commit
8be49b2d65
5 changed files with 31 additions and 8 deletions
|
@ -116,15 +116,15 @@ RsAccounts* rsAccounts = nullptr;
|
||||||
|
|
||||||
RsConfigOptions::RsConfigOptions()
|
RsConfigOptions::RsConfigOptions()
|
||||||
:
|
:
|
||||||
#ifdef RS_JSONAPI
|
|
||||||
jsonApiPort(JsonApiServer::DEFAULT_PORT),
|
|
||||||
jsonApiBindAddress("127.0.0.1"),
|
|
||||||
#endif
|
|
||||||
autoLogin(false),
|
autoLogin(false),
|
||||||
forcedPort(0),
|
|
||||||
udpListenerOnly(false),
|
udpListenerOnly(false),
|
||||||
|
forcedPort(0),
|
||||||
outStderr(false),
|
outStderr(false),
|
||||||
debugLevel(5)
|
debugLevel(5)
|
||||||
|
#ifdef RS_JSONAPI
|
||||||
|
,jsonApiPort(0) // JSonAPI server is enabled in each main()
|
||||||
|
,jsonApiBindAddress("127.0.0.1")
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,10 +128,25 @@ public:
|
||||||
|
|
||||||
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override
|
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override
|
||||||
{
|
{
|
||||||
if(!m_showOfflineNodes && !sourceModel()->index(source_row,0,source_parent).data(RsFriendListModel::OnlineRole).toBool())
|
// do not show empty groups
|
||||||
|
|
||||||
|
QModelIndex index = sourceModel()->index(source_row,0,source_parent);
|
||||||
|
|
||||||
|
if(index.data(RsFriendListModel::TypeRole) == RsFriendListModel::ENTRY_TYPE_GROUP)
|
||||||
|
{
|
||||||
|
RsGroupInfo group_info ;
|
||||||
|
static_cast<RsFriendListModel*>(sourceModel())->getGroupData(index,group_info);
|
||||||
|
|
||||||
|
if(group_info.peerIds.empty())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter offline friends
|
||||||
|
|
||||||
|
if(!m_showOfflineNodes && !index.data(RsFriendListModel::OnlineRole).toBool())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return sourceModel()->index(source_row,0,source_parent).data(RsFriendListModel::FilterRole).toString() == RsFriendListModel::FilterString ;
|
return index.data(RsFriendListModel::FilterRole).toString() == RsFriendListModel::FilterString ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ) override
|
void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ) override
|
||||||
|
@ -683,7 +698,7 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu()
|
||||||
contextMenu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate()));
|
contextMenu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate()));
|
||||||
|
|
||||||
//this is a SSL key
|
//this is a SSL key
|
||||||
contextMenu.addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removefriend()));
|
contextMenu.addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removeNode()));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,8 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
||||||
// fill quick view
|
// fill quick view
|
||||||
fillQuickView();
|
fillQuickView();
|
||||||
|
|
||||||
|
sortColumn(RsMessageModel::COLUMN_THREAD_DATE,Qt::DescendingOrder);
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
|
|
|
@ -233,6 +233,8 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
||||||
|
|
||||||
RsConfigOptions conf;
|
RsConfigOptions conf;
|
||||||
|
|
||||||
|
conf.jsonApiPort = 0 ; // disable JSon API at start. The JSonAPI preference UI will enable it according to saved parameters.
|
||||||
|
|
||||||
argstream as(argc,argv);
|
argstream as(argc,argv);
|
||||||
as >> option('s',"stderr" ,conf.outStderr ,"output to stderr instead of log file." )
|
as >> option('s',"stderr" ,conf.outStderr ,"output to stderr instead of log file." )
|
||||||
>> option('u',"udp" ,conf.udpListenerOnly,"Only listen to UDP." )
|
>> option('u',"udp" ,conf.udpListenerOnly,"Only listen to UDP." )
|
||||||
|
|
|
@ -120,6 +120,10 @@ int main(int argc, char* argv[])
|
||||||
std::string prefUserString;
|
std::string prefUserString;
|
||||||
RsConfigOptions conf;
|
RsConfigOptions conf;
|
||||||
|
|
||||||
|
#ifdef RS_JSONAPI
|
||||||
|
conf.jsonApiPort = JsonApiServer::DEFAULT_PORT; // enable JSonAPI by default
|
||||||
|
#endif
|
||||||
|
|
||||||
argstream as(argc,argv);
|
argstream as(argc,argv);
|
||||||
as >> option( 's', "stderr", conf.outStderr,
|
as >> option( 's', "stderr", conf.outStderr,
|
||||||
"output to stderr instead of log file." )
|
"output to stderr instead of log file." )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue