mirror of
https://github.com/FAUSheppy/speech-server-client-qt
synced 2025-12-06 08:51:35 +01:00
implement samedir transcript saving
This commit is contained in:
@@ -175,7 +175,17 @@ void MainWindow::showNotification(QString str){
|
|||||||
|
|
||||||
void MainWindow::openContainingDir(){
|
void MainWindow::openContainingDir(){
|
||||||
|
|
||||||
QString filePath = mySettings->value(SETTING_SAVE_DIR).toString();
|
QString settingPath = mySettings->value(SETTING_SAVE_DIR).toString();
|
||||||
|
QString filePath;
|
||||||
|
if(QString::compare(settingPath, ".") == 0){
|
||||||
|
QPushButton* senderButton = static_cast<QPushButton*>(sender());
|
||||||
|
filePath = senderButton->toolTip();
|
||||||
|
QFileInfo* fi = new QFileInfo(filePath);
|
||||||
|
QDir dirInfo = fi->absoluteDir();
|
||||||
|
filePath = dirInfo.absolutePath();
|
||||||
|
}else{
|
||||||
|
filePath = settingPath;
|
||||||
|
}
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
|
||||||
/* OS specific explorer call */
|
/* OS specific explorer call */
|
||||||
@@ -259,6 +269,13 @@ void MainWindow::saveTranscript(QNetworkReply* reply){
|
|||||||
|
|
||||||
/* save return data */
|
/* save return data */
|
||||||
QString fullpath = QDir(mySettings->value(SETTING_SAVE_DIR).toString()).filePath(targetName);
|
QString fullpath = QDir(mySettings->value(SETTING_SAVE_DIR).toString()).filePath(targetName);
|
||||||
|
QString settingPath = mySettings->value(SETTING_SAVE_DIR).toString();
|
||||||
|
if(QString::compare(settingPath, ".") == 0){
|
||||||
|
fullpath = tw->item(rowId, FILENAME_COL)->text() + ".txt";
|
||||||
|
}else{
|
||||||
|
/* do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
QFile file(fullpath);
|
QFile file(fullpath);
|
||||||
if (!file.open(QIODevice::WriteOnly)) {
|
if (!file.open(QIODevice::WriteOnly)) {
|
||||||
QMessageBox::information(this, tr("Unable to open file"), file.errorString());
|
QMessageBox::information(this, tr("Unable to open file"), file.errorString());
|
||||||
@@ -316,6 +333,7 @@ void MainWindow::addTrackingToList(QNetworkReply* reply){
|
|||||||
auto *openDirCellContent = new QWidget();
|
auto *openDirCellContent = new QWidget();
|
||||||
openDirLayout->addWidget(dirButton);
|
openDirLayout->addWidget(dirButton);
|
||||||
dirButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
dirButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
dirButton->setToolTip(filename);
|
||||||
openDirLayout->setContentsMargins(0,0,0,0);
|
openDirLayout->setContentsMargins(0,0,0,0);
|
||||||
openDirCellContent->setLayout(openDirLayout);
|
openDirCellContent->setLayout(openDirLayout);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user