Skip to content

Commit

Permalink
Translations work in new Create classes
Browse files Browse the repository at this point in the history
  • Loading branch information
markummitchell-tu committed Sep 17, 2018
1 parent 1caff8a commit 13c8218
Show file tree
Hide file tree
Showing 34 changed files with 41,845 additions and 42,534 deletions.
6 changes: 4 additions & 2 deletions src/Create/CreateActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create actions for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create actions for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateActions : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateActions();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateCentralWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to the central QWidget for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to the central QWidget for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateCentralWidget : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateCentralWidget ();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateCommandStackShadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create CmdStackShadow for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create CmdStackShadow for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateCommandStackShadow : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateCommandStackShadow ();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateDockableWidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create QDockWidget items for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create QDockWidget items for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateDockableWidgets : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateDockableWidgets();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateFacade.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Facade class that wraps around all of the create classes for MainWindow. This is derived from QObject
/// so the tr function can be accessed more easily
/// Facade class that wraps around all of the create classes for MainWindow. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateFacade : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateFacade();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateHelpWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create help window for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create help window for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateHelpWindow : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateHelpWindow();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateIcons.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create icons for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create icons for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateIcons : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateIcons();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateLoadImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create LoadImageFromUrl for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create LoadImageFromUrl for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateLoadImage : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateLoadImage();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateMenus.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create menus for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create menus for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateMenus : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateMenus();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create network for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create network for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateNetwork : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateNetwork();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create QGraphicsScene for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create QGraphicsScene for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateScene : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateScene ();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateSettingsDialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create settings dialogs for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create settings dialogs for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateSettingsDialogs : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateSettingsDialogs();
Expand Down
5 changes: 4 additions & 1 deletion src/Create/CreateStateContexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
class MainWindow;

/// Class to create state contexts, which wrap state machine design patterns, for MainWindow class.
/// This is derived from QObject so the tr function can be accessed more easily
/// We derive from QObject and
/// use Q_OBJECT so translations work
class CreateStateContexts : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateStateContexts();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateStatusBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create status bar for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create status bar for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateStatusBar : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateStatusBar();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateToolBars.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create toolbars for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create toolbars for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateToolBars : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateToolBars();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateTutorial.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to TutorialDlg for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to TutorialDlg for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateTutorial : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateTutorial();
Expand Down
6 changes: 4 additions & 2 deletions src/Create/CreateZoomMaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

class MainWindow;

/// Class to create zoom factor maps for MainWindow class. This is derived from QObject
/// so the tr function can be accessed more easily
/// Class to create zoom factor maps for MainWindow class. We derive from QObject and
/// use Q_OBJECT so translations work
class CreateZoomMaps : public QObject
{
Q_OBJECT

public:
/// Single constructor.
CreateZoomMaps();
Expand Down
12 changes: 1 addition & 11 deletions src/Transformation/Transformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,15 @@ void Transformation::transformScreenToRawGraph (const QPointF &coordScreen,
coordGraph);
}

bool Transformation::update (bool fileIsLoaded,
void Transformation::update (bool fileIsLoaded,
const CmdMediator &cmdMediator,
const MainWindowModel &modelMainWindow)
{
LOG4CPP_DEBUG_S ((*mainCat)) << "Transformation::update";

bool changed = false;

if (!fileIsLoaded) {

bool before = m_transformIsDefined;
m_transformIsDefined = false;
changed = (before != m_transformIsDefined);

} else {

Expand All @@ -489,21 +485,15 @@ bool Transformation::update (bool fileIsLoaded,

if (ftor.transformIsDefined ()) {

QTransform before = m_transform;
updateTransformFromMatrices (ftor.matrixScreen(),
ftor.matrixGraph());
changed = (before != m_transform);

} else {

bool before = m_transformIsDefined;
m_transformIsDefined = false;
changed = (before != m_transformIsDefined);

}
}

return changed;
}

void Transformation::updateTransformFromMatrices (const QTransform &matrixScreen,
Expand Down
4 changes: 2 additions & 2 deletions src/Transformation/Transformation.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class Transformation
void transformScreenToRawGraph (const QPointF &coordScreen,
QPointF &coordGraph) const;

/// Update transform by iterating through the axis points. Returns true if there was any change
bool update (bool fileIsLoaded,
/// Update transform by iterating through the axis points
void update (bool fileIsLoaded,
const CmdMediator &cmdMediator,
const MainWindowModel &modelMainWindow);

Expand Down
32 changes: 13 additions & 19 deletions src/main/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3636,26 +3636,20 @@ void MainWindow::updateSmallDialogs ()

void MainWindow::updateTransformationAndItsDependencies()
{
if (m_transformation.update (!m_currentFile.isEmpty (),
*m_cmdMediator,
m_modelMainWindow)) {
m_transformation.update (!m_currentFile.isEmpty (),
*m_cmdMediator,
m_modelMainWindow);

// This processing can take a while for big images
QApplication::setOverrideCursor(Qt::WaitCursor);

// Grid removal is affected by new transformation above
m_backgroundStateContext->setCurveSelected (m_isGnuplot,
m_transformation,
m_cmdMediator->document().modelGridRemoval(),
m_cmdMediator->document().modelColorFilter(),
m_cmbCurve->currentText ());

// Grid display is also affected by new transformation above, if there was a transition into defined state
// in which case that transition triggered the initialization of the grid display parameters
updateGridLines();

QApplication::restoreOverrideCursor();
}
// Grid removal is affected by new transformation above
m_backgroundStateContext->setCurveSelected (m_isGnuplot,
m_transformation,
m_cmdMediator->document().modelGridRemoval(),
m_cmdMediator->document().modelColorFilter(),
m_cmbCurve->currentText ());

// Grid display is also affected by new transformation above, if there was a transition into defined state
// in which case that transition triggered the initialization of the grid display parameters
updateGridLines();
}

void MainWindow::updateViewedCurves ()
Expand Down
Loading

0 comments on commit 13c8218

Please sign in to comment.