diff --git a/mainwindow.cpp b/mainwindow.cpp index 8777573..a6f5b3f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -8,15 +8,13 @@ #include "mainwindow.h" #include "./ui_mainwindow.h" +#include #include -#include - - QString verse_display(); -std::string verse_grab(int day); +std::string verse_grab(); MainWindow::MainWindow(QWidget *parent) @@ -33,19 +31,14 @@ MainWindow::~MainWindow() delete ui; } -//As name implies, randomly chooses a number between 1 and 100. -int random_verse(){ - std::random_device rd; - std:: uniform_int_distribution dist(1, 100); - return dist(rd); -} + //This is the function that will load the verse into the program. QString verse_display() { std::string verse_text; - int verse_day = random_verse(); - verse_text = verse_grab(verse_day); + + verse_text = verse_grab(); QString returned_string = QString::fromStdString(verse_text); @@ -53,17 +46,22 @@ QString verse_display() } -std::string verse_grab(int day){ +std::string verse_grab(){ + + //Windows way of getting current month and time. + SYSTEMTIME st = {0}; + GetLocalTime(&st); + int cur_day = st.wDay; + int cur_month = st.wMonth; std::string my_verse; - my_verse = "Hello, this is a verse!"; + return my_verse; } - void MainWindow::on_exitButton_clicked() { QApplication::quit();