#include <QApplication>
#include <QWidget>
#include <QObject>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QSlider>
#include <QSpinBox>
#include <QPushButton>
#include <QMessageBox>
#include <QLabel>
#include <QSound>
#include <windows.h>
#include "PROCESS.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// create a main window widget
QWidget *main = new QWidget;
main->setWindowTitle("FFXIV Auto Shouter");
main->setWindowIcon(QIcon("C:/Users/Ground Zero/Desktop/FFXIV Auto Shouter/favicon.png"));
main->setFixedWidth(325);
// create the widgets which we will use
QLabel *label1 = new QLabel("Amount: ");
QLabel *label2 = new QLabel("<strong><font color=\"orange\">Configuring</font></strong>");
QSlider *slider = new QSlider(Qt::Horizontal);
QSpinBox *spinbox = new QSpinBox;
QPushButton *button = new QPushButton;
// connect the slider and the box for synchronisation
QObject::connect(slider, SIGNAL(valueChanged(int)), spinbox, SLOT(setValue(int)));
QObject::connect(spinbox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
// connect the start button to the class and start
// executing the process of repeated shouting, but first
// we will set some options to be able to do all of this
int amount = 0;
initiateProcess execFunction( amount, label2, slider );
QObject::connect(button, SIGNAL(clicked()), &execFunction, SLOT(startProcess()));
// configurate the widgets
slider->setRange(1, 199);
spinbox->setRange(1, 199);
slider->setValue(1);
button->setText("SHOUT");
// styling templates for the widgets
slider->setStyleSheet("background:#000; color:#FFFFFF;");
spinbox->setStyleSheet("background:#000; color:#FFFFFF;");
button->setStyleSheet("background:#000; color:#FFFFFF;");
// tooltips for the widgets
slider->setToolTip("Select the amount of shouts you want to repeat");
spinbox->setToolTip("Select the amount of shouts you want to repeat");
button->setToolTip("Click here to start shouting");
// create the bounding boxes
QHBoxLayout *wrapper = new QHBoxLayout;
QHBoxLayout *leftside = new QHBoxLayout;
QVBoxLayout *rightside = new QVBoxLayout;
// add the widgets to the boxes
leftside->addWidget(label1);
leftside->addWidget(slider);
leftside->addWidget(spinbox);
rightside->addWidget(button);
rightside->addWidget(label2);
// add the boxes to each other
wrapper->addLayout(leftside);
wrapper->addLayout(rightside);
// set a couple of sounds
QSound bootSND("C:/Users/Ground Zero/Desktop/FFXIV Auto Shouter/greetings.wav"); // start up
QSound executeSND("C:/Users/Ground Zero/Desktop/FFXIV Auto Shouter/execute.wav"); // starting loop
QSound finishedSND("C:/Users/Ground Zero/Desktop/FFXIV Auto Shouter/cheer.wav"); // finished loop
// play at startup
bootSND.play();
// show the widget
main->setLayout(wrapper);
main->show();
return app.exec();
}