Ticket #11485 (new)

Opened 6 years ago

Last modified 5 years ago

Maintenance issues from SliceViewer changes

Reported by: Owen Arnold Owned by: Nick Draper
Priority: major Milestone: Release 3.5
Component: Framework Keywords: Maintenance
Cc: Blocked By: #11341
Blocking: Tester:

Description

1) SliceViewer.cpp is already too long. The code that applies icon switching should be refactored out into functions. Reading the function calls should make the behaviour a lot more readable than it currently is.

This is what it currently looks like in one place:

if (m_peaksPresenter->size()>0)  {
    icon.addFile(QString::fromStdString(g_iconPeakListOn),
                   QSize(), QIcon::Normal, QIcon::On);
    ui.btnPeakOverlay->setIcon(icon);
    ui.btnPeakOverlay->setChecked(true);
  }  else {

    icon.addFile(QString::fromStdString(g_iconPeakList),
                   QSize(), QIcon::Normal, QIcon::Off);
    ui.btnPeakOverlay->setIcon(icon);
    ui.btnPeakOverlay->setChecked(false);
  }

What it should look like is something of the form:

if (m_peaksPresenter->size()>0)  {
    selectPeakOverlayButton();
  }  else {
    unselectPeakOverlayButton();
  }

2) You have introduced a hard-coded magic number into SelectWorkspacesDialog.h. In the SliceViewer your are NOT using a QDialog in a polymorphic way. Therefore you can introduce new methods onto SelectWorkspacesDialog to indicate that a custom button is being used.

Change History

comment:1 Changed 5 years ago by Nick Draper

  • Milestone changed from Release 3.4 to Release 3.5

Moved to R3.5 at the R3.4 code freeze

comment:2 Changed 5 years ago by Nick Draper

  • Keywords Maintenance added

comment:3 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12324

Note: See TracTickets for help on using tickets.