Changeset - 766ff372c5cb
[Not reviewed]
recording
0 1 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-02-16 06:33:21
hy@ozderya.net
show warning if separator is empty
1 file changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/recordpanel.cpp
Show inline comments
 
@@ -105,39 +105,47 @@ void RecordPanel::onRecord(bool start)
 
    if (!start)
 
    {
 
        stopRecording();
 
        return;
 
    }
 

	
 
    bool canceled = false;
 
    if (ui->leSeparator->text().isEmpty())
 
    {
 
        QMessageBox::critical(this, "Error",
 
                              "Column separator cannot be empty! Please select a separator.");
 
        ui->leSeparator->setFocus(Qt::OtherFocusReason);
 
        canceled = true;
 
    }
 

	
 
    // check file name
 
    bool canceled = false;
 
    if (selectedFile.isEmpty() && !selectFile())
 
    if (!canceled && selectedFile.isEmpty() && !selectFile())
 
    {
 
        canceled = true;
 
    }
 

	
 
    if (!overwriteSelected && QFile::exists(selectedFile))
 
    if (!canceled && !overwriteSelected && QFile::exists(selectedFile))
 
    {
 
        if (ui->cbAutoIncrement->isChecked())
 
        {
 
            // TODO: should we increment even if user selected to replace?
 
            canceled = !incrementFileName();
 
        }
 
        else
 
        {
 
            canceled = !confirmOverwrite(selectedFile);
 
        }
 
    }
 
    overwriteSelected = false;
 

	
 
    if (canceled)
 
    {
 
        recordAction.setChecked(false);
 
    }
 
    else
 
    {
 
        overwriteSelected = false;
 
        startRecording();
 
    }
 
}
 

	
 
bool RecordPanel::incrementFileName(void)
 
{
0 comments (0 inline, 0 general)