diff --git a/src/gui/res/Synergy.qrc b/src/gui/res/Synergy.qrc index a7027617..8f8ac0c8 100644 --- a/src/gui/res/Synergy.qrc +++ b/src/gui/res/Synergy.qrc @@ -53,5 +53,6 @@ icons/16x16/money.png image/spinning-wheel.gif icons/16x16/padlock.png + icons/16x16/synergy-transfering.png diff --git a/src/gui/res/icons/16x16/synergy-transfering.png b/src/gui/res/icons/16x16/synergy-transfering.png new file mode 100644 index 00000000..72fefca0 Binary files /dev/null and b/src/gui/res/icons/16x16/synergy-transfering.png differ diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 323a1b6c..8ecbb563 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -394,6 +394,13 @@ void MainWindow::appendLogRaw(const QString& text) } void MainWindow::updateStateFromLogLine(const QString &line) +{ + checkConnected(line); + checkFingerprint(line); + checkTransmission(line); +} + +void MainWindow::checkConnected(const QString& line) { // TODO: implement ipc connection state messages to replace this hack. if (line.contains("started server") || @@ -413,8 +420,6 @@ void MainWindow::updateStateFromLogLine(const QString &line) appConfig().saveSettings(); } } - - checkFingerprint(line); } void MainWindow::checkFingerprint(const QString& line) @@ -459,6 +464,19 @@ void MainWindow::checkFingerprint(const QString& line) } } +void MainWindow::checkTransmission(const QString& line) +{ + if (line.contains("receiving file")) + { + int p = line.lastIndexOf(':'); + if (p > 0) { + m_pTrayIcon->showMessage( + "Data Transmission", + "Receiving file: " + line.mid(p + 2)); + } + } +} + bool MainWindow::autoHide() { if ((appConfig().processMode() == Desktop) && @@ -477,6 +495,7 @@ void MainWindow::clearLog() void MainWindow::startSynergy() { + m_pTrayIcon->showMessage("test", "transfering clipboard data!!",QSystemTrayIcon::Warning,2); bool desktopMode = appConfig().processMode() == Desktop; bool serviceMode = appConfig().processMode() == Service; diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 6846be3e..908b488f 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -167,7 +167,9 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase void promptAutoConfig(); void updateEdition(); QString getProfileRootForArg(); + void checkConnected(const QString& line); void checkFingerprint(const QString& line); + void checkTransmission(const QString& line); bool autoHide(); private: diff --git a/src/lib/client/Client.h b/src/lib/client/Client.h index 3a19d853..1e5d42a9 100644 --- a/src/lib/client/Client.h +++ b/src/lib/client/Client.h @@ -127,6 +127,9 @@ public: //! Return received file data String& getReceivedFileData() { return m_receivedFileData; } + //! Return drag file list + DragFileList getDragFileList() { return m_dragFileList; } + //@} // IScreen overrides diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index 935c9a31..e6bc1c98 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -864,6 +864,10 @@ ServerProxy::fileChunkReceived() if (result == kFinish) { m_events->addEvent(Event(m_events->forIScreen().fileRecieveCompleted(), m_client)); } + else if (result == kStart) { + String filename = m_client->getDragFileList().at(0).getFilename(); + LOG((CLOG_INFO "receiving file: %s", filename.c_str())); + } } void diff --git a/src/lib/synergy/DragInformation.cpp b/src/lib/synergy/DragInformation.cpp index 095afa25..aa94dd91 100644 --- a/src/lib/synergy/DragInformation.cpp +++ b/src/lib/synergy/DragInformation.cpp @@ -79,7 +79,7 @@ DragInformation::parseDragInfo(DragFileList& dragFileList, UInt32 fileNum, Strin dragFileList.size())); for (size_t i = 0; i < dragFileList.size(); ++i) { - LOG((CLOG_DEBUG2 "dragging file %i name: %s", + LOG((CLOG_DEBUG "dragging file %i name: %s", i + 1, dragFileList.at(i).getFilename().c_str())); } diff --git a/src/lib/synergy/FileChunk.cpp b/src/lib/synergy/FileChunk.cpp index 7a843cb4..7c83dc89 100644 --- a/src/lib/synergy/FileChunk.cpp +++ b/src/lib/synergy/FileChunk.cpp @@ -93,7 +93,7 @@ FileChunk::assemble(synergy::IStream* stream, String& dataReceived, size_t& expe LOG((CLOG_DEBUG2 "recv file data from client: file size=%s", content.c_str())); stopwatch.start(); } - return kNotFinish; + return kStart; case kDataChunk: dataReceived.append(content); diff --git a/src/lib/synergy/protocol_types.h b/src/lib/synergy/protocol_types.h index 0fc0c265..19895684 100644 --- a/src/lib/synergy/protocol_types.h +++ b/src/lib/synergy/protocol_types.h @@ -79,6 +79,7 @@ enum EDataTransfer { // Data received constants enum EDataReceived { + kStart, kNotFinish, kFinish, kError