TimerPool fixoutManipulator
git-svn-id: svn://db.shs.com.ru/pip@88 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -17,6 +17,12 @@ Daemon::Remote::Remote(const PIString & n): PIThread() {
|
||||
}
|
||||
|
||||
|
||||
Daemon::Remote::~Remote() {
|
||||
ft.stop();
|
||||
waitForFinish(1000);
|
||||
}
|
||||
|
||||
|
||||
void Daemon::Remote::sendFiles(const PIString & dir, const PIStringList & fl) {
|
||||
_fl = fl;
|
||||
piForeach (PIString & s, _fl)
|
||||
@@ -35,6 +41,7 @@ void Daemon::Remote::run() {
|
||||
Daemon::TileFileProgress::TileFileProgress(): PIScreenTile() {
|
||||
size_policy = PIScreenTypes::Fixed;
|
||||
ft = 0;
|
||||
rec = false;
|
||||
setMargins(1, 1, 1, 1);
|
||||
spacing = 1;
|
||||
back_format.color_back = Yellow;
|
||||
@@ -73,7 +80,6 @@ void Daemon::TileFileProgress::sizeHint(int & w, int & h) const {
|
||||
|
||||
|
||||
void Daemon::TileFileProgress::drawEvent(PIScreenDrawer * d) {
|
||||
|
||||
if (ft) {
|
||||
label_file->content[0].first = ft->stateString() + " " + ft->curFile();
|
||||
if (!label_file->content[0].first.isEmpty())
|
||||
@@ -104,9 +110,10 @@ void Daemon::TileFileProgress::show(PIFileTransfer * f) {
|
||||
|
||||
void Daemon::TileFileProgress::close(bool ok) {
|
||||
ft = 0;
|
||||
::screen.setDialogTile(0);
|
||||
if (!ok)
|
||||
showInfo("Achtung! Alarm!! Error!!!");
|
||||
else
|
||||
::screen.setDialogTile(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,13 +315,21 @@ void Daemon::fmKeyEvent(PIKbdListener::KeyEvent key) {
|
||||
|
||||
|
||||
void Daemon::fmActionRequest(bool remote_tile, FileManager::Action type, PIVariant data) {
|
||||
Remote * r = 0;
|
||||
switch (type) {
|
||||
case FileManager::Copy:
|
||||
r = remotes.value(conn_name, 0);
|
||||
if (!r) return;
|
||||
if (remote_tile) {
|
||||
PIByteArray ba;
|
||||
ba << int(CopyFiles) << fm.selectedRemote();
|
||||
r->ft.setDirectory(fm.localDir());
|
||||
send(conn_name, ba);
|
||||
tile_file_progress->rec = true;
|
||||
tile_file_progress->show(&(r->ft));
|
||||
} else {
|
||||
Remote * r = remotes.value(conn_name, 0);
|
||||
if (!r) return;
|
||||
r->sendFiles(fm.localDir() + PIDir::separator, data.toStringList());
|
||||
tile_file_progress->rec = false;
|
||||
tile_file_progress->show(&(r->ft));
|
||||
}
|
||||
break;
|
||||
@@ -408,7 +423,17 @@ void Daemon::closeFileDialog(const PIString & name, bool ok) {
|
||||
piCout << "CLOSE" << tile_file_progress->conn_name << name << ok;
|
||||
if (tile_file_progress->conn_name != name) return;
|
||||
tile_file_progress->close(ok);
|
||||
if (ok) requestChDir(".");
|
||||
if (ok) {
|
||||
if (tile_file_progress->rec) {
|
||||
fm.remoteTile()->setFocus();
|
||||
fm.clearSelectionRemote();
|
||||
fm.updateLocalDir();
|
||||
} else {
|
||||
fm.localTile()->setFocus();
|
||||
fm.clearSelectionLocal();
|
||||
requestChDir(".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +482,16 @@ void Daemon::dataReceived(const PIString & from, const PIByteArray & data) {
|
||||
fm.remoteRestoreDir();
|
||||
}
|
||||
break;
|
||||
case CopyFiles:
|
||||
r = remotes.value(from);
|
||||
if (!r) return;
|
||||
{
|
||||
PIStringList files;
|
||||
ba >> files;
|
||||
//piCout << "send" << files << "from" << r->dir_my.absolutePath();
|
||||
r->sendFiles(r->dir_my.absolutePath() + PIDir::separator, files);
|
||||
}
|
||||
break;
|
||||
case FileTransfer:
|
||||
r = remotes.value(from);
|
||||
if (r) r->received(ba);
|
||||
|
||||
Reference in New Issue
Block a user