mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-08 22:32:34 -04:00
* Change on the Timers of Network Menu that weren't wroking properlly
* Fixed the context menu position of the Netwok Log git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/ammorais_branch@1340 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dbc35c43c0
commit
511e040dcb
5 changed files with 48 additions and 44 deletions
|
@ -1,9 +1,9 @@
|
||||||
CONFIG += qt gui uic qrc resources uitools release # pluginmgr debug
|
CONFIG += qt gui uic qrc resources uitools debug_and_release # pluginmgr debug
|
||||||
QT += network xml script
|
QT += network xml script
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = RetroShare
|
|
||||||
|
|
||||||
DEFINES *= RS_RELEASE_VERSION
|
|
||||||
|
#DEFINES *= RS_RELEASE_VERSION
|
||||||
RCC_DIR = temp/qrc
|
RCC_DIR = temp/qrc
|
||||||
UI_DIR = temp/ui
|
UI_DIR = temp/ui
|
||||||
MOC_DIR = temp/moc
|
MOC_DIR = temp/moc
|
||||||
|
@ -67,17 +67,18 @@ macx {
|
||||||
# On Linux systems that alredy have libssl and libcrypto it is advisable
|
# On Linux systems that alredy have libssl and libcrypto it is advisable
|
||||||
# to rename the patched version of SSL to something like libsslxpgp.a and libcryptoxpg.a
|
# to rename the patched version of SSL to something like libsslxpgp.a and libcryptoxpg.a
|
||||||
|
|
||||||
# comment the next option if you renamed libcrtypto and libssl
|
|
||||||
LIBS += -L"../../../../lib" -lretroshare -lminiupnpc -lssl -lcrypto
|
|
||||||
|
|
||||||
# uncomment the next option if you renamed libcrtypto and libssl
|
|
||||||
#LIBS += -L"../../../../lib" -lretroshare -lminiupnpc -lsslxpgp -lcryptoxpgp
|
|
||||||
|
|
||||||
# ###########################################
|
|
||||||
|
|
||||||
LIBS += -lz -lgpgme
|
LIBS += -lz -lgpgme
|
||||||
LIBS += -lQtUiTools
|
LIBS += -lQtUiTools
|
||||||
|
|
||||||
|
CONFIG(debug, debug|release) {
|
||||||
|
LIBS += -L"../../../../../../lib" -lretrosharedebug -lminiupnpc -lsslxpgp -lcryptoxpgp
|
||||||
|
TARGET = retrosharedebug
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LIBS += -L"../../../../../../lib" -lretroshare -lminiupnpc -lsslxpgp -lcryptoxpgp
|
||||||
|
TARGET = retroshare
|
||||||
|
}
|
||||||
|
|
||||||
DEPENDPATH += . \
|
DEPENDPATH += . \
|
||||||
rsiface \
|
rsiface \
|
||||||
control \
|
control \
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QCursor>
|
||||||
|
|
||||||
#include "rshare.h"
|
#include "rshare.h"
|
||||||
#include "common/vmessagebox.h"
|
#include "common/vmessagebox.h"
|
||||||
|
@ -114,7 +115,7 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
||||||
QTreeWidgetItem * headerItem = ui.connecttreeWidget->headerItem();
|
QTreeWidgetItem * headerItem = ui.connecttreeWidget->headerItem();
|
||||||
headerItem->setTextAlignment(0, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(0, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(1, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(3, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(3, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(4, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(4, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
headerItem->setTextAlignment(5, Qt::AlignHCenter | Qt::AlignVCenter);
|
headerItem->setTextAlignment(5, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
@ -148,16 +149,15 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
||||||
menu->addAction(ui.actionTabsRounded);
|
menu->addAction(ui.actionTabsRounded);
|
||||||
ui.viewButton->setMenu(menu);
|
ui.viewButton->setMenu(menu);
|
||||||
|
|
||||||
QTimer *timer = new QTimer(this);
|
updateNetworkTimer = new QTimer(this);
|
||||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(getNetworkStatus()));
|
updateNetworkTimer->start(5000);
|
||||||
timer->start(100000);
|
connect(updateNetworkTimer, SIGNAL(timeout()), this, SLOT(getNetworkStatus()));
|
||||||
|
connect(updateNetworkTimer, SIGNAL(timeout()), this, SLOT(updateNetworkStatus()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QTimer *timer2 = new QTimer(this);
|
//getNetworkStatus();
|
||||||
timer2->connect(timer, SIGNAL(timeout()), this, SLOT(updateNetworkStatus()));
|
//updateNetworkStatus();
|
||||||
timer2->start(1000);
|
|
||||||
|
|
||||||
getNetworkStatus();
|
|
||||||
updateNetworkStatus();
|
|
||||||
//load();
|
//load();
|
||||||
|
|
||||||
|
|
||||||
|
@ -616,7 +616,8 @@ void NetworkDialog::setLogInfo(QString info, QColor color) {
|
||||||
ui.infoLog->clear();
|
ui.infoLog->clear();
|
||||||
nbLines = 1;
|
nbLines = 1;
|
||||||
}
|
}
|
||||||
ui.infoLog->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
ui.infoLog->append(QString::fromUtf8("<font color='grey' // XXX: Why mapToGlobal() is not enough?>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkDialog::on_actionClearLog_triggered() {
|
void NetworkDialog::on_actionClearLog_triggered() {
|
||||||
|
@ -628,7 +629,8 @@ void NetworkDialog::displayInfoLogMenu(const QPoint& pos) {
|
||||||
QMenu myLogMenu(this);
|
QMenu myLogMenu(this);
|
||||||
myLogMenu.addAction(ui.actionClearLog);
|
myLogMenu.addAction(ui.actionClearLog);
|
||||||
// XXX: Why mapToGlobal() is not enough?
|
// XXX: Why mapToGlobal() is not enough?
|
||||||
myLogMenu.exec(mapToGlobal(pos)+QPoint(0,320));
|
// No. Simple use QCursor::pos() to retrieve the position of the cursor.
|
||||||
|
myLogMenu.exec(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkDialog::getNetworkStatus()
|
void NetworkDialog::getNetworkStatus()
|
||||||
|
|
|
@ -87,28 +87,28 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
QTreeWidgetItem *getCurrentNeighbour();
|
||||||
|
|
||||||
QTreeWidgetItem *getCurrentNeighbour();
|
/** Define the popup menus for the Context menu */
|
||||||
|
QMenu* contextMnu;
|
||||||
|
/** Defines the actions for the context menu */
|
||||||
|
QAction* peerdetailsAct;
|
||||||
|
QAction* denyFriendAct;
|
||||||
|
QAction* deleteCertAct;
|
||||||
|
QAction* makefriendAct;
|
||||||
|
QAction* authAct;
|
||||||
|
QAction* loadcertAct;
|
||||||
|
QTimer* updateNetworkTimer;
|
||||||
|
/* connection dialog */
|
||||||
|
ConnectDialog *connectdialog;
|
||||||
|
|
||||||
/** Define the popup menus for the Context menu */
|
QTreeWidget *connecttreeWidget;
|
||||||
QMenu* contextMnu;
|
|
||||||
/** Defines the actions for the context menu */
|
|
||||||
QAction* peerdetailsAct;
|
|
||||||
QAction* denyFriendAct;
|
|
||||||
QAction* deleteCertAct;
|
|
||||||
QAction* makefriendAct;
|
|
||||||
QAction* authAct;
|
|
||||||
QAction* loadcertAct;
|
|
||||||
|
|
||||||
/* connection dialog */
|
|
||||||
ConnectDialog *connectdialog;
|
|
||||||
|
|
||||||
QTreeWidget *connecttreeWidget;
|
|
||||||
|
|
||||||
class NetworkView *networkview;
|
class NetworkView *networkview;
|
||||||
|
|
||||||
|
/** Qt Designer generated object */
|
||||||
|
Ui::NetworkDialog ui;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
|
||||||
Ui::NetworkDialog ui;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -194,7 +194,7 @@ int main(int argc, char *argv[])
|
||||||
/* Startup a Timer to keep the gui's updated */
|
/* Startup a Timer to keep the gui's updated */
|
||||||
QTimer *timer = new QTimer(w);
|
QTimer *timer = new QTimer(w);
|
||||||
timer -> connect(timer, SIGNAL(timeout()), notify, SLOT(UpdateGUI()));
|
timer -> connect(timer, SIGNAL(timeout()), notify, SLOT(UpdateGUI()));
|
||||||
timer->start(1000);
|
timer->start(1000);
|
||||||
|
|
||||||
/* dive into the endless loop */
|
/* dive into the endless loop */
|
||||||
// return ret;
|
// return ret;
|
||||||
|
|
|
@ -164,14 +164,15 @@ void NotifyQt::UpdateGUI()
|
||||||
static time_t lastTs = 0;
|
static time_t lastTs = 0;
|
||||||
|
|
||||||
// std::cerr << "Got update signal t=" << lastTs << std::endl ;
|
// std::cerr << "Got update signal t=" << lastTs << std::endl ;
|
||||||
|
time_t currentTime = time(NULL);
|
||||||
|
|
||||||
if (time(NULL) > lastTs) // always update, every 1 sec.
|
if (currentTime > lastTs) // always update, every 1 sec.
|
||||||
{
|
{
|
||||||
emit transfersChanged();
|
emit transfersChanged();
|
||||||
emit friendsChanged() ;
|
emit friendsChanged() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time(NULL) > lastTs + 5) // update every 5 seconds. I don't know what to do with these.
|
if (currentTime >= lastTs + 5) // update every 5 seconds. I don't know what to do with these.
|
||||||
{
|
{
|
||||||
// displayChannels();
|
// displayChannels();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue