diff --git a/src/main_window.cpp b/src/main_window.cpp index a9ae079..2a5ac35 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -1043,7 +1043,7 @@ void AC_MainWindow::controls_Pause() { } void AC_MainWindow::controls_SetImage() { - QString fileName = QFileDialog::getOpenFileName(this,tr("Open Image"), "/home", tr("Image Files (*.png *.jpg)")); + QString fileName = QFileDialog::getOpenFileName(this,tr("Open Image"), "", tr("Image Files (*.png *.jpg)")); if(fileName != "") { cv::Mat tblend_image = cv::imread(fileName.toStdString()); if(!tblend_image.empty()) { @@ -1059,7 +1059,7 @@ void AC_MainWindow::controls_SetImage() { } void AC_MainWindow::controls_SetKey() { - QString fileName = QFileDialog::getOpenFileName(this,tr("Open Color Key Image"), "/home", tr("Image Files (*.png)")); + QString fileName = QFileDialog::getOpenFileName(this,tr("Open Color Key Image"), "", tr("Image Files (*.png)")); if(fileName != "") { cv::Mat tblend_image = cv::imread(fileName.toStdString()); if(!tblend_image.empty()) { diff --git a/src/new_dialog.cpp b/src/new_dialog.cpp index eae2116..78124a1 100644 --- a/src/new_dialog.cpp +++ b/src/new_dialog.cpp @@ -62,7 +62,7 @@ void CaptureCamera::btn_Select() { QString def_path = ""; #if defined(__linux__) - def_path = "/home"; + def_path = ""; #elif defined(__APPLE__) def_path = "/Users"; #elif defined(_WIN32) @@ -131,31 +131,14 @@ void CaptureVideo::setParent(AC_MainWindow *p) { } void CaptureVideo::btn_SetSourceFile() { - QString def_path = ""; -#if defined(__linux__) - def_path = "/home"; -#elif defined(__APPLE__) - def_path = "/Users"; -#elif defined(_WIN32) - def_path = "C:\\"; -#endif QString fileName = QFileDialog::getOpenFileName(this,tr("Open Video"), def_path, tr("Video Files (*.avi *.mov *.mp4 *.mkv)")); if(fileName != "") edit_src->setText(fileName); } void CaptureVideo::btn_SetOutputDir() { - QString def_path = ""; -#if defined(__linux__) - def_path = "/home"; -#elif defined(__APPLE__) - def_path = "/Users"; -#elif defined(_WIN32) - def_path = "C:\\"; -#endif - QString dir = QFileDialog::getExistingDirectory(this, tr("Set Output Directory"),def_path,QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(dir != "") edit_outdir->setText(dir); diff --git a/src/user_define.cpp b/src/user_define.cpp index 8a5e6f7..463760f 100644 --- a/src/user_define.cpp +++ b/src/user_define.cpp @@ -72,7 +72,9 @@ void DefineWindow::clearFilterNames() { } void DefineWindow::saveNames() { - QString fileName = QFileDialog::getSaveFileName(this,tr("Save List"), "/home", tr("Acid Cam List (*.acl)")); + QString fileName = QFileDialog::getSaveFileName(this,tr("Save List"), "", tr("Acid Cam List (*.acl)")); + if(fileName.length() <= 0) + return; std::fstream file; file.open(fileName.toStdString(), std::ios::out); if(!file.is_open()) { @@ -89,10 +91,13 @@ void DefineWindow::saveNames() { } void DefineWindow::loadNames() { - QString fileName = QFileDialog::getOpenFileName(this,tr("Open List"), "/home", tr("Acid Cam List (*.acl)")); + QString fileName = QFileDialog::getOpenFileName(this,tr("Open List"), "", tr("Acid Cam List (*.acl)")); + if(fileName.length() <= 0) + return; std::fstream file(fileName.toStdString(), std::ios::in); if(!file.is_open()) { QMessageBox::information(this, tr("Could not open file"), tr("File could not be opened")); + return; } clearFilterNames(); while(!file.eof()) {