define-switch for frozen alert

This commit is contained in:
Hendrik Schutter 2020-09-20 22:40:05 +02:00
parent 66cfbb5da2
commit 65c19f6fb9
3 changed files with 35 additions and 5 deletions

24
astyle.sh Normal file
View File

@ -0,0 +1,24 @@
#! /bin/bash
echo starting astyle for $PWD
astyle --style=gnu src/*.cpp
rm -f src/*.orig
astyle --style=gnu src/shred/*.cpp
rm -f src/shred/*.orig
astyle --style=gnu src/logger/*.cpp
rm -f src/logger/*.orig
astyle --style=gnu include/*.h
rm -f include//*.orig
astyle --style=gnu include//shred/*.h
rm -f include//shred/*.orig
astyle --style=gnu include//logger/*.h
rm -f include//logger/*.orig
echo finished astyle for $PWD

View File

@ -167,6 +167,7 @@ clean:
@echo "Deleting directories"
@$(RM) -r build
@$(RM) -r bin
@$(RM) -f reHDD.log
# Main rule, checks the executable and symlinks to the output
all: $(BIN_PATH)/$(BIN_NAME)
@ -199,6 +200,7 @@ $(BUILD_PATH)/%.o: $(SRC_PATH)/%.$(SRC_EXT)
docs:
@$(RM) -r $(DOCDIR)/html
@doxygen $(DOCDIR)/doxyfile
.PHONY: style
style:
@bash astyle.sh

View File

@ -112,11 +112,15 @@ void TUI::updateTUI(vector <Drive>* pvecDrives, uint8_t u8SelectedEntry)
}
break;
case Drive::FROZEN:
#ifdef FROZEN_ALERT
stream << fixed << setprecision(2) << (it->getTaskPercentage());
dialog=createFrozenWarning(70, 16, ((stdscrX)-(int)(stdscrX/2)-35),(int)(stdscrY/2)-8, it->getPath(), it->getModelFamily(), it->getModelName(), it->getSerial(), stream.str() + "%");
wrefresh(dialog);
#ifdef FROZEN_ALERT
if(bSelectedEntry)
{
dialog=createFrozenWarning(70, 16, ((stdscrX)-(int)(stdscrX/2)-20),(int)(stdscrY/2)-8, it->getPath(), it->getModelFamily(), it->getModelName(), it->getSerial(), stream.str() + "%");
wrefresh(dialog);
}
#endif
sState = "FROZEN " + stream.str() + "%"; //mark drive as frozen and reached progress
break;
default:
break;