From 4a27c0b05c8abee88c270edf75adfb0bdae041f0 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 1 Jun 2015 11:57:43 -0700 Subject: [PATCH] Added drop file notification on client #4745 --- src/gui/res/Synergy.qrc | 1 + .../res/icons/16x16/synergy-transfering.png | Bin 0 -> 15542 bytes src/gui/src/MainWindow.cpp | 23 ++++++++++++++++-- src/gui/src/MainWindow.h | 2 ++ src/lib/client/Client.h | 3 +++ src/lib/client/ServerProxy.cpp | 4 +++ src/lib/synergy/DragInformation.cpp | 2 +- src/lib/synergy/FileChunk.cpp | 2 +- src/lib/synergy/protocol_types.h | 1 + 9 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/gui/res/icons/16x16/synergy-transfering.png 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 0000000000000000000000000000000000000000..72fefca0a73ffe601a1d549745e0c703e4091446 GIT binary patch literal 15542 zcmeI3e{>U77RQGcs028tZgGq3Vq>~!VM!)4`DKPQ0!^`HNi8Kvk<*pQ!oV67f7Q}K6P_g2=9$=RrF8c?pTVdZMX_CIC zPj=Tm`_G$mlF5Ddeea$5ymxQrpLx8p;=YNhDJqJhCYF~us^B?S`P?!Vei!`x1`ki; zLS;)M6g56i`HZ4AZJA6_)KOyg=xNrf zWf;zA;TW?zacJx+_{$ddc)2RayhJ)^6>Dl`ImFR)LqmhE!Jw1EKAN#wt+bw{Syl^Y zXd{h5nU89Nk-~V8!8i^O5yE0f7NwwCiOajCdbwDmQ4%GO#C-)q$wa|Of*qttNBI!V z==5|Zkw-{sLiJ&P?9w~}4g4Sgf^r1vn2fqmtt3m4T4{uoN%x3};hH#|$=n&QHxS5} zIwF^@f(Q~wGb$sl#t@*ZKt!q!3!roryp_UCcQ1?H)Zz?@qC;}T~;}WP+d}@E^_jM7*vo>x6$bQ)MBSX0S7MwJKT&Wt)A8D ztuDsI8CcH5KA5JDPeSBQ$s>9j)8r;CYjv>(&S>IHmY?bwPOp#0NSleqfOX^HW&Wn3 zq|Z%@;}JNo6b|sRT@3I(K!<`p8=V?Vo0;5AT#4kD!tk!rpO+IpthFTCDp_bxNViQKzMExGLp5k@8?AJEzxY2`fC#_pzr%lX_4A+M&)AFpPiv6cxfkPJ>-wc=_3s{~ivOF5F9etYjD)J!~wMIX=HyDM5dIY`%rn!vj8~z#}0| zccap!cxk#Dm8O)7gQ9F_6WNgAG?nrP8SmnY;IkaCn@uKz$ws5YsG?Gg0)MqbgzYw> zG!X_i=$Hm|WE3tPNtotH2;)nY_S6+C!1yS9rh|`@bnfCN3uRSKifWohQO%E0)IV;(^LdJ@*HhGAmQxhBk)raY zwuidsQB)RuS8I+d+UIX~mbv&zYq$P$mZAS$!*TEQUD;oJBm8yp*SA%^aq6qL>W(~r;?ze6{nz_H)VE*jEcw8;zVfU}^?;@|up_rUYwjmKeK$5A;$Lf- z-B=Mie0XEgc1Ks^wQi9dL^N~FV&V1bR`H|b&t46P{R`t3Lmi;h1yGtu-TXXDGOWMtHszjdgeVV_fI;O*UkRvct_20Z%(sCqn|Lj z+w|f~A7%AC^v5>y>Y}>b!VdKd{bR=s)U}+OzvY`JdJkWCbJXOneJ4+JzNeaywdT-) zGnOAccVqv$z0Yiz)K%46yQ$~O!2L6>>{;6K^F!Ak4ei 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