diff options
Diffstat (limited to 'src/assignmentList.cpp')
-rw-r--r-- | src/assignmentList.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index 17ec3cc..0ccda0e 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -51,24 +51,38 @@ void AssignmentList::initializeUI() { // create toolbar ui.toolBar->addAction(ui.actionAdd_Group); - this->setupDB(); + // setup database + BackendDB::init(); + this->displayDate(); this->displayWidgets(); this->show(); } -void AssignmentList::setupDB() { - BackendDB::init(); - qDebug() << "WIP"; -} - void AssignmentList::displayDate() { QDate today = QDate::currentDate(); ui.title->setText(today.toString("dddd, MMM d yyyy")); } void AssignmentList::displayWidgets() { - //this->drawGroups(); + QVBoxLayout *column_left = new QVBoxLayout(); + QVBoxLayout *column_right = new QVBoxLayout(); + QList<Group *> groups = BackendDB::loadGroups(); + int i; + + for(i = 0; i < groups.size(); ++i) { + if(groups[i]->hidden) continue; + // TODO set right click behavior + // TODO add entries to this layout + if(groups[i]->column.toLower() == "left") column_left->addLayout(groups[i]); + else column_right->addLayout(groups[i]); + } + + column_left->addStretch(); + column_right->addStretch(); + + ui.groups_layout->addLayout(column_left, 0, 0); + ui.groups_layout->addLayout(column_right, 0, 1); } // Open the 'addGroup' form |