}
}
+void MainWindow::markHomeClub()
+{
+ TRACE;
+ QListIterator<Club *> i(clubList);
+ Club *c;
+
+ while (i.hasNext()) {
+ c = i.next();
+ if (c->getName() == conf.homeClub)
+ c->setHomeClub(true);
+ else
+ c->setHomeClub(false);
+ }
+}
MainWindow::MainWindow(QMainWindow *parent): QMainWindow(parent)
{
- resize(800, 480);
+ resize(800, 480);
#ifdef Q_WS_MAEMO_5
- setAttribute(Qt::WA_Maemo5StackedWindow);
+ setAttribute(Qt::WA_Maemo5StackedWindow);
#endif
- loadSettings();
+ loadSettings();
- centralWidget = new QWidget(this);
+ centralWidget = new QWidget(this);
- setCentralWidget(centralWidget);
+ setCentralWidget(centralWidget);
- loadScoreFile(scoreFile, scoreList);
- if (conf.defaultCourses == "Yes")
- loadClubFile(masterFile, clubList, true);
- loadClubFile(clubFile, clubList);
+ loadScoreFile(scoreFile, scoreList);
+ if (conf.defaultCourses == "Yes")
+ loadClubFile(masterFile, clubList, true);
+ loadClubFile(clubFile, clubList);
+ markHomeClub();
- // Sort the scores based on dates
- qSort(scoreList.begin(), scoreList.end(), dateMoreThan);
- createActions();
- createMenus();
+ // Sort the scores based on dates
+ qSort(scoreList.begin(), scoreList.end(), dateMoreThan);
+ createActions();
+ createMenus();
- createListView(scoreList, clubList);
+ createListView(scoreList, clubList);
- createLayoutList(centralWidget);
+ createLayoutList(centralWidget);
- scoreWindow = new ScoreWindow(this);
- courseWindow = new CourseWindow(this);
+ scoreWindow = new ScoreWindow(this);
+ courseWindow = new CourseWindow(this);
}
void MainWindow::loadSettings(void)
void MainWindow::viewScore(Score * score, Course * course)
{
TRACE;
+ qDebug() << score << course;
scoreWindow->setup(score, course);
scoreWindow->show();
}
QString newValue = conf.defaultCourses.toString();
saveSettings();
- qDebug() << "Settings:" << oldValue << "->" << newValue;
-
// Reload club list, or drop r/o courses from list
if (oldValue == "Yes" && newValue == "No") {
flushReadOnlyItems();
courseListModel->update(clubList);
list->update();
}
+ markHomeClub();
}
}