Skip to content

Commit

Permalink
Fix for issue #380 and issue #416 - both in ld-analyse
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Inns committed Jan 25, 2020
1 parent 45f2eb0 commit 5aa6ee9
Show file tree
Hide file tree
Showing 5 changed files with 922 additions and 833 deletions.
26 changes: 19 additions & 7 deletions tools/ld-analyse/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ MainWindow::MainWindow(QString inputFilenameParam, QWidget *parent) :

// Was a filename specified on the command line?
if (!inputFilenameParam.isEmpty()) {
lastFilename = inputFilenameParam;
tbcSource.loadSource(inputFilenameParam);
} else {
lastFilename.clear();
}
}

Expand Down Expand Up @@ -158,6 +161,7 @@ void MainWindow::updateGuiLoaded()
ui->actionClosed_Captions->setEnabled(true);
if (tbcSource.getIsSourcePal()) ui->actionPAL_Chroma_decoder->setEnabled(true);
else ui->actionPAL_Chroma_decoder->setEnabled(false);
ui->actionReload_TBC->setEnabled(true);

// Set option button states
ui->videoPushButton->setText(tr("Source"));
Expand Down Expand Up @@ -238,6 +242,7 @@ void MainWindow::updateGuiUnloaded()
ui->actionSave_frame_as_PNG->setEnabled(false);
ui->actionClosed_Captions->setEnabled(false);
ui->actionPAL_Chroma_decoder->setEnabled(false);
ui->actionReload_TBC->setEnabled(false);

// Set option button states
ui->videoPushButton->setText(tr("Source"));
Expand Down Expand Up @@ -390,10 +395,20 @@ void MainWindow::on_actionOpen_TBC_file_triggered()

// Was a filename specified?
if (!inputFileName.isEmpty() && !inputFileName.isNull()) {
lastFilename = inputFileName;
loadTbcFile(inputFileName);
}
}

// Reload the current TBC selection from the GUI
void MainWindow::on_actionReload_TBC_triggered()
{
// Reload the current TBC file
if (!lastFilename.isEmpty() && !lastFilename.isNull()) {
loadTbcFile(lastFilename);
}
}

// Display the scan line oscilloscope view
void MainWindow::on_actionLine_scope_triggered()
{
Expand Down Expand Up @@ -550,18 +565,18 @@ void MainWindow::on_nextPushButton_clicked()
}
}

// Skip to end frame button has been clicked
// Skip to the next chapter (note: this button was repurposed from 'end frame')
void MainWindow::on_endFramePushButton_clicked()
{
currentFrameNumber = tbcSource.getNumberOfFrames();
currentFrameNumber = tbcSource.startOfNextChapter(currentFrameNumber);
ui->frameNumberSpinBox->setValue(currentFrameNumber);
ui->frameHorizontalSlider->setValue(currentFrameNumber);
}

// Skip to start frame button has been clicked
// Skip to the start of chapter (note: this button was repurposed from 'start frame')
void MainWindow::on_startFramePushButton_clicked()
{
currentFrameNumber = 1;
currentFrameNumber = tbcSource.startOfChapter(currentFrameNumber);
ui->frameNumberSpinBox->setValue(currentFrameNumber);
ui->frameHorizontalSlider->setValue(currentFrameNumber);
}
Expand Down Expand Up @@ -876,6 +891,3 @@ void MainWindow::on_finishedLoading()
busyDialog->hide();
this->setEnabled(true);
}



2 changes: 2 additions & 0 deletions tools/ld-analyse/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private slots:
// Menu bar handlers
void on_actionExit_triggered();
void on_actionOpen_TBC_file_triggered();
void on_actionReload_TBC_triggered();
void on_actionLine_scope_triggered();
void on_actionAbout_ld_analyse_triggered();
void on_actionVBI_triggered();
Expand Down Expand Up @@ -126,6 +127,7 @@ private slots:
qint32 currentFrameNumber;
qreal scaleFactor;
QPalette buttonPalette;
QString lastFilename;

// Update GUI methods
void updateGuiLoaded();
Expand Down
13 changes: 11 additions & 2 deletions tools/ld-analyse/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to start frame&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to start of chapter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -202,7 +202,7 @@
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to end frame&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to end of chapter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -435,6 +435,7 @@
<string>File</string>
</property>
<addaction name="actionOpen_TBC_file"/>
<addaction name="actionReload_TBC"/>
<addaction name="separator"/>
<addaction name="actionSave_frame_as_PNG"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -618,6 +619,14 @@
<string>Ctrl+U</string>
</property>
</action>
<action name="actionReload_TBC">
<property name="text">
<string>Reload TBC...</string>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
Expand Down
Loading

0 comments on commit 5aa6ee9

Please sign in to comment.