Added drop file notification on client #4745

This commit is contained in:
Jerry (Xinyu Hou) 2015-06-01 11:57:43 -07:00
parent d7063a87c8
commit 4a27c0b05c
9 changed files with 34 additions and 4 deletions

View File

@ -53,5 +53,6 @@
<file>icons/16x16/money.png</file>
<file>image/spinning-wheel.gif</file>
<file>icons/16x16/padlock.png</file>
<file>icons/16x16/synergy-transfering.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -79,6 +79,7 @@ enum EDataTransfer {
// Data received constants
enum EDataReceived {
kStart,
kNotFinish,
kFinish,
kError