From 5efc2e5738ca410b252821d6f88584b2723394e7 Mon Sep 17 00:00:00 2001 From: Erkin Date: Mon, 5 Mar 2018 10:31:58 +0600 Subject: [PATCH 01/11] change to upload icon to *png #653 --- hub/forms/DlgTransferFile.ui | 20 ++++++++++++-------- resources/resources.qrc | 1 + resources/upload-0.png | Bin 0 -> 3132 bytes 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 resources/upload-0.png diff --git a/hub/forms/DlgTransferFile.ui b/hub/forms/DlgTransferFile.ui index 7adf1539..d2ce4088 100644 --- a/hub/forms/DlgTransferFile.ui +++ b/hub/forms/DlgTransferFile.ui @@ -27,8 +27,8 @@ - - :/hub/upload.ico:/hub/upload.ico + + ../../resources/upload-0.png../../resources/upload-0.png @@ -41,7 +41,7 @@ - + :/hub/download.png:/hub/download.png @@ -62,7 +62,7 @@ - + :/hub/back.png:/hub/back.png @@ -86,7 +86,7 @@ - + :/hub/refresh.png:/hub/refresh.png @@ -100,7 +100,7 @@ - + :/hub/refresh.png:/hub/refresh.png @@ -187,7 +187,7 @@ - + :/hub/back.png:/hub/back.png @@ -209,6 +209,10 @@
DlgTransferFile.h
- + + + + + diff --git a/resources/resources.qrc b/resources/resources.qrc index bac0fdcc..b59bc8e7 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -57,6 +57,7 @@ add_blue.png refreshing.gif logo.png + upload-0.png diff --git a/resources/upload-0.png b/resources/upload-0.png new file mode 100644 index 0000000000000000000000000000000000000000..4d27c36ff3bf03b28a3bef5a2f1dd48a96cce206 GIT binary patch literal 3132 zcma)8X;4#1*Y4aTB$36CC`2?EAjmFJSrma>5RgS7EIMpM0*Zp*fQXEUk{fVPK*lH_ zFitRRBFMhHfZq;ouX ztFF>o1prWWb9M3o0HaVbfQVHe!hYs>$CRa9@zzG9e@Z+I!k;J;Eq z^RF5yWZrK^mvaqs^8U5{*QB6Velt=e?|2m6{UmN+F#lzL=J;fTTrM9TsUH}u8+cRK z@E_Kz*R{i=WwRf;?>{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K9I!t?)|cvBsDz z(f4qE#c#pLUbOt)wd^<-SbucayB{j4-qd{Ze{8+iES!tSCB!7!e4BSKR>upb@1J;D zUKCOwpexkZ86Elec;}sYKYRVYoO?Mr+KZR$(c4+eF}U!U)P1=1pVRr5lV7~luVbsr z9_JY?{8deJjvyDgi35^Yt`v*aIPQk z>>qzHG(OzsKwP*2z*g3l?PjcPW-JT8t=nu^RyHh4GnS Date: Tue, 6 Mar 2018 19:41:50 +0600 Subject: [PATCH 02/11] #692 rename component names --- CHANGELOG | 4 ++++ SubutaiControlCenter.pro | 4 ++-- tray.rc => control-center.rc | 0 hub/src/RestWorker.cpp | 6 +++--- hub/src/updater/IUpdaterComponent.cpp | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) rename tray.rc => control-center.rc (100%) diff --git a/CHANGELOG b/CHANGELOG index 88c8d5d4..044396ac 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Change Log +## [6.7.1] 6/3/2018 +* Renaming +* Bug Fixes + ## [6.7.0] 2/26/2018 * New feature File Transfer System. * Fixed minor bugs. diff --git a/SubutaiControlCenter.pro b/SubutaiControlCenter.pro index 50e13ffd..d6b9fb1a 100644 --- a/SubutaiControlCenter.pro +++ b/SubutaiControlCenter.pro @@ -141,7 +141,7 @@ DEFINES += TRAY_VERSION=\\\"$$TRAY_VERSION\\\" GIT_BRANCH_STR = $$system(git rev-parse --abbrev-ref HEAD) DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH_STR\\\" -GBV=BT_DEV +GBV=BT_PROD equals(GIT_BRANCH_STR, "master") { GBV=BT_MASTER } @@ -192,7 +192,7 @@ win32: { DEFINES += CURRENT_OS=OS_WIN DEFINES += RT_OS_WINDOWS LIBS += -lws2_32 -L$$PWD/libssh2/lib/win32 -llibssh2 - RC_FILE = tray.rc + RC_FILE = control-center.rc # LIBS += -lpthread # QMAKE_LFLAGS += -static-libstdc++ -static-libgcc } diff --git a/tray.rc b/control-center.rc similarity index 100% rename from tray.rc rename to control-center.rc diff --git a/hub/src/RestWorker.cpp b/hub/src/RestWorker.cpp index 237f9492..0d0b57d0 100644 --- a/hub/src/RestWorker.cpp +++ b/hub/src/RestWorker.cpp @@ -230,7 +230,7 @@ void CRestWorker::update_my_peers() { connect(timer, &QTimer::timeout, [reply](){ CNotificationObserver::Instance()-> - Info("Connection timeout, can't connect to hub", DlgNotification::N_NO_ACTION); + Info("Connection timeout, can't connect to bazaar", DlgNotification::N_NO_ACTION); if (reply) reply->close(); }); @@ -273,7 +273,7 @@ void CRestWorker::update_environments() { connect(timer, &QTimer::timeout, [reply](){ CNotificationObserver::Instance()-> - Info("Connection timeout, can't connect to hub", DlgNotification::N_NO_ACTION); + Info("Connection timeout, can't connect to bazaar", DlgNotification::N_NO_ACTION); if (reply) reply->close(); }); @@ -305,7 +305,7 @@ void CRestWorker::update_balance() { connect(timer, &QTimer::timeout, [reply](){ CNotificationObserver::Instance()-> - Info("Connection timeout, can't connect to hub", DlgNotification::N_NO_ACTION); + Info("Connection timeout, can't connect to bazaar", DlgNotification::N_NO_ACTION); if (reply) reply->close(); }); diff --git a/hub/src/updater/IUpdaterComponent.cpp b/hub/src/updater/IUpdaterComponent.cpp index b8b397c8..6f9c9227 100644 --- a/hub/src/updater/IUpdaterComponent.cpp +++ b/hub/src/updater/IUpdaterComponent.cpp @@ -11,9 +11,9 @@ const QString IUpdaterComponent::P2P = "p2p"; const QString IUpdaterComponent::P2P = "p2p.exe"; #endif #ifndef RT_OS_WINDOWS -const QString IUpdaterComponent::TRAY = "SubutaiTray"; +const QString IUpdaterComponent::TRAY = "SubutaiControlCenter"; #else -const QString IUpdaterComponent::TRAY = "SubutaiTray.exe"; +const QString IUpdaterComponent::TRAY = "SubutaiControlCenter.exe"; #endif const QString IUpdaterComponent::RH = "resource_host"; @@ -23,7 +23,7 @@ const QString & IUpdaterComponent::component_id_to_user_view(const QString& id) { static std::map dct = { {P2P, "p2p"}, - {TRAY, "tray application"}, + {TRAY, "ControlCenter"}, {RH, "resource host"}, {RHMANAGEMENT, "resource host management"} }; From 22095e1aaa42ac600af8b8f953c84140b394a6ed Mon Sep 17 00:00:00 2001 From: Erkin Date: Tue, 6 Mar 2018 20:41:05 +0600 Subject: [PATCH 03/11] check button functions #683 --- hub/include/DlgEnvironment.h | 1 + hub/src/DlgEnvironment.cpp | 39 +++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/hub/include/DlgEnvironment.h b/hub/include/DlgEnvironment.h index 943c2c01..12fdfff3 100644 --- a/hub/include/DlgEnvironment.h +++ b/hub/include/DlgEnvironment.h @@ -33,6 +33,7 @@ class DlgEnvironment : public QDialog void desktop_selected(); void ssh_selected(); void select_all(bool checked); + void check_buttons(); signals: void ssh_to_container_sig(const CEnvironment*, const CHubContainer*); diff --git a/hub/src/DlgEnvironment.cpp b/hub/src/DlgEnvironment.cpp index 818fa17e..a3141852 100644 --- a/hub/src/DlgEnvironment.cpp +++ b/hub/src/DlgEnvironment.cpp @@ -150,6 +150,9 @@ void DlgEnvironment::addContainer(const CHubContainer *cont) { ui->cont_desktop_info->addWidget(cont_desktop_info); ui->cont_select->addWidget(cont_select); selected_conts[cont->id()] = cont_select; + connect(cont_select, &QCheckBox::stateChanged, [this](){ + this->check_buttons(); + }); } ///////////////////////////////////////////////////////////////////////// @@ -158,22 +161,17 @@ void DlgEnvironment::change_cont_status(const CHubContainer *cont, int status) { QCheckBox *cont_checkbox = selected_conts[cont->id()]; if (status == 0) { - cont_checkbox->setCheckable(true); cont_checkbox->setText(tr("READY")); cont_checkbox->setStyleSheet("QCheckBox {color : green;}"); } else if (status == 1) { - //cont_checkbox->setCheckable(false); - //cont_checkbox->setChecked(false); cont_checkbox->setText(tr("CONNECTING")); cont_checkbox->setStyleSheet("QCheckBox {color : blue;}"); } else if (status == 2){ - //cont_checkbox->setCheckable(false); - //cont_checkbox->setChecked(false); cont_checkbox->setText(tr("FAILED")); cont_checkbox->setStyleSheet("QCheckBox {color : red;}"); } @@ -209,8 +207,39 @@ void DlgEnvironment::check_environment_status() { change_cont_status(&cont, 2); } } + check_buttons(); } +//////////////////////////////////////////////////////////////////////////// +void DlgEnvironment::check_buttons() { + qDebug() + << "Checking which button I can press" << env.name(); + bool not_empty = false; + bool upload = true, ssh = true, desktop = true; + P2PController::P2P_CONNETION_STATUS + swarm_status = P2PController::Instance().is_swarm_connected(env); + bool connected_to_swarm = (env.healthy() & (swarm_status == P2PController::CONNECTION_SUCCESS)); + if(connected_to_swarm){ + for (CHubContainer cont : env.containers()) { + QCheckBox *current_check_box = selected_conts[cont.id()]; + if(current_check_box->checkState() == Qt::Checked){ + if(current_check_box->text() != "READY"){ + upload = ssh = desktop = false; + break; + } + if(!cont.is_desktop()) + desktop = false; + not_empty = true; + } + } + } + else{ + upload = ssh = desktop = false; + } + ui->btn_desktop_selected->setEnabled(desktop & not_empty); + ui->btn_upload_selected->setEnabled(upload & not_empty); + ui->btn_ssh_selected->setEnabled(ssh & not_empty); +} //////////////////////////////////////////////////////////////////////////// DlgEnvironment::~DlgEnvironment() { From 4961f990f44284f9ab94a6b6e7c3c924a38a8a19 Mon Sep 17 00:00:00 2001 From: Erkin Date: Tue, 6 Mar 2018 20:48:15 +0600 Subject: [PATCH 04/11] refresh info each 691 --- hub/include/DlgEnvironment.h | 2 +- hub/src/DlgEnvironment.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hub/include/DlgEnvironment.h b/hub/include/DlgEnvironment.h index 12fdfff3..f6754b06 100644 --- a/hub/include/DlgEnvironment.h +++ b/hub/include/DlgEnvironment.h @@ -22,7 +22,7 @@ class DlgEnvironment : public QDialog Ui::DlgEnvironment *ui; CEnvironment env; std::map selected_conts; - std::map dekstops_info; + std::map desktops_info; void addContainer(const CHubContainer*cont); void check_container_status(const CHubContainer *cont); diff --git a/hub/src/DlgEnvironment.cpp b/hub/src/DlgEnvironment.cpp index a3141852..ac56a776 100644 --- a/hub/src/DlgEnvironment.cpp +++ b/hub/src/DlgEnvironment.cpp @@ -150,6 +150,7 @@ void DlgEnvironment::addContainer(const CHubContainer *cont) { ui->cont_desktop_info->addWidget(cont_desktop_info); ui->cont_select->addWidget(cont_select); selected_conts[cont->id()] = cont_select; + desktops_info[cont->id()] = cont_desktop_info; connect(cont_select, &QCheckBox::stateChanged, [this](){ this->check_buttons(); }); @@ -183,6 +184,7 @@ void DlgEnvironment::check_container_status(const CHubContainer *cont) { qDebug() << "Checking the status of container: " << cont->name() << " in " << env.name(); P2PController::P2P_CONNETION_STATUS cont_status = P2PController::Instance().is_ready(env, *cont); + desktops_info[cont->id()]->setText(QString(cont->is_desktop() ? cont->desk_env().isEmpty() ? "MATE" : cont->desk_env() : "No Desktop")); change_cont_status(cont, cont_status != P2PController::CONNECTION_SUCCESS); } From 1c2a8c0172c01d47dab890397311c88aafb15ae4 Mon Sep 17 00:00:00 2001 From: Erkin Date: Tue, 6 Mar 2018 20:48:44 +0600 Subject: [PATCH 05/11] bt_dev --- SubutaiControlCenter.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubutaiControlCenter.pro b/SubutaiControlCenter.pro index d6b9fb1a..d48eb21e 100644 --- a/SubutaiControlCenter.pro +++ b/SubutaiControlCenter.pro @@ -141,7 +141,7 @@ DEFINES += TRAY_VERSION=\\\"$$TRAY_VERSION\\\" GIT_BRANCH_STR = $$system(git rev-parse --abbrev-ref HEAD) DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH_STR\\\" -GBV=BT_PROD +GBV=BT_dev equals(GIT_BRANCH_STR, "master") { GBV=BT_MASTER } From 91eb3d4a27166d8c4d5b68a88be685aaedb4c146 Mon Sep 17 00:00:00 2001 From: Erkin Date: Tue, 6 Mar 2018 20:49:47 +0600 Subject: [PATCH 06/11] correct branch --- SubutaiControlCenter.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubutaiControlCenter.pro b/SubutaiControlCenter.pro index d48eb21e..6973b472 100644 --- a/SubutaiControlCenter.pro +++ b/SubutaiControlCenter.pro @@ -141,7 +141,7 @@ DEFINES += TRAY_VERSION=\\\"$$TRAY_VERSION\\\" GIT_BRANCH_STR = $$system(git rev-parse --abbrev-ref HEAD) DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH_STR\\\" -GBV=BT_dev +GBV=BT_DEV equals(GIT_BRANCH_STR, "master") { GBV=BT_MASTER } From 8e84cf30ff16b87d469f1a63eaf93a0fa011922f Mon Sep 17 00:00:00 2001 From: Erkin Date: Tue, 6 Mar 2018 20:54:16 +0600 Subject: [PATCH 07/11] version 6.7.2 --- CHANGELOG | 4 ++++ version | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 044396ac..52c8a438 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Change Log +## [6.7.2] 7/3/2018 +* Renaming files +* Environment bug fixed + ## [6.7.1] 6/3/2018 * Renaming * Bug Fixes diff --git a/version b/version index 06a76599..2dd517aa 100644 --- a/version +++ b/version @@ -1 +1 @@ -6.7.1 +6.7.2 From a5ddd1c98b06dee99adb319eadbed6681247de99 Mon Sep 17 00:00:00 2001 From: Erkin Matkaziev Date: Tue, 6 Mar 2018 21:06:34 +0600 Subject: [PATCH 08/11] Update CHANGELOG --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 52c8a438..40e9a6df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,7 @@ ## [6.7.2] 7/3/2018 * Renaming files -* Environment bug fixed +* Several environment bugs fixed ## [6.7.1] 6/3/2018 * Renaming From 4d2407f9fd3361a7035ffcaec113994aefc398f6 Mon Sep 17 00:00:00 2001 From: Erkin Date: Wed, 7 Mar 2018 14:45:10 +0600 Subject: [PATCH 09/11] error handling #695 and handling some critical sections --- SubutaiControlCenter.pro | 2 +- hub/forms/DlgTransferFile.cpp | 26 ++++++++++++++++++-------- hub/forms/DlgTransferFile.h | 1 + hub/forms/DlgTransferFile.ui | 6 +++--- hub/include/SystemCallWrapper.h | 3 ++- hub/src/SystemCallWrapper.cpp | 7 ++----- "neo\\matrix" | 0 7 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 "neo\\matrix" diff --git a/SubutaiControlCenter.pro b/SubutaiControlCenter.pro index 6973b472..d6b9fb1a 100644 --- a/SubutaiControlCenter.pro +++ b/SubutaiControlCenter.pro @@ -141,7 +141,7 @@ DEFINES += TRAY_VERSION=\\\"$$TRAY_VERSION\\\" GIT_BRANCH_STR = $$system(git rev-parse --abbrev-ref HEAD) DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH_STR\\\" -GBV=BT_DEV +GBV=BT_PROD equals(GIT_BRANCH_STR, "master") { GBV=BT_MASTER } 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/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/neo\\matrix" "b/neo\\matrix" new file mode 100644 index 00000000..e69de29b From f07258bf4c5b70f1dcb9d1013e57b8811c6c2ed6 Mon Sep 17 00:00:00 2001 From: Erkin Date: Wed, 7 Mar 2018 15:49:56 +0600 Subject: [PATCH 10/11] rename config file and logs storage --- hub/src/SettingsManager.cpp | 6 +++--- main.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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(); From c4eb402a80cf7b07d2c9007cefd677e56916a1e1 Mon Sep 17 00:00:00 2001 From: Erkin Date: Wed, 7 Mar 2018 15:53:57 +0600 Subject: [PATCH 11/11] DEV branch as default --- SubutaiControlCenter.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubutaiControlCenter.pro b/SubutaiControlCenter.pro index d6b9fb1a..6973b472 100644 --- a/SubutaiControlCenter.pro +++ b/SubutaiControlCenter.pro @@ -141,7 +141,7 @@ DEFINES += TRAY_VERSION=\\\"$$TRAY_VERSION\\\" GIT_BRANCH_STR = $$system(git rev-parse --abbrev-ref HEAD) DEFINES += GIT_BRANCH=\\\"$$GIT_BRANCH_STR\\\" -GBV=BT_PROD +GBV=BT_DEV equals(GIT_BRANCH_STR, "master") { GBV=BT_MASTER }