diff --git a/capture_service/constants.h b/capture_service/constants.h index acce7e06a..0a07ae945 100644 --- a/capture_service/constants.h +++ b/capture_service/constants.h @@ -41,7 +41,7 @@ inline constexpr char kUnixAbstractPath[] = "dive_abstract"; inline constexpr char kEnableReplayPm4DumpPropertyName[] = "debug.dive.replay.capture_pm4"; inline constexpr char kReplayPm4DumpFileNamePropertyName[] = "debug.dive.replay.capture_pm4_file_name"; -inline constexpr char kDefaultCaptureFolderName[] = "gfxr_capture"; +inline constexpr char kDefaultCaptureFolderName[] = "dive_capture_folder"; inline constexpr char kDefaultReplayFolderName[] = "gfxr_replay_downloads"; inline constexpr char kProfilingPluginFolderName[] = "dive_profiling_plugin"; inline constexpr char kProfilingPluginName[] = "dive_drawcall_metrics"; diff --git a/ui/capture_worker.cpp b/ui/capture_worker.cpp index a2c5c3c6a..d97ebd66b 100644 --- a/ui/capture_worker.cpp +++ b/ui/capture_worker.cpp @@ -108,9 +108,8 @@ void CaptureWorker::run() emit ErrorMessage(QString::fromStdString(err_msg)); return; } - std::string download_path = "."; std::filesystem::path p(*capture_file_path); - std::filesystem::path target_download_path(download_path); + std::filesystem::path target_download_path(m_target_capture_dir); target_download_path /= p.filename(); qDebug() << "Begin to download the capture file to " << target_download_path.generic_string().c_str(); diff --git a/ui/trace_window.cpp b/ui/trace_window.cpp index 856e5715b..52f5e91f0 100644 --- a/ui/trace_window.cpp +++ b/ui/trace_window.cpp @@ -82,7 +82,7 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) : m_app_type_label = new QLabel(tr("Application Type:")); m_gfxr_capture_file_on_device_directory_label = new QLabel( tr("On Device GFXR Capture File Directory Name:")); - m_gfxr_capture_file_local_directory_label = new QLabel(tr("Local GFXR Capture Save Location:")); + QLabel *capture_file_local_directory_label = new QLabel(tr("Local Capture Save Location:")); m_dev_model = new QStandardItemModel(); m_pkg_model = new QStandardItemModel(); @@ -209,16 +209,12 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) : m_gfxr_capture_file_on_device_directory_label->hide(); m_gfxr_capture_file_directory_input_box->hide(); - m_gfxr_capture_file_local_directory_layout = new QHBoxLayout(); - m_gfxr_capture_file_local_directory_input_box = new QLineEdit(); - m_gfxr_capture_file_local_directory_input_box->setPlaceholderText( + QHBoxLayout *capture_file_local_directory_layout = new QHBoxLayout(); + m_capture_file_local_directory_input_box = new QLineEdit(); + m_capture_file_local_directory_input_box->setPlaceholderText( "Input the location to save the directory to"); - m_gfxr_capture_file_local_directory_layout->addWidget( - m_gfxr_capture_file_local_directory_label); - m_gfxr_capture_file_local_directory_layout->addWidget( - m_gfxr_capture_file_local_directory_input_box); - m_gfxr_capture_file_local_directory_label->hide(); - m_gfxr_capture_file_local_directory_input_box->hide(); + capture_file_local_directory_layout->addWidget(capture_file_local_directory_label); + capture_file_local_directory_layout->addWidget(m_capture_file_local_directory_input_box); m_button_layout->addWidget(m_run_button); m_button_layout->addWidget(m_capture_button); @@ -231,7 +227,7 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) : m_main_layout->addLayout(m_capture_warning_layout); m_main_layout->addLayout(m_pkg_layout); m_main_layout->addLayout(m_gfxr_capture_file_directory_layout); - m_main_layout->addLayout(m_gfxr_capture_file_local_directory_layout); + m_main_layout->addLayout(capture_file_local_directory_layout); m_main_layout->addLayout(m_args_layout); m_main_layout->addLayout(m_type_layout); @@ -714,6 +710,20 @@ void TraceDialog::OnTraceClicked() progress_bar->setAutoClose(true); progress_bar->setMinimumDuration(0); CaptureWorker *workerThread = new CaptureWorker(progress_bar); + + if (m_capture_file_local_directory_input_box->text() == "") + { +#if defined(__APPLE__) + m_capture_file_local_directory_input_box->setText( + QDir::homePath() + "/" + QString::fromUtf8(Dive::kDefaultCaptureFolderName)); +#else + m_capture_file_local_directory_input_box->setText( + "./" + QString::fromUtf8(Dive::kDefaultCaptureFolderName)); +#endif + } + + workerThread->SetTargetCaptureDir( + m_capture_file_local_directory_input_box->text().toStdString()); connect(workerThread, &CaptureWorker::CaptureAvailable, this, &TraceDialog::OnTraceAvailable); connect(workerThread, &CaptureWorker::finished, workerThread, &QObject::deleteLater); connect(workerThread, &CaptureWorker::ErrorMessage, this, &TraceDialog::ShowErrorMessage); @@ -903,13 +913,13 @@ void TraceDialog::RetrieveGfxrCapture() return; } - if (m_gfxr_capture_file_local_directory_input_box->text() == "") + if (m_capture_file_local_directory_input_box->text() == "") { #if defined(__APPLE__) - m_gfxr_capture_file_local_directory_input_box->setText( + m_capture_file_local_directory_input_box->setText( QDir::homePath() + "/" + QString::fromUtf8(Dive::kDefaultCaptureFolderName)); #else - m_gfxr_capture_file_local_directory_input_box->setText( + m_capture_file_local_directory_input_box->setText( "./" + QString::fromUtf8(Dive::kDefaultCaptureFolderName)); #endif } @@ -935,7 +945,7 @@ void TraceDialog::RetrieveGfxrCapture() workerThread->SetGfxrSourceCaptureDir(on_device_capture_file_directory); workerThread->SetTargetCaptureDir( - m_gfxr_capture_file_local_directory_input_box->text().toStdString()); + m_capture_file_local_directory_input_box->text().toStdString()); connect(workerThread, &GfxrCaptureWorker::CaptureAvailable, diff --git a/ui/trace_window.h b/ui/trace_window.h index 41d06f64c..3507b0414 100644 --- a/ui/trace_window.h +++ b/ui/trace_window.h @@ -162,9 +162,7 @@ private slots: QLabel *m_gfxr_capture_file_on_device_directory_label; QLineEdit *m_gfxr_capture_file_directory_input_box; - QHBoxLayout *m_gfxr_capture_file_local_directory_layout; - QLabel *m_gfxr_capture_file_local_directory_label; - QLineEdit *m_gfxr_capture_file_local_directory_input_box; + QLineEdit *m_capture_file_local_directory_input_box; QVBoxLayout *m_main_layout; std::vector m_devices;