diff --git a/hub/forms/DlgTransferFile.cpp b/hub/forms/DlgTransferFile.cpp index 35aaaad7..4091367f 100644 --- a/hub/forms/DlgTransferFile.cpp +++ b/hub/forms/DlgTransferFile.cpp @@ -31,7 +31,9 @@ void DlgTransferFile::Init() { ui->btn_upload_file->setToolTip("Upload selected files"); + ui->btn_upload_file->setIcon(QIcon(":/hub/upload-0.png")); ui->btn_download_file->setToolTip("Download selected files"); + ui->btn_download_file->setIcon(QIcon(":/hub/download.png")); ui->btn_refresh_local->setToolTip("Refresh current local directory"); ui->btn_refresh_remote->setToolTip("Refresh current remote directory"); @@ -206,6 +208,12 @@ void DlgTransferFile::set_buttons_enabled(bool enabled) { ui->btn_remote_back->setEnabled(enabled); } +void DlgTransferFile::set_remote_button_enabled(bool enabled){ + ui->btn_refresh_remote->setEnabled(enabled); + ui->btn_remote_back->setEnabled(enabled); + ui->btn_download_file->setEnabled(enabled); +} + void DlgTransferFile::transfer_finished(int tw_row, system_call_wrapper_error_t res, QStringList output) { static QIcon transfer_finished_icon(":/hub/GOOD"); static QIcon transfer_failed_icon(":/hub/BAD"); @@ -232,10 +240,12 @@ void DlgTransferFile::transfer_finished(int tw_row, system_call_wrapper_error_t else { file_to_transfer.setTransferFileStatus(FIlE_FAILED_TO_UPLOAD); if(res == SCWE_PERMISSION_DENIED) - twi_operation_status->setText("Permision denied"); + twi_operation_status->setToolTip("Permision denied"); else - twi_operation_status->setText("Failed to upload"); + twi_operation_status->setToolTip("Failed to upload"); twi_operation_status->setIcon(transfer_failed_icon); + if(file_to_transfer.fileInfo().fileName().contains("\\")) + twi_operation_status->setText("Invalid file name"); twi_operation_status->setToolTip( output.join(",") + " Error Code: " + CSystemCallWrapper::scwe_error_to_str(res)); @@ -255,8 +265,9 @@ void DlgTransferFile::transfer_finished(int tw_row, system_call_wrapper_error_t else twi_operation_status->setText("Failed to download"); twi_operation_status->setIcon(transfer_failed_icon); - twi_operation_status->setToolTip( - output.join(",") + + if(file_to_transfer.fileInfo().fileName().contains("\\")) + twi_operation_status->setText("Invalid file name"); + twi_operation_status->setToolTip(output.join(",") + " Error Code: " + CSystemCallWrapper::scwe_error_to_str(res)); } } @@ -596,7 +607,7 @@ void DlgTransferFile::local_back() { } void DlgTransferFile::remote_back() { - set_buttons_enabled(false); + set_remote_button_enabled(false); QStringList pwd = current_remote_dir.split("/"); QString new_dir = ""; // EXAMPLE: current_remote_dir= '/usr/bin/' @@ -607,7 +618,6 @@ void DlgTransferFile::remote_back() { new_dir.append("/"); current_remote_dir = new_dir; refresh_remote_file_system(); - set_buttons_enabled(true); } //////////////////////////////////////////////////////////////////////////////// @@ -703,7 +713,7 @@ void DlgTransferFile::refresh_remote_file_system() { << "Refresh remote file system" << current_remote_dir; - ui->btn_refresh_remote->setEnabled(false); + set_remote_button_enabled(false); ui->lbl_remote_files->setMovie(remote_movie); remote_movie->start(); @@ -731,7 +741,7 @@ void DlgTransferFile::output_from_remote_command(system_call_wrapper_error_t res add_file_remote(file_info); } remote_movie->stop(); - ui->btn_refresh_remote->setEnabled(true); + set_remote_button_enabled(true); if (res == SCWE_SUCCESS) { ui->lbl_remote_files->setStyleSheet(""); ui->lbl_remote_files->setText("Remote"); diff --git a/hub/forms/DlgTransferFile.h b/hub/forms/DlgTransferFile.h index 25ba321f..1611d2a2 100644 --- a/hub/forms/DlgTransferFile.h +++ b/hub/forms/DlgTransferFile.h @@ -415,6 +415,7 @@ class DlgTransferFile : public QDialog void file_was_dropped(const QString &file_path); void set_buttons_enabled(bool enabled); + void set_remote_button_enabled(bool enabled); void transfer_finished(int tw_row, system_call_wrapper_error_t res, QStringList output); void transfer_file(int tw_row); void start_transfer_files(); diff --git a/hub/forms/DlgTransferFile.ui b/hub/forms/DlgTransferFile.ui index d2ce4088..c45a633c 100644 --- a/hub/forms/DlgTransferFile.ui +++ b/hub/forms/DlgTransferFile.ui @@ -27,8 +27,8 @@ - - ../../resources/upload-0.png../../resources/upload-0.png + + :/hub/upload-0.png:/hub/upload-0.png @@ -41,7 +41,7 @@ - + :/hub/download.png:/hub/download.png diff --git a/hub/include/SystemCallWrapper.h b/hub/include/SystemCallWrapper.h index 8f9188f6..0e48ee51 100644 --- a/hub/include/SystemCallWrapper.h +++ b/hub/include/SystemCallWrapper.h @@ -39,7 +39,8 @@ enum system_call_wrapper_error_t { SCWE_WHICH_CALL_FAILED, SCWE_PROCESS_CRASHED, SCWE_LAST, - SCWE_PERMISSION_DENIED + SCWE_PERMISSION_DENIED, + SCWE_WRONG_FILE_NAME }; //////////////////////////////////////////////////////////////////////////// diff --git a/hub/src/SettingsManager.cpp b/hub/src/SettingsManager.cpp index 8ec35073..51c78eaf 100644 --- a/hub/src/SettingsManager.cpp +++ b/hub/src/SettingsManager.cpp @@ -105,7 +105,7 @@ static void qvar_to_map_string_qvariant(const QVariant& var, void* field) { static const int DEFAULT_REFRESH_TIMEOUT_SEC = 20; static QString settings_file_path() { - static const QString settings_file = "subutai_tray.ini"; + static const QString settings_file = "subutai_control.ini"; QStringList lst_config= QStandardPaths::standardLocations(QStandardPaths::ConfigLocation); @@ -148,7 +148,7 @@ static QString subutai_path() { } } - dir_path = dir_path + QDir::separator() + QString("tray"); + dir_path = dir_path + QDir::separator() + QString("control-center"); QDir dir_tray(dir_path); if (!dir_tray.exists()) { if (!dir_tray.mkdir(dir_path)) { @@ -157,7 +157,7 @@ static QString subutai_path() { } } - return QDir::homePath() +QDir::separator() + QString(".subutai") + QDir::separator() + QString("tray"); + return QDir::homePath() +QDir::separator() + QString(".subutai") + QDir::separator() + QString("control-center"); } //////////////////////////////////////////////////////////////////////////// diff --git a/hub/src/SystemCallWrapper.cpp b/hub/src/SystemCallWrapper.cpp index 84446395..f1811814 100644 --- a/hub/src/SystemCallWrapper.cpp +++ b/hub/src/SystemCallWrapper.cpp @@ -213,13 +213,11 @@ std::pair CSystemCallWrapper::upload_f << "-S" << CSettingsManager::Instance().ssh_path() << "-i" << ssh_info.second << file_path - << QString("%1@%2:%3").arg(remote_user, ip, destination); + << QString("%1@%2:\"%3\"").arg(remote_user, ip, destination); qDebug() << "ARGS=" << args; system_call_res_t res = ssystem_th(cmd, args, true, true, 97); if (res.res == SCWE_SUCCESS && res.exit_code != 0) { - // if(res.exit_code == 1) - // return std::make_pair(SCWE_PERMISSION_DENIED, res.out); return std::make_pair(SCWE_CREATE_PROCESS, res.out); } return std::make_pair(res.res, res.out); @@ -239,10 +237,9 @@ std::pair CSystemCallWrapper::download << QString("%1@%2:\"%3\"").arg(remote_user, ip, remote_file_path) << local_destination; qDebug() << "ARGS=" << args; + system_call_res_t res = ssystem_th(cmd, args, true, true, 97); if (res.res == SCWE_SUCCESS && res.exit_code != 0) { - //if(res.exit_code == 1) - // return std::make_pair(SCWE_PERMISSION_DENIED, res.out); return std::make_pair(SCWE_CREATE_PROCESS, res.out); } return std::make_pair(res.res, res.out); diff --git a/main.cpp b/main.cpp index d62b96b6..3c403887 100644 --- a/main.cpp +++ b/main.cpp @@ -78,7 +78,7 @@ main(int argc, char *argv[]) { if (is_first && !QApplication::arguments().contains(CCommons::RESTARTED_ARG)) { QMessageBox* msg_box = new QMessageBox(QMessageBox::Information, QObject::tr("Already running"), - QObject::tr("One instance of tray application is already running"), + QObject::tr("One instance of control center application is already running"), QMessageBox::Ok); QObject::connect(msg_box, &QMessageBox::finished, msg_box, &QMessageBox::deleteLater); msg_box->exec(); diff --git "a/neo\\matrix" "b/neo\\matrix" new file mode 100644 index 00000000..e69de29b