mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-25 02:03:30 -05:00
ported branch v0.5.0 commits 2623, 2624, 2626, 2633, 2634, 2643, 2644, 2646, 2651 and 2654 to trunk
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2660 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
12536efd16
commit
08065b4298
22 changed files with 264 additions and 299 deletions
|
|
@ -227,6 +227,8 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
|
|||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Transfered: ")) ; painter->drawText(tab_size,y,QString::number(nfo.transfered) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(nfo.transfered) + ")") ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Remaining: ")) ; painter->drawText(tab_size,y,QString::number(info.file_size - nfo.transfered) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(info.file_size - nfo.transfered) + ")") ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Number of sources: ")) ; painter->drawText(tab_size,y,QString::number(info.compressed_peer_availability_maps.size())) ;
|
||||
y += block_sep ;
|
||||
y += text_height ; painter->drawText(20,y,tr("Chunk strategy: ")) ; painter->drawText(tab_size,y,(info.strategy==FileChunksInfo::CHUNK_STRATEGY_RANDOM)?"Random":"Streaming") ;
|
||||
|
|
|
|||
|
|
@ -111,8 +111,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
/* Invoke the Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
updateToolBaricons();
|
||||
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
|
|
@ -183,7 +181,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||
|
||||
|
||||
ui.stackPages->add(messagesDialog = new MessagesDialog(ui.stackPages),
|
||||
createPageAction(QIcon(MessageIcon), tr("Messages"), grp));
|
||||
messageAction = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
|
||||
|
||||
#ifndef RS_RELEASE_VERSION
|
||||
ChannelFeed *channelFeed = NULL;
|
||||
|
|
@ -332,59 +330,59 @@ void MainWindow::displaySystrayMsg(const QString& title,const QString& msg)
|
|||
void MainWindow::updateStatus()
|
||||
{
|
||||
|
||||
if (ratesstatus)
|
||||
ratesstatus->getRatesStatus();
|
||||
if (ratesstatus)
|
||||
ratesstatus->getRatesStatus();
|
||||
|
||||
if (peerstatus)
|
||||
peerstatus->getPeerStatus();
|
||||
if (peerstatus)
|
||||
peerstatus->getPeerStatus();
|
||||
|
||||
if (natstatus)
|
||||
natstatus->getNATStatus();
|
||||
if (natstatus)
|
||||
natstatus->getNATStatus();
|
||||
|
||||
std::list<std::string> ids;
|
||||
rsPeers->getOnlineList(ids);
|
||||
int online = ids.size();
|
||||
|
||||
std::list<MsgInfoSummary> msgList;
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
std::list<std::string> ids;
|
||||
rsPeers->getOnlineList(ids);
|
||||
int online = ids.size();
|
||||
|
||||
rsMsgs -> getMessageSummaries(msgList);
|
||||
|
||||
for(it = msgList.begin(); it != msgList.end(); it++)
|
||||
{
|
||||
|
||||
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW))
|
||||
{
|
||||
trayIcon->setIcon(QIcon(":/images/newmsg.png"));
|
||||
trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You has a new message"));
|
||||
}
|
||||
else if (online == 0)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else if (online < 2)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_ONEONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else if (online < 3)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_TWOONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
std::list<MsgInfoSummary> msgList;
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
|
||||
rsMsgs -> getMessageSummaries(msgList);
|
||||
bool new_msg = false ;
|
||||
|
||||
for(it = msgList.begin(); it != msgList.end(); it++)
|
||||
if ((it -> msgflags & RS_MSG_BOXMASK) == RS_MSG_INBOX && ((it -> msgflags & RS_MSG_NEW) == RS_MSG_NEW))
|
||||
new_msg = true ;
|
||||
|
||||
if(new_msg)
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/messages_new.png"))) ;
|
||||
else
|
||||
messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ;
|
||||
|
||||
if(new_msg)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(":/images/newmsg.png"));
|
||||
trayIcon->setToolTip(tr("RetroShare") + "\n" + tr("You has a new message"));
|
||||
}
|
||||
else if (online == 0)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else if (online < 2)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_ONEONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else if (online < 3)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_TWOONLINE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateHashingInfo(const QString& s)
|
||||
|
|
@ -672,25 +670,4 @@ void MainWindow::setStyle()
|
|||
|
||||
}
|
||||
|
||||
void MainWindow::updateToolBaricons()
|
||||
{
|
||||
std::list<MsgInfoSummary> msgList;
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
|
||||
rsMsgs -> getMessageSummaries(msgList);
|
||||
|
||||
for(it = msgList.begin(); it != msgList.end(); it++)
|
||||
{
|
||||
|
||||
if (it -> msgflags & RS_MSG_NEW)
|
||||
{
|
||||
MessageIcon.addPixmap(QPixmap(":/images/messages_new.png"), QIcon::Normal, QIcon::On );
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageIcon.addPixmap(QPixmap(":/images/evolution.png"), QIcon::Normal, QIcon::On );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,6 @@ public slots:
|
|||
void updateHashingInfo(const QString&) ;
|
||||
void displayErrorMessage(int,int,const QString&) ;
|
||||
|
||||
void updateToolBaricons();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
|
|
@ -190,7 +188,7 @@ private:
|
|||
|
||||
QLabel *_hashing_info_label ;
|
||||
|
||||
QIcon MessageIcon;
|
||||
QAction *messageAction ;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::MainWindow ui;
|
||||
|
|
|
|||
|
|
@ -1025,7 +1025,8 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder)
|
|||
std::list<DirDetails>::iterator it;
|
||||
getFileInfoFromIndexList(qmil, files_info);
|
||||
|
||||
for (it = files_info.begin(); it != files_info.end(); it++) {
|
||||
for (it = files_info.begin(); it != files_info.end(); it++)
|
||||
{
|
||||
if ((*it).type & DIR_TYPE_PERSON) continue;
|
||||
|
||||
std::string fullpath, name;
|
||||
|
|
@ -1039,25 +1040,19 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder)
|
|||
name = fullpath;
|
||||
}
|
||||
|
||||
if (!openFolder) {
|
||||
if ((*it).type & DIR_TYPE_FILE) {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(name.c_str()));
|
||||
}
|
||||
} else {
|
||||
if (dirs_to_open.end() == std::find(dirs_to_open.begin(), dirs_to_open.end(), fullpath)) {
|
||||
dirs_to_open.push_back(fullpath);
|
||||
}
|
||||
}
|
||||
std::cerr << "Opennign this file: " << name << std::endl ;
|
||||
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8(name.c_str(),name.length())));
|
||||
}
|
||||
|
||||
if (openFolder) {
|
||||
std::list<std::string>::iterator dit;
|
||||
for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++)
|
||||
{
|
||||
std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ;
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile((*dit).c_str()));
|
||||
}
|
||||
}
|
||||
// if (openFolder) {
|
||||
// std::list<std::string>::iterator dit;
|
||||
// for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++)
|
||||
// {
|
||||
// std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ;
|
||||
// QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8((*dit).c_str())));
|
||||
// }
|
||||
// }
|
||||
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "::::::::::::Done RemoteDirModel::openSelected()" << std::endl;
|
||||
|
|
|
|||
|
|
@ -171,6 +171,24 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
|||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
||||
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) );
|
||||
copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
|
||||
connect( copylinklocalhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
|
||||
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
|
||||
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
|
||||
sendhtmllinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links (HTML)" ), this );
|
||||
connect( sendhtmllinkAct , SIGNAL( triggered() ), this, SLOT( sendHtmlLinkTo( ) ) );
|
||||
sendlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Cloud" ), this );
|
||||
connect( sendlinkCloudAct , SIGNAL( triggered() ), this, SLOT( sendLinkToCloud( ) ) );
|
||||
addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this );
|
||||
connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) );
|
||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SharedFilesDialog::checkUpdate()
|
||||
|
|
@ -595,7 +613,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||
QMenu contextMnu2( this );
|
||||
//
|
||||
|
||||
QAction* menuAction = fileAssotiationAction(currentFile) ;
|
||||
// QAction* menuAction = fileAssotiationAction(currentFile) ;
|
||||
//new QAction(QIcon(IMAGE_PLAY), currentFile, this);
|
||||
//tr( "111Play File(s)" ), this );
|
||||
// connect( openfolderAct , SIGNAL( triggered() ), this,
|
||||
|
|
@ -618,10 +636,10 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||
*
|
||||
*/
|
||||
|
||||
QMenu *recMenu = new QMenu( tr("Recommend (Automated message) To "), this );
|
||||
recMenu->setIcon(QIcon(IMAGE_ATTACHMENT));
|
||||
QMenu *msgMenu = new QMenu( tr("Recommend in a message to "), &contextMnu2 );
|
||||
msgMenu->setIcon(QIcon(IMAGE_MSG));
|
||||
QMenu recMenu( tr("Recommend (Automated message) To "), this );
|
||||
recMenu.setIcon(QIcon(IMAGE_ATTACHMENT));
|
||||
QMenu msgMenu( tr("Recommend in a message to "), &contextMnu2 );
|
||||
msgMenu.setIcon(QIcon(IMAGE_MSG));
|
||||
|
||||
std::list<std::string> peers;
|
||||
std::list<std::string>::iterator it;
|
||||
|
|
@ -649,52 +667,24 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||
* msgMenu
|
||||
*/
|
||||
|
||||
RsAction *qaf1 = new RsAction( QIcon(IMAGE_FRIEND), QString::fromStdString( nn ), recMenu, *it );
|
||||
RsAction *qaf1 = new RsAction( QIcon(IMAGE_FRIEND), QString::fromStdString( nn ), &recMenu, *it );
|
||||
connect( qaf1 , SIGNAL( triggeredId( std::string ) ), this, SLOT( recommendFilesTo( std::string ) ) );
|
||||
recMenu->addAction(qaf1);
|
||||
|
||||
RsAction *qaf2 = new RsAction( QIcon(IMAGE_FRIEND), QString::fromStdString( nn ), msgMenu, *it );
|
||||
RsAction *qaf2 = new RsAction( QIcon(IMAGE_FRIEND), QString::fromStdString( nn ), &msgMenu, *it );
|
||||
connect( qaf2 , SIGNAL( triggeredId( std::string ) ), this, SLOT( recommendFilesToMsg( std::string ) ) );
|
||||
msgMenu->addAction(qaf2);
|
||||
|
||||
recMenu.addAction(qaf1);
|
||||
msgMenu.addAction(qaf2);
|
||||
|
||||
/* create list of ids */
|
||||
|
||||
}
|
||||
//#endif
|
||||
|
||||
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
||||
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) );
|
||||
|
||||
copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
|
||||
connect( copylinklocalhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
|
||||
|
||||
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
|
||||
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
|
||||
|
||||
sendhtmllinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links (HTML)" ), this );
|
||||
connect( sendhtmllinkAct , SIGNAL( triggered() ), this, SLOT( sendHtmlLinkTo( ) ) );
|
||||
|
||||
// sendchatlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Chat" ), this );
|
||||
// connect( sendchatlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinktoChat( ) ) );
|
||||
|
||||
sendlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Cloud" ), this );
|
||||
connect( sendlinkCloudAct , SIGNAL( triggered() ), this, SLOT( sendLinkToCloud( ) ) );
|
||||
|
||||
addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this );
|
||||
connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) );
|
||||
|
||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
|
||||
|
||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
|
||||
|
||||
|
||||
if(localModel->isDir( midx ) )
|
||||
contextMnu2.addAction( openfolderAct);
|
||||
else
|
||||
{
|
||||
contextMnu2.addAction( menuAction );
|
||||
// contextMnu2.addAction( menuAction );
|
||||
contextMnu2.addAction( openfileAct);
|
||||
}
|
||||
|
||||
|
|
@ -713,14 +703,12 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
|
|||
contextMnu2.addAction( addlinkCloudAct);
|
||||
contextMnu2.addSeparator();
|
||||
#endif
|
||||
contextMnu2.addMenu( recMenu);
|
||||
contextMnu2.addMenu( msgMenu);
|
||||
contextMnu2.addMenu( &recMenu);
|
||||
contextMnu2.addMenu( &msgMenu);
|
||||
}
|
||||
|
||||
QMouseEvent *mevent2 = new QMouseEvent( QEvent::MouseButtonPress, point,
|
||||
Qt::RightButton, Qt::RightButton,
|
||||
Qt::NoModifier );
|
||||
contextMnu2.exec( mevent2->globalPos() );
|
||||
QMouseEvent mevent2( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
contextMnu2.exec( mevent2.globalPos() );
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
|||
|
|
@ -203,6 +203,57 @@ TransfersDialog::TransfersDialog(QWidget *parent)
|
|||
|
||||
QObject::connect(ui._showCacheTransfers_CB,SIGNAL(toggled(bool)),this,SLOT(insertTransfers())) ;
|
||||
|
||||
// Actions. Only need to be defined once.
|
||||
pauseAct = new QAction(QIcon(IMAGE_PAUSE), tr("Pause"), this);
|
||||
connect(pauseAct, SIGNAL(triggered()), this, SLOT(pauseFileTransfer()));
|
||||
|
||||
resumeAct = new QAction(QIcon(IMAGE_RESUME), tr("Resume"), this);
|
||||
connect(resumeAct, SIGNAL(triggered()), this, SLOT(resumeFileTransfer()));
|
||||
|
||||
cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this );
|
||||
connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
|
||||
|
||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openFolderTransfer()));
|
||||
|
||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openTransfer()));
|
||||
|
||||
previewfileAct = new QAction(QIcon(IMAGE_PREVIEW), tr("Preview File"), this);
|
||||
connect(previewfileAct, SIGNAL(triggered()), this, SLOT(previewTransfer()));
|
||||
|
||||
detailsfileAct = new QAction(QIcon(IMAGE_INFO), tr("Details..."), this);
|
||||
connect(detailsfileAct, SIGNAL(triggered()), this, SLOT(showDetailsDialog()));
|
||||
|
||||
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
|
||||
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
|
||||
|
||||
#ifndef RS_RELEASE_VERSION
|
||||
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
||||
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||
#endif
|
||||
pastelinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste retroshare Link" ), this );
|
||||
connect( pastelinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
||||
queueDownAct = new QAction(QIcon(":/images/go-down.png"), tr("Down"), this);
|
||||
connect(queueDownAct, SIGNAL(triggered()), this, SLOT(priorityQueueDown()));
|
||||
queueUpAct = new QAction(QIcon(":/images/go-up.png"), tr("Up"), this);
|
||||
connect(queueUpAct, SIGNAL(triggered()), this, SLOT(priorityQueueUp()));
|
||||
queueTopAct = new QAction(QIcon(":/images/go-top.png"), tr("Top"), this);
|
||||
connect(queueTopAct, SIGNAL(triggered()), this, SLOT(priorityQueueTop()));
|
||||
queueBottomAct = new QAction(QIcon(":/images/go-bottom.png"), tr("Bottom"), this);
|
||||
connect(queueBottomAct, SIGNAL(triggered()), this, SLOT(priorityQueueBottom()));
|
||||
chunkStreamingAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Streaming"), this);
|
||||
connect(chunkStreamingAct, SIGNAL(triggered()), this, SLOT(chunkStreaming()));
|
||||
prioritySlowAct = new QAction(QIcon(IMAGE_PRIORITYLOW), tr("Slower"), this);
|
||||
connect(prioritySlowAct, SIGNAL(triggered()), this, SLOT(speedSlow()));
|
||||
priorityMediumAct = new QAction(QIcon(IMAGE_PRIORITYNORMAL), tr("Average"), this);
|
||||
connect(priorityMediumAct, SIGNAL(triggered()), this, SLOT(speedAverage()));
|
||||
priorityFastAct = new QAction(QIcon(IMAGE_PRIORITYHIGH), tr("Faster"), this);
|
||||
connect(priorityFastAct, SIGNAL(triggered()), this, SLOT(speedFast()));
|
||||
chunkRandomAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Random"), this);
|
||||
connect(chunkRandomAct, SIGNAL(triggered()), this, SLOT(chunkRandom()));
|
||||
playAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play" ), this );
|
||||
connect( playAct , SIGNAL( triggered() ), this, SLOT( openTransfer() ) );
|
||||
}
|
||||
|
||||
void TransfersDialog::keyPressEvent(QKeyEvent *e)
|
||||
|
|
@ -219,7 +270,7 @@ void TransfersDialog::keyPressEvent(QKeyEvent *e)
|
|||
void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
||||
{
|
||||
QMenu contextMnu( this );
|
||||
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
QMouseEvent mevent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
|
||||
|
||||
std::set<QStandardItem *> items;
|
||||
std::set<QStandardItem *>::iterator it;
|
||||
|
|
@ -262,88 +313,25 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||
}
|
||||
|
||||
|
||||
QAction *playAct = NULL;
|
||||
if (addPlayOption)
|
||||
{
|
||||
playAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play" ), this );
|
||||
connect( playAct , SIGNAL( triggered() ), this, SLOT( openTransfer() ) );
|
||||
}
|
||||
QMenu viewMenu( tr("View"), this );
|
||||
|
||||
pauseAct = new QAction(QIcon(IMAGE_PAUSE), tr("Pause"), this);
|
||||
connect(pauseAct, SIGNAL(triggered()), this, SLOT(pauseFileTransfer()));
|
||||
QMenu priorityQueueMenu(tr("Move in Queue..."), this);
|
||||
priorityQueueMenu.setIcon(QIcon(IMAGE_PRIORITY));
|
||||
priorityQueueMenu.addAction(queueTopAct);
|
||||
priorityQueueMenu.addAction(queueUpAct);
|
||||
priorityQueueMenu.addAction(queueDownAct);
|
||||
priorityQueueMenu.addAction(queueBottomAct);
|
||||
|
||||
resumeAct = new QAction(QIcon(IMAGE_RESUME), tr("Resume"), this);
|
||||
connect(resumeAct, SIGNAL(triggered()), this, SLOT(resumeFileTransfer()));
|
||||
QMenu prioritySpeedMenu(tr("Priority (Speed)..."), this);
|
||||
prioritySpeedMenu.setIcon(QIcon(IMAGE_PRIORITY));
|
||||
prioritySpeedMenu.addAction(prioritySlowAct);
|
||||
prioritySpeedMenu.addAction(priorityMediumAct);
|
||||
prioritySpeedMenu.addAction(priorityFastAct);
|
||||
|
||||
cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this );
|
||||
connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
|
||||
|
||||
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
|
||||
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openFolderTransfer()));
|
||||
|
||||
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
|
||||
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openTransfer()));
|
||||
|
||||
previewfileAct = new QAction(QIcon(IMAGE_PREVIEW), tr("Preview File"), this);
|
||||
connect(previewfileAct, SIGNAL(triggered()), this, SLOT(previewTransfer()));
|
||||
|
||||
detailsfileAct = new QAction(QIcon(IMAGE_INFO), tr("Details..."), this);
|
||||
connect(detailsfileAct, SIGNAL(triggered()), this, SLOT(showDetailsDialog()));
|
||||
|
||||
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
|
||||
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
|
||||
|
||||
#ifndef RS_RELEASE_VERSION
|
||||
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
|
||||
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||
#endif
|
||||
|
||||
pastelinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste retroshare Link" ), this );
|
||||
connect( pastelinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
||||
|
||||
QMenu *viewMenu = new QMenu( tr("View"), this );
|
||||
|
||||
// clearQueueAct = new QAction(QIcon(), tr("Remove all queued"), this);
|
||||
// connect(clearQueueAct, SIGNAL(triggered()), this, SLOT(clearQueue()));
|
||||
|
||||
queueDownAct = new QAction(QIcon(":/images/go-down.png"), tr("Down"), this);
|
||||
connect(queueDownAct, SIGNAL(triggered()), this, SLOT(priorityQueueDown()));
|
||||
queueUpAct = new QAction(QIcon(":/images/go-up.png"), tr("Up"), this);
|
||||
connect(queueUpAct, SIGNAL(triggered()), this, SLOT(priorityQueueUp()));
|
||||
queueTopAct = new QAction(QIcon(":/images/go-top.png"), tr("Top"), this);
|
||||
connect(queueTopAct, SIGNAL(triggered()), this, SLOT(priorityQueueTop()));
|
||||
queueBottomAct = new QAction(QIcon(":/images/go-bottom.png"), tr("Bottom"), this);
|
||||
connect(queueBottomAct, SIGNAL(triggered()), this, SLOT(priorityQueueBottom()));
|
||||
|
||||
prioritySlowAct = new QAction(QIcon(IMAGE_PRIORITYLOW), tr("Slower"), this);
|
||||
connect(prioritySlowAct, SIGNAL(triggered()), this, SLOT(speedSlow()));
|
||||
priorityMediumAct = new QAction(QIcon(IMAGE_PRIORITYNORMAL), tr("Average"), this);
|
||||
connect(priorityMediumAct, SIGNAL(triggered()), this, SLOT(speedAverage()));
|
||||
priorityFastAct = new QAction(QIcon(IMAGE_PRIORITYHIGH), tr("Faster"), this);
|
||||
connect(priorityFastAct, SIGNAL(triggered()), this, SLOT(speedFast()));
|
||||
|
||||
QMenu *priorityQueueMenu = new QMenu(tr("Move in Queue..."), this);
|
||||
priorityQueueMenu->setIcon(QIcon(IMAGE_PRIORITY));
|
||||
priorityQueueMenu->addAction(queueTopAct);
|
||||
priorityQueueMenu->addAction(queueUpAct);
|
||||
priorityQueueMenu->addAction(queueDownAct);
|
||||
priorityQueueMenu->addAction(queueBottomAct);
|
||||
|
||||
QMenu *prioritySpeedMenu = new QMenu(tr("Priority (Speed)..."), this);
|
||||
prioritySpeedMenu->setIcon(QIcon(IMAGE_PRIORITY));
|
||||
prioritySpeedMenu->addAction(prioritySlowAct);
|
||||
prioritySpeedMenu->addAction(priorityMediumAct);
|
||||
prioritySpeedMenu->addAction(priorityFastAct);
|
||||
|
||||
chunkStreamingAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Streaming"), this);
|
||||
connect(chunkStreamingAct, SIGNAL(triggered()), this, SLOT(chunkStreaming()));
|
||||
chunkRandomAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Random"), this);
|
||||
connect(chunkRandomAct, SIGNAL(triggered()), this, SLOT(chunkRandom()));
|
||||
|
||||
QMenu *chunkMenu = new QMenu(tr("Chunk strategy"), this);
|
||||
chunkMenu->setIcon(QIcon(IMAGE_PRIORITY));
|
||||
chunkMenu->addAction(chunkStreamingAct);
|
||||
chunkMenu->addAction(chunkRandomAct);
|
||||
QMenu chunkMenu(tr("Chunk strategy"), this);
|
||||
chunkMenu.setIcon(QIcon(IMAGE_PRIORITY));
|
||||
chunkMenu.addAction(chunkStreamingAct);
|
||||
chunkMenu.addAction(chunkRandomAct);
|
||||
|
||||
contextMnu.clear();
|
||||
|
||||
|
|
@ -378,12 +366,12 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||
}
|
||||
|
||||
if(all_downloading)
|
||||
contextMnu.addMenu(prioritySpeedMenu);
|
||||
contextMnu.addMenu(&prioritySpeedMenu);
|
||||
else if(all_queued)
|
||||
contextMnu.addMenu(priorityQueueMenu) ;
|
||||
contextMnu.addMenu(&priorityQueueMenu) ;
|
||||
|
||||
if(all_downloading)
|
||||
contextMnu.addMenu( chunkMenu);
|
||||
contextMnu.addMenu( &chunkMenu);
|
||||
|
||||
if(single)
|
||||
{
|
||||
|
|
@ -422,11 +410,9 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||
contextMnu.addAction( pastelinkAct);
|
||||
|
||||
contextMnu.addSeparator();
|
||||
// contextMnu.addAction( clearQueueAct);
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addMenu( viewMenu);
|
||||
contextMnu.addMenu( &viewMenu);
|
||||
|
||||
contextMnu.exec( mevent->globalPos() );
|
||||
contextMnu.exec( mevent.globalPos() );
|
||||
}
|
||||
|
||||
TransfersDialog::~TransfersDialog()
|
||||
|
|
@ -733,7 +719,7 @@ void TransfersDialog::insertTransfers()
|
|||
FileProgressInfo pinfo ;
|
||||
pinfo.cmap = fcinfo.chunks ;
|
||||
pinfo.type = FileProgressInfo::DOWNLOAD_LINE ;
|
||||
pinfo.progress = completed*100.0/info.size ;
|
||||
pinfo.progress = (info.size==0)?0:(completed*100.0/info.size) ;
|
||||
pinfo.nb_chunks = pinfo.cmap._map.empty()?0:fcinfo.chunks.size() ;
|
||||
|
||||
int addedRow = addItem("", fileName, fileHash, fileSize, pinfo, fileDlspeed, sources, status, priority, completed, remaining, downloadtime);
|
||||
|
|
@ -878,8 +864,8 @@ void TransfersDialog::insertTransfers()
|
|||
|
||||
double dlspeed = pit->tfRate * 1024.0;
|
||||
qlonglong fileSize = info.size;
|
||||
double completed = info.transfered;
|
||||
double progress = info.transfered * 100.0 / info.size;
|
||||
qlonglong completed = info.transfered;
|
||||
double progress = (info.size > 0)?(info.transfered * 100.0 / info.size):0.0;
|
||||
qlonglong remaining = (info.size - info.transfered) / (info.tfRate * 1024.0);
|
||||
|
||||
// Estimate the completion. We need something more accurate, meaning that we need to
|
||||
|
|
@ -891,49 +877,50 @@ void TransfersDialog::insertTransfers()
|
|||
++nb_chunks ;
|
||||
|
||||
uint32_t filled_chunks = pinfo.cmap.filledChunks(nb_chunks) ;
|
||||
pinfo.type = FileProgressInfo::UPLOAD_LINE ;
|
||||
pinfo.nb_chunks = pinfo.cmap._map.empty()?0:nb_chunks ;
|
||||
|
||||
if(filled_chunks > 1) {
|
||||
pinfo.progress = filled_chunks*100.0/nb_chunks ;
|
||||
pinfo.progress = (nb_chunks==0)?0:(filled_chunks*100.0/nb_chunks) ;
|
||||
completed = std::min(info.size,((uint64_t)filled_chunks)*chunk_size) ;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
pinfo.progress = progress ;
|
||||
}
|
||||
|
||||
addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, sources, status, completed, remaining);
|
||||
}
|
||||
|
||||
if (info.peers.size() == 0) { //it has not been added (maybe only turtle tunnels
|
||||
QString fileHash = QString::fromStdString(info.hash);
|
||||
QString fileName = QString::fromUtf8(info.fname.c_str());
|
||||
QString sources = tr("");
|
||||
|
||||
QString status;
|
||||
switch(info.downloadStatus)
|
||||
{
|
||||
case FT_STATE_FAILED: status = tr("Failed"); break;
|
||||
case FT_STATE_OKAY: status = tr("Okay"); break;
|
||||
case FT_STATE_WAITING: status = tr("Waiting"); break;
|
||||
case FT_STATE_DOWNLOADING: status = tr("Uploading");break;
|
||||
case FT_STATE_COMPLETE:status = tr("Complete"); break;
|
||||
default: status = tr("Complete"); break;
|
||||
|
||||
}
|
||||
|
||||
double dlspeed = info.tfRate * 1024.0;
|
||||
qlonglong fileSize = info.size;
|
||||
double completed = info.transfered;
|
||||
double progress = info.transfered * 100.0 / info.size;
|
||||
qlonglong remaining = (info.size - info.transfered) / (info.tfRate * 1024.0);
|
||||
|
||||
FileProgressInfo pinfo ;
|
||||
pinfo.progress = progress ;
|
||||
pinfo.cmap = CompressedChunkMap() ;
|
||||
pinfo.type = FileProgressInfo::DOWNLOAD_LINE ;
|
||||
pinfo.nb_chunks = 0 ;
|
||||
|
||||
addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, sources, status, completed, remaining);
|
||||
}
|
||||
// if (info.peers.size() == 0) { //it has not been added (maybe only turtle tunnels
|
||||
// QString fileHash = QString::fromStdString(info.hash);
|
||||
// QString fileName = QString::fromUtf8(info.fname.c_str());
|
||||
// QString sources = tr("");
|
||||
//
|
||||
// QString status;
|
||||
// switch(info.downloadStatus)
|
||||
// {
|
||||
// case FT_STATE_FAILED: status = tr("Failed"); break;
|
||||
// case FT_STATE_OKAY: status = tr("Okay"); break;
|
||||
// case FT_STATE_WAITING: status = tr("Waiting"); break;
|
||||
// case FT_STATE_DOWNLOADING: status = tr("Uploading");break;
|
||||
// case FT_STATE_COMPLETE:status = tr("Complete"); break;
|
||||
// default: status = tr("Complete"); break;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// double dlspeed = info.tfRate * 1024.0;
|
||||
// qlonglong fileSize = info.size;
|
||||
// double completed = info.transfered;
|
||||
// double progress = info.transfered * 100.0 / info.size;
|
||||
// qlonglong remaining = (info.size - info.transfered) / (info.tfRate * 1024.0);
|
||||
//
|
||||
// FileProgressInfo pinfo ;
|
||||
// pinfo.progress = progress ;
|
||||
// pinfo.cmap = CompressedChunkMap() ;
|
||||
// pinfo.type = FileProgressInfo::DOWNLOAD_LINE ;
|
||||
// pinfo.nb_chunks = 0 ;
|
||||
//
|
||||
// addUploadItem("", fileName, fileHash, fileSize, pinfo, dlspeed, sources, status, completed, remaining);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ private:
|
|||
QMenu* contextMnu;
|
||||
/** Defines the actions for the context menu */
|
||||
QAction* showdowninfoAct;
|
||||
QAction* playAct;
|
||||
QAction* cancelAct;
|
||||
QAction* clearcompletedAct;
|
||||
QAction* copylinkAct;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
using namespace std ;
|
||||
|
||||
TrustView::TrustView()
|
||||
: RsAutoUpdatePage(10000)
|
||||
{
|
||||
setupUi(this) ;
|
||||
|
||||
|
|
@ -26,13 +27,6 @@ TrustView::TrustView()
|
|||
QObject::connect(trustTableTW->horizontalHeader(),SIGNAL(sectionClicked(int)),this,SLOT(hideShowPeers(int))) ;
|
||||
|
||||
updatePB->setToolTip(tr("This table normaly auto-updates every 10 seconds.")) ;
|
||||
|
||||
QTimer *timer = new QTimer ;
|
||||
|
||||
QObject::connect(timer,SIGNAL(timeout()),this,SLOT(update())) ;
|
||||
timer->start(10000) ;
|
||||
|
||||
update() ;
|
||||
}
|
||||
|
||||
void TrustView::showEvent(QShowEvent *e)
|
||||
|
|
@ -55,10 +49,11 @@ void TrustView::selectCell(int row,int col)
|
|||
{
|
||||
static int last_row = -1 ;
|
||||
static int last_col = -1 ;
|
||||
|
||||
#ifdef DEBUG_TRUSTVIEW
|
||||
cout << "row = " << row << ", column = " << col << endl;
|
||||
if(row == 0 || col == 0)
|
||||
cout << "***********************************************" << endl ;
|
||||
#endif
|
||||
if(last_row > -1)
|
||||
{
|
||||
int col_s,row_s ;
|
||||
|
|
@ -133,19 +128,18 @@ int TrustView::getRowColId(const string& peerid)
|
|||
return i ;
|
||||
}
|
||||
|
||||
void TrustView::updateDisplay()
|
||||
{
|
||||
update() ;
|
||||
}
|
||||
void TrustView::update()
|
||||
{
|
||||
// collect info.
|
||||
|
||||
if(!isVisible())
|
||||
return ;
|
||||
|
||||
std::list<std::string> neighs;
|
||||
|
||||
if(!rsPeers->getGPGAllList(neighs))
|
||||
if(!rsPeers->getGPGAllList(neighs))
|
||||
return ;
|
||||
|
||||
neighs.push_back(rsPeers->getGPGOwnId()) ;
|
||||
neighs.push_back(rsPeers->getGPGOwnId()) ;
|
||||
|
||||
trustTableTW->setSortingEnabled(false) ;
|
||||
|
||||
|
|
@ -162,9 +156,11 @@ void TrustView::update()
|
|||
int i = getRowColId(details.id) ;
|
||||
std::string issuer(details.issuer) ; // the one we check for trust.
|
||||
|
||||
for(list<string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
|
||||
for(list<string>::const_iterator it2(details.gpgSigners.begin());it2!=details.gpgSigners.end();++it2)
|
||||
{
|
||||
#ifdef DEBUG_TRUSTVIEW
|
||||
cout << *it2 << " " ;
|
||||
#endif
|
||||
|
||||
int j = getRowColId(*it2) ;
|
||||
|
||||
|
|
@ -175,7 +171,7 @@ void TrustView::update()
|
|||
else
|
||||
trustTableTW->item(i,j)->setText(trr) ;
|
||||
}
|
||||
// cout << endl ;
|
||||
// cout << endl ;
|
||||
}
|
||||
// assign colors
|
||||
vector<int> ni(trustTableTW->rowCount(),0) ;
|
||||
|
|
@ -199,7 +195,7 @@ void TrustView::update()
|
|||
if(i_ji == NULL)
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::yellow) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" is athenticated (one way) by " )+trustTableTW->verticalHeaderItem(j)->text()) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" is athenticated (one way) by " )+trustTableTW->verticalHeaderItem(j)->text()) ;
|
||||
i_ij->setText(tr("Half")) ;
|
||||
}
|
||||
else
|
||||
|
|
@ -207,22 +203,22 @@ void TrustView::update()
|
|||
if(i==j)
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::red) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" athenticated himself") ) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + tr(" athenticated himself") ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
i_ij->setBackgroundColor(Qt::green) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " and " +trustTableTW->verticalHeaderItem(j)->text() + tr(" athenticated each others") ) ;
|
||||
i_ij->setToolTip(trustTableTW->horizontalHeaderItem(i)->text() + " and " +trustTableTW->verticalHeaderItem(j)->text() + tr(" athenticated each others") ) ;
|
||||
i_ij->setText(tr("Full")) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0;i<trustTableTW->rowCount();++i)
|
||||
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+ tr(" is athenticated by ") + QString::number(ni[i]) + tr(" peers, including him(her)self.")) ;
|
||||
trustTableTW->verticalHeaderItem(i)->setToolTip(trustTableTW->verticalHeaderItem(i)->text()+ tr(" is athenticated by ") + QString::number(ni[i]) + tr(" peers, including him(her)self.")) ;
|
||||
|
||||
for(int j=0;j<trustTableTW->columnCount();++j)
|
||||
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+ tr(" athenticated ") + QString::number(nj[j]) + tr(" peers, including him(her)self.")) ;
|
||||
trustTableTW->horizontalHeaderItem(j)->setToolTip(trustTableTW->horizontalHeaderItem(j)->text()+ tr(" athenticated ") + QString::number(nj[j]) + tr(" peers, including him(her)self.")) ;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#include "ui_TrustView.h"
|
||||
#include <gui/RsAutoUpdatePage.h>
|
||||
|
||||
class QWheelEvent ;
|
||||
class QShowEvent ;
|
||||
|
||||
class TrustView: public QWidget, public Ui::TrustView
|
||||
class TrustView: public RsAutoUpdatePage, public Ui::TrustView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ class TrustView: public QWidget, public Ui::TrustView
|
|||
virtual void wheelEvent(QWheelEvent *) ;
|
||||
virtual void showEvent(QShowEvent *) ;
|
||||
|
||||
virtual void updateDisplay() ;
|
||||
public slots:
|
||||
void update() ;
|
||||
void updateZoom(int) ;
|
||||
|
|
|
|||
|
|
@ -206,16 +206,14 @@ TextPage::TextPage(QWidget *parent)
|
|||
userCertEdit = new QTextEdit;
|
||||
std::string invite = rsPeers->GetRetroshareInvite();
|
||||
|
||||
userCertEdit->setText(QString::fromStdString(invite));
|
||||
userCertEdit->setReadOnly(true);
|
||||
userCertEdit->setMinimumHeight(200);
|
||||
userCertEdit->setMinimumWidth(530);
|
||||
QFont font;
|
||||
font.setPointSize(10);
|
||||
font.setBold(false);
|
||||
font.setStyleHint(QFont::TypeWriter, QFont::PreferDefault);
|
||||
//font.setWeight(75);
|
||||
QFont font("Courier New",10,50,false);
|
||||
font.setStyleHint(QFont::TypeWriter,QFont::PreferMatch);
|
||||
font.setStyle(QFont::StyleNormal);
|
||||
userCertEdit->setFont(font);
|
||||
userCertEdit->setText(QString::fromStdString(invite));
|
||||
|
||||
std::cerr << "TextPage() getting Invite: " << invite << std::endl;
|
||||
|
||||
|
|
@ -270,6 +268,9 @@ TextPage::TextPage(QWidget *parent)
|
|||
|
||||
friendCertEdit = new QTextEdit;
|
||||
|
||||
//font.setWeight(75);
|
||||
friendCertEdit->setFont(font);
|
||||
|
||||
//=== add all widgets to one layout
|
||||
textPageLayout = new QVBoxLayout();
|
||||
textPageLayout->addWidget(userCertLabel);
|
||||
|
|
|
|||
|
|
@ -80,6 +80,9 @@ CryptoPage::load()
|
|||
void
|
||||
CryptoPage::loadPublicKey()
|
||||
{
|
||||
QFont font("Courier New",9,50,false) ;
|
||||
ui.certtextEdit->setFont(font) ;
|
||||
|
||||
ui.certtextEdit->setPlainText(QString::fromStdString(rsPeers->GetRetroshareInvite()));
|
||||
ui.certtextEdit->setReadOnly(true);
|
||||
ui.certtextEdit->setMinimumHeight(200);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ void xProgressBar::paint()
|
|||
else
|
||||
{
|
||||
// calculate progress value
|
||||
int preWidth = static_cast<int>((rect.width() - 1 - hSpan)*(_pinfo.progress/100));
|
||||
int preWidth = static_cast<int>((rect.width() - 1 - hSpan)*(_pinfo.progress/100.0f));
|
||||
int progressWidth = rect.width() - preWidth;
|
||||
if (progressWidth == rect.width() - hSpan) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue