* 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:
ammorais 2009-07-09 16:12:18 +00:00
parent dbc35c43c0
commit 511e040dcb
5 changed files with 48 additions and 44 deletions

View file

@ -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 \

View file

@ -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"
@ -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);
timer2->connect(timer, SIGNAL(timeout()), this, SLOT(updateNetworkStatus()));
timer2->start(1000);
getNetworkStatus();
updateNetworkStatus(); //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()

View file

@ -87,7 +87,6 @@ private slots:
private: private:
QTreeWidgetItem *getCurrentNeighbour(); QTreeWidgetItem *getCurrentNeighbour();
/** Define the popup menus for the Context menu */ /** Define the popup menus for the Context menu */
@ -99,7 +98,7 @@ QTreeWidgetItem *getCurrentNeighbour();
QAction* makefriendAct; QAction* makefriendAct;
QAction* authAct; QAction* authAct;
QAction* loadcertAct; QAction* loadcertAct;
QTimer* updateNetworkTimer;
/* connection dialog */ /* connection dialog */
ConnectDialog *connectdialog; ConnectDialog *connectdialog;
@ -109,6 +108,7 @@ QTreeWidgetItem *getCurrentNeighbour();
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::NetworkDialog ui; Ui::NetworkDialog ui;
}; };
#endif #endif

View file

@ -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();
} }