Skip to content

Commit

Permalink
Merge pull request #39 from FirstBuild/RemoveClock
Browse files Browse the repository at this point in the history
Remove clock display
  • Loading branch information
rdsuel authored Dec 15, 2021
2 parents 65bfe03 + 21d0cbc commit c183111
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 80 deletions.
164 changes: 132 additions & 32 deletions PizzaOvenUI/PizzaOvenUI.pro.user

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions PizzaOvenUI/Screen_Cooldown.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ Item {
}
}
else {
if (timeOfDayDisplayed) {
forceScreenTransition(Qt.resolvedUrl("Screen_TimeOfDay.qml"));
} else {
forceScreenTransition(Qt.resolvedUrl("Screen_Off.qml"));
}
forceScreenTransition(Qt.resolvedUrl("Screen_Off.qml"));
}
break;
}
Expand Down
12 changes: 2 additions & 10 deletions PizzaOvenUI/Screen_MainMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ Item {
if (powerSwitch == 0) {
screenExit();
stackView.clear();
if (timeOfDayDisplayed) {
stackView.push({item: Qt.resolvedUrl("Screen_TimeOfDay.qml"), immediate:immediateTransitions});
} else {
stackView.push({item: Qt.resolvedUrl("Screen_Off.qml"), immediate:immediateTransitions});
}
stackView.push({item: Qt.resolvedUrl("Screen_Off.qml"), immediate:immediateTransitions});
}
}

Expand Down Expand Up @@ -96,11 +92,7 @@ Item {
script: {
screenExit();
stackView.clear();
if (timeOfDayDisplayed) {
stackView.push({item: Qt.resolvedUrl("Screen_TimeOfDay.qml"), immediate:immediateTransitions});
} else {
stackView.push({item: Qt.resolvedUrl("Screen_Off.qml"), immediate:immediateTransitions});
}
stackView.push({item: Qt.resolvedUrl("Screen_Off.qml"), immediate:immediateTransitions});
}
}
}
Expand Down
1 change: 0 additions & 1 deletion PizzaOvenUI/Screen_Settings2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ Item {
ListElement { name: "VOLUME"; screen: "Screen_SetVolume.qml" }
ListElement { name: "DISPLAY BRIGHTNESS"; screen: "Screen_SetBrightness.qml" }
ListElement { name: "ABOUT"; screen: "Screen_About.qml" }
ListElement { name: "TIME"; screen: "Screen_SettingsTime.qml" }
}

Tumbler {
Expand Down
13 changes: 2 additions & 11 deletions PizzaOvenUI/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ Window {
sounds.powerOff.play();
if (!callServiceFailure) {
console.log("The power switch is now off, transitioning to the off screen.");
if (timeOfDayDisplayed) {
forceScreenTransition(Qt.resolvedUrl("Screen_TimeOfDay.qml"));
} else {
forceScreenTransition(Qt.resolvedUrl("Screen_Off.qml"));
}
forceScreenTransition(Qt.resolvedUrl("Screen_Off.qml"));
}
}
}
Expand Down Expand Up @@ -152,7 +148,6 @@ Window {
property int screenOffsetX: appSettings.screenOffsetX
property int screenOffsetY: appSettings.screenOffsetY
property string timeOfDay: "12:00"
property bool timeOfDayDisplayed: appSettings.timeOfDayDisplayed
property int smallTextSize: 32
property int bigTextSize: 55
property int titleTextSize: 18 * screenScale
Expand Down Expand Up @@ -355,11 +350,7 @@ Window {
appSettings.backlightOff = false;
if (appSettings.settingsInitialized) {
if (callServiceFailure == false) {
if (timeOfDayDisplayed) {
Qt.resolvedUrl("Screen_TimeOfDay.qml");
} else {
Qt.resolvedUrl("Screen_Off.qml");
}
Qt.resolvedUrl("Screen_Off.qml");
} else {
Qt.resolvedUrl("Screen_CallService.qml");
}
Expand Down
17 changes: 0 additions & 17 deletions PizzaOvenUI/programSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const bool defaultRotatePizzaAlert = true;
const bool defaultFinalCheckAlert = true;
const bool defaultDoneAlert = true;
const bool defaultDemoMode = true;
const bool defaultTimeOfDayDisplayedState = true;

extern QObject *appParentObj;
bool backlightFileExists = false;
Expand Down Expand Up @@ -127,7 +126,6 @@ void ProgramSettings::loadSettingsFromJsonObject(const QJsonObject &settings)
m_doneAlertEnabled = (settings.contains("doneAlertEnabled")) ? settings["doneAlertEnabled"].toBool() : defaultDoneAlert;
m_demoModeState = (settings.contains("demoModeEnable")) ? settings["demoModeEnable"].toBool() : defaultDemoMode;
m_demoModeState = (settings.contains("demoModeEnable")) ? settings["demoModeEnable"].toBool() : defaultDemoMode;
m_timeOfDayDisplayedState = (settings.contains("timeOfDayDisplayed")) ? settings["timeOfDayDisplayed"].toBool() : defaultTimeOfDayDisplayedState;
}

void ProgramSettings::storeSettingsToJsonObject(QJsonObject &settings) const
Expand All @@ -143,7 +141,6 @@ void ProgramSettings::storeSettingsToJsonObject(QJsonObject &settings) const
settings["finalCheckAlertEnabled"] = m_finalCheckAlertEnabled;
settings["doneAlertEnabled"] = m_doneAlertEnabled;
settings["demoModeEnable"] = m_demoModeState;
settings["timeOfDayDisplayed"] = m_timeOfDayDisplayedState;
}

void ProgramSettings::initializeSettingsToDefaults(void)
Expand All @@ -161,7 +158,6 @@ void ProgramSettings::initializeSettingsToDefaults(void)
m_finalCheckAlertEnabled = defaultFinalCheckAlert;
m_doneAlertEnabled = defaultDoneAlert;
m_demoModeState = defaultDemoMode;
m_timeOfDayDisplayedState = defaultTimeOfDayDisplayedState;
}

/*************** TOD Offset ***************/
Expand All @@ -179,19 +175,6 @@ int ProgramSettings::todOffset()
return m_todOffset;
}

/*************** Time Of Day Displayed ***************/
void ProgramSettings::setTimeOfDayDisplayState(bool displayed)
{
m_timeOfDayDisplayedState = displayed;
emit timeOfDayDisplayedStateChanged();
saveSettings();
}

bool ProgramSettings::getTimeOfDayDisplayedState()
{
return m_timeOfDayDisplayedState;
}

/*************** Screen Offset X ***************/
void ProgramSettings::setScreenoffsetX(int OffsetX)
{
Expand Down
4 changes: 0 additions & 4 deletions PizzaOvenUI/programSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ProgramSettings : public QObject
{
Q_OBJECT
Q_PROPERTY(int todOffset READ todOffset WRITE setTodOffset NOTIFY todOffsetChanged)
Q_PROPERTY(bool timeOfDayDisplayed READ getTimeOfDayDisplayedState WRITE setTimeOfDayDisplayState NOTIFY timeOfDayDisplayedStateChanged)
Q_PROPERTY(int screenOffsetX READ getScreenOffsetX WRITE setScreenoffsetX NOTIFY screenOffsetXChanged)
Q_PROPERTY(int screenOffsetY READ getScreenOffsetY WRITE setScreenoffsetY NOTIFY screenOffsetYChanged)
Q_PROPERTY(bool settingsInitialized READ areSettingsInitialized WRITE intializeSettings NOTIFY initializationChanged)
Expand All @@ -35,8 +34,6 @@ class ProgramSettings : public QObject

void setTodOffset(int newOffset);
int todOffset();
void setTimeOfDayDisplayState(bool displayed);
bool getTimeOfDayDisplayedState();
void setScreenoffsetX(int OffsetX);
void setScreenoffsetY(int OffsetY);
int getScreenOffsetX();
Expand Down Expand Up @@ -81,7 +78,6 @@ class ProgramSettings : public QObject
public slots:
private:
int m_todOffset;
bool m_timeOfDayDisplayedState;
int m_screenXOffset;
int m_screenYOffset;
bool m_settingsInitialized;
Expand Down

0 comments on commit c183111

Please sign in to comment.