Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulatior enhancement #54

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Binary file modified resources/skins/base/simulator/phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/templates/flashcard/FlashCardBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/templates/learnspellings/SpellingBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/templates/mlearning/MlearningBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/templates/quiz/QuizBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/definitions/definitions.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
#define SIMULATOR_OFFSET 16

#define SIMULATOR_CONTENTS_OFFSET_X 30
#define SIMULATOR_CONTENTS_OFFSET_Y 95
#define SIMULATOR_CONTENTS_OFFSET_Y 115
#define SIMULATOR_CONTENTS_WIDTH 270
#define SIMULATOR_CONTENTS_HEIGHT 447
#define SIMULATOR_CONTENTS_HEIGHT 427

#define SIMULATOR_HEADER_SIZE_INCREASE 2
#define SIMULATOR_HEADING_SIZE_INCREASE 2
Expand Down
6 changes: 6 additions & 0 deletions src/templates/flashcard/flashcardsimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "miscellaneous/application.h"
#include "miscellaneous/skinfactory.h"

#include <QDir>


FlashCardSimulator::FlashCardSimulator(TemplateCore *core, QWidget *parent)
: TemplateSimulator(core, parent),
Expand Down Expand Up @@ -94,6 +96,10 @@ bool FlashCardSimulator::startSimulation() {

// Go to "start" page and begin.
m_ui->m_phoneWidget->setCurrentIndex(1);
m_ui->m_flashcardBar->setPixmap(QPixmap(APP_TEMPLATES_PATH + QDir::separator() +
"flashcard" + QDir::separator() +
"FlashCardBar.png"));
m_ui->m_barText->setStyleSheet("background-color: rgb(221, 221, 221);color: black");
return true;
}

Expand Down
41 changes: 41 additions & 0 deletions src/templates/flashcard/flashcardsimulator.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,52 @@
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="m_flashcardBar">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_barText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Learn with FlashCards</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="m_phoneWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
Expand Down
4 changes: 4 additions & 0 deletions src/templates/learnspellings/learnspellingssimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ bool LearnSpellingsSimulator::startSimulation() {
m_ui->m_lblAuthor->setText(editor->m_ui->m_txtAuthor->lineEdit()->text());
m_ui->m_lblHeading->setText(editor->m_ui->m_txtName->lineEdit()->text());
m_ui->m_phoneWidget->setCurrentIndex(1);
m_ui->m_learnspellingBar->setPixmap(QPixmap(APP_TEMPLATES_PATH + QDir::separator() +
"learnspellings" + QDir::separator() +
"SpellingBar.png"));
m_ui->m_barText->setStyleSheet("background-color: rgb(221, 221, 221);color: black");

return true;
}
Expand Down
51 changes: 49 additions & 2 deletions src/templates/learnspellings/learnspellingssimulator.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,64 @@
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="m_learnspellingBar">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_barText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Learn Spellings</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="m_phoneWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="m_pageStopped">
<layout class="QHBoxLayout" name="horizontalLayout_3">
Expand Down
7 changes: 7 additions & 0 deletions src/templates/mlearning/basicmlearningsimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#include "templates/mlearning/basicmlearningeditor.h"
#include "core/templatecore.h"
#include "definitions/definitions.h"

#include <QDir>


BasicmLearningSimulator::BasicmLearningSimulator(TemplateCore *core, QWidget *parent) :
Expand Down Expand Up @@ -65,6 +68,10 @@ bool BasicmLearningSimulator::startSimulation() {
}

m_ui->m_phoneWidget->setCurrentIndex(1);
m_ui->m_mlearningBar->setPixmap(QPixmap(APP_TEMPLATES_PATH + QDir::separator() +
"mlearning" + QDir::separator() +
"MlearningBar.png"));
m_ui->m_barText->setStyleSheet("background-color: rgb(221, 221, 221);color: black");

return true;
}
Expand Down
83 changes: 44 additions & 39 deletions src/templates/mlearning/basicmlearningsimulator.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,59 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="m_mlearningBar">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_barText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Basic mLearning</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="m_phoneWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="m_pageStopped">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
Expand All @@ -59,16 +82,7 @@
</widget>
<widget class="QWidget" name="m_pageList">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
Expand All @@ -78,16 +92,7 @@
</widget>
<widget class="QWidget" name="m_pageDetails">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
Expand Down
5 changes: 5 additions & 0 deletions src/templates/quiz/quizsimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <QLabel>
#include <QPushButton>
#include <QRadioButton>
#include <QDir>


QuizSimulator::QuizSimulator(TemplateCore *core, QWidget *parent)
Expand Down Expand Up @@ -96,6 +97,10 @@ bool QuizSimulator::startSimulation() {
}

m_ui->m_phoneWidget->setCurrentIndex(1);
m_ui->m_quizBar->setPixmap(QPixmap(APP_TEMPLATES_PATH + QDir::separator() +
"quiz" + QDir::separator() +
"QuizBar.png"));
m_ui->m_barText->setStyleSheet("background-color: rgb(221, 221, 221);color: black");
return true;
}

Expand Down
40 changes: 39 additions & 1 deletion src/templates/quiz/quizsimulator.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,53 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="m_quizBar">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="m_barText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Quiz Time</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="m_phoneWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
Expand Down