Monitoring log to show notification and made icon change while transfering $4745
This commit is contained in:
parent
5cbcd74028
commit
d1ca021002
|
@ -71,7 +71,8 @@ static const char* synergyIconFiles[] =
|
||||||
{
|
{
|
||||||
":/res/icons/16x16/synergy-disconnected.png",
|
":/res/icons/16x16/synergy-disconnected.png",
|
||||||
":/res/icons/16x16/synergy-disconnected.png",
|
":/res/icons/16x16/synergy-disconnected.png",
|
||||||
":/res/icons/16x16/synergy-connected.png"
|
":/res/icons/16x16/synergy-connected.png",
|
||||||
|
":/res/icons/16x16/synergy-transfering.png"
|
||||||
};
|
};
|
||||||
|
|
||||||
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
|
MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
|
||||||
|
@ -466,13 +467,22 @@ void MainWindow::checkFingerprint(const QString& line)
|
||||||
|
|
||||||
void MainWindow::checkTransmission(const QString& line)
|
void MainWindow::checkTransmission(const QString& line)
|
||||||
{
|
{
|
||||||
if (line.contains("receiving file"))
|
if (line.contains("File Transmission")) {
|
||||||
{
|
if (line.contains("Started")) {
|
||||||
int p = line.lastIndexOf(':');
|
setSynergyState(synergyTransfering);
|
||||||
if (p > 0) {
|
}
|
||||||
m_pTrayIcon->showMessage(
|
else if (line.contains("Failed") ||
|
||||||
"Data Transmission",
|
line.contains("Complete")) {
|
||||||
"Receiving file: " + line.mid(p + 2));
|
setSynergyState(synergyConnected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTIFY: Title: Detail
|
||||||
|
int p1 = line.indexOf(':');
|
||||||
|
if (p1 > 0) {
|
||||||
|
int p2 = line.indexOf(':', p1 + 1);
|
||||||
|
if (p2 > 0) {
|
||||||
|
m_pTrayIcon->showMessage(line.mid(p1 + 2, p2 - p1 - 2), line.mid(p2 + 2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -837,6 +847,8 @@ void MainWindow::setSynergyState(qSynergyState state)
|
||||||
m_pLabelPadlock->hide();
|
m_pLabelPadlock->hide();
|
||||||
setStatus(tr("Synergy is not running."));
|
setStatus(tr("Synergy is not running."));
|
||||||
break;
|
break;
|
||||||
|
case synergyTransfering:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIcon(state);
|
setIcon(state);
|
||||||
|
|
|
@ -866,6 +866,7 @@ ServerProxy::fileChunkReceived()
|
||||||
}
|
}
|
||||||
else if (result == kStart) {
|
else if (result == kStart) {
|
||||||
String filename = m_client->getDragFileList().at(0).getFilename();
|
String filename = m_client->getDragFileList().at(0).getFilename();
|
||||||
|
LOG((CLOG_NOTIFY "File Transmission Started: Start receiving %s", filename.c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,15 +38,18 @@ DropHelper::writeToDir(const String& destination, DragFileList& fileList, String
|
||||||
file.open(dropTarget.c_str(), std::ios::out | std::ios::binary);
|
file.open(dropTarget.c_str(), std::ios::out | std::ios::binary);
|
||||||
if (!file.is_open()) {
|
if (!file.is_open()) {
|
||||||
LOG((CLOG_ERR "drop file failed: can not open %s", dropTarget.c_str()));
|
LOG((CLOG_ERR "drop file failed: can not open %s", dropTarget.c_str()));
|
||||||
|
LOG((CLOG_NOTIFY "File Transmission Failed: Can not open %s", dropTarget.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
file.write(data.c_str(), data.size());
|
file.write(data.c_str(), data.size());
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
LOG((CLOG_NOTIFY "File Transmission Complete: %s is saved to %s", fileList.at(0).getFilename(), destination.c_str()));
|
||||||
|
|
||||||
fileList.clear();
|
fileList.clear();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG((CLOG_ERR "drop file failed: drop target is empty"));
|
LOG((CLOG_ERR "drop file failed: drop target is empty"));
|
||||||
|
LOG((CLOG_NOTIFY "File Transmission Failed: Drop target is empty"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue