-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
KonklaveTtv
committed
Aug 28, 2023
1 parent
1bc78e7
commit dd04ae4
Showing
4 changed files
with
111 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef INIT_H | ||
#define INIT_H | ||
|
||
#include "curl.h" | ||
#include "errorhandler.h" | ||
#include "fileutils.h" | ||
#include "filtercriteria.h" | ||
#include "mail.h" | ||
#include "menu.h" | ||
|
||
#include <set> | ||
#include <vector> | ||
|
||
class Init { | ||
private: | ||
std::string senderEmail, smtpServer; | ||
int smtpPort; | ||
bool useSSL, verifyPeer, verifyHost, verbose; | ||
public: | ||
// Function to display the splashscreen | ||
static void splashscreen(); | ||
|
||
void Menu(); | ||
}; | ||
|
||
#endif // INIT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
#ifndef MAIN_H | ||
#define MAIN_H | ||
|
||
#include "errorhandler.h" | ||
#include "fileutils.h" | ||
#include "mail.h" | ||
#include "menu.h" | ||
#include "init.h" | ||
|
||
#endif // MAIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include "include/init.h" | ||
|
||
using namespace confPaths; | ||
using namespace std; | ||
|
||
MenuManager menuManager; | ||
|
||
void Init::splashscreen() { | ||
// Clear the console for the splashscreen | ||
ConsoleUtils::clearConsole(); | ||
|
||
// Set color to cyan | ||
ConsoleUtils::setColor(ConsoleUtils::Color::CYAN); | ||
for (int i = 0; i < 44; ++i) std::cout << '*'; | ||
std::cout << std::endl; | ||
|
||
ConsoleUtils::resetColor(); | ||
|
||
// Display splash text centered | ||
std::cout << " VenueSender " << std::endl; | ||
ConsoleUtils::setColor(ConsoleUtils::Color::CYAN); | ||
std::cout << "********************************************" << std::endl; | ||
ConsoleUtils::resetColor(); | ||
|
||
std::cout << " Version 1.0.0 " << std::endl; | ||
|
||
// Display copyright and other text in cyan | ||
ConsoleUtils::setColor(ConsoleUtils::Color::CYAN); | ||
std::cout << "********************************************" << std::endl; | ||
ConsoleUtils::resetColor(); | ||
|
||
std::cout << " Copyright (c) 2023, Spencer Lievens. " << std::endl; | ||
ConsoleUtils::setColor(ConsoleUtils::Color::CYAN); | ||
|
||
// Display bottom border | ||
for (int i = 0; i < 44; ++i) std::cout << '*'; | ||
std::cout << std::endl; | ||
ConsoleUtils::resetColor(); | ||
|
||
std::cout << " Initiailizing... " << std::endl; | ||
std::this_thread::sleep_for(std::chrono::seconds(2)); | ||
} | ||
|
||
void Init::Menu() { | ||
// Main loop for interacting with the user | ||
while (true) { | ||
MenuManager::mainHeader(); | ||
|
||
// Display main menu options and get the user's choice | ||
int mainChoice = MenuManager::displayMenuOptions(); | ||
|
||
// Main Menu | ||
switch (mainChoice) { | ||
case MenuManager::VENUE_SELECTION_OPTION: | ||
MenuManager::displayVenueSelectionOptions(); | ||
break; | ||
case MenuManager::VENUE_OPTIONS_OPTION: | ||
MenuManager::displayVenueOptions(); | ||
break; | ||
case MenuManager::EMAIL_OPTIONS_OPTION: | ||
MenuManager::displayEmailOptions(); | ||
break; | ||
case MenuManager::TEMPLATES_OPTION: | ||
MenuManager::displayTemplateOptions(); | ||
break; | ||
case MenuManager::CONFIGURATION_OPTION: | ||
EmailManager::viewEmailSettings(useSSL, verifyPeer, verifyHost, verbose, senderEmail, smtpPort, smtpServer); | ||
break; | ||
default: | ||
ErrorHandler::handleErrorAndReturn(ErrorHandler::ErrorType::INVALID_CHOICE_ERROR); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters