updated path for dialogs

This commit is contained in:
lostjared
2018-12-28 20:14:38 -08:00
parent b8f5f9d1f4
commit 24affa50b1
3 changed files with 10 additions and 22 deletions

View File

@@ -1043,7 +1043,7 @@ void AC_MainWindow::controls_Pause() {
} }
void AC_MainWindow::controls_SetImage() { 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 != "") { if(fileName != "") {
cv::Mat tblend_image = cv::imread(fileName.toStdString()); cv::Mat tblend_image = cv::imread(fileName.toStdString());
if(!tblend_image.empty()) { if(!tblend_image.empty()) {
@@ -1059,7 +1059,7 @@ void AC_MainWindow::controls_SetImage() {
} }
void AC_MainWindow::controls_SetKey() { 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 != "") { if(fileName != "") {
cv::Mat tblend_image = cv::imread(fileName.toStdString()); cv::Mat tblend_image = cv::imread(fileName.toStdString());
if(!tblend_image.empty()) { if(!tblend_image.empty()) {

View File

@@ -62,7 +62,7 @@ void CaptureCamera::btn_Select() {
QString def_path = ""; QString def_path = "";
#if defined(__linux__) #if defined(__linux__)
def_path = "/home"; def_path = "";
#elif defined(__APPLE__) #elif defined(__APPLE__)
def_path = "/Users"; def_path = "/Users";
#elif defined(_WIN32) #elif defined(_WIN32)
@@ -131,31 +131,14 @@ void CaptureVideo::setParent(AC_MainWindow *p) {
} }
void CaptureVideo::btn_SetSourceFile() { void CaptureVideo::btn_SetSourceFile() {
QString def_path = ""; 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)")); QString fileName = QFileDialog::getOpenFileName(this,tr("Open Video"), def_path, tr("Video Files (*.avi *.mov *.mp4 *.mkv)"));
if(fileName != "") if(fileName != "")
edit_src->setText(fileName); edit_src->setText(fileName);
} }
void CaptureVideo::btn_SetOutputDir() { void CaptureVideo::btn_SetOutputDir() {
QString def_path = ""; 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); QString dir = QFileDialog::getExistingDirectory(this, tr("Set Output Directory"),def_path,QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if(dir != "") if(dir != "")
edit_outdir->setText(dir); edit_outdir->setText(dir);

View File

@@ -72,7 +72,9 @@ void DefineWindow::clearFilterNames() {
} }
void DefineWindow::saveNames() { 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; std::fstream file;
file.open(fileName.toStdString(), std::ios::out); file.open(fileName.toStdString(), std::ios::out);
if(!file.is_open()) { if(!file.is_open()) {
@@ -89,10 +91,13 @@ void DefineWindow::saveNames() {
} }
void DefineWindow::loadNames() { 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); std::fstream file(fileName.toStdString(), std::ios::in);
if(!file.is_open()) { if(!file.is_open()) {
QMessageBox::information(this, tr("Could not open file"), tr("File could not be opened")); QMessageBox::information(this, tr("Could not open file"), tr("File could not be opened"));
return;
} }
clearFilterNames(); clearFilterNames();
while(!file.eof()) { while(!file.eof()) {