MainWindow Refactor Part 4 of 5

Split the views in MainWindow into separate classes;

* Tab is a collection of the 4 main views

* TabView is a base class for all of the 4 view types

* {Analysis,Train,Diary,Home}View are all derived from
  TabView and deal with specifics of those views (e.g.
  Diary/Home worry about date ranges).

We should be ready to move to tabbed athletes soon.

There are a few nits left for this part of the refactor
that will need to be resolved in some fixups over the
next few days;

* tile mode segment selector has wrong segment selected
  when the view is in tile mode.

* Minimum height/width of MainWindow is large for some
  reason

* the Train view controls (play, ffwd etc) have nowhere
  to go at present -- need to fix that !!!

* When you resize the mainwindow width the sidebars expand
  and should remain a fixed width

* not sure if it will build on Windows or Mac!
This commit is contained in:
Mark Liversedge
2013-07-27 21:41:03 +01:00
parent a5a13668cd
commit ed2bdc5d3a
19 changed files with 665 additions and 539 deletions

View File

@@ -16,9 +16,9 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "MainWindow.h"
#include "Athlete.h"
#include "Context.h"
#include "Tab.h"
#include "HomeWindow.h"
#include "LTMTool.h"
#include "LTMSettings.h"
@@ -476,8 +476,8 @@ HomeWindow::dropEvent(QDropEvent *event)
void
HomeWindow::showControls()
{
context->mainWindow->chartsettings()->adjustSize();
context->mainWindow->chartsettings()->show();
context->tab->chartsettings()->adjustSize();
context->tab->chartsettings()->show();
}
void
@@ -652,8 +652,7 @@ HomeWindow::resetLayout()
for(int i = 0; i < charts.count(); i++) {
RideItem *notconst = (RideItem*)context->currentRideItem();
charts[i]->setProperty("ride", QVariant::fromValue<RideItem*>(notconst));
DateRange dr = context->currentDateRange();
charts[i]->setProperty("dateRange", QVariant::fromValue<DateRange>(dr));
charts[i]->setProperty("dateRange", property("dateRange"));
if (currentStyle != 0) charts[i]->show();
}