Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
~ Add MODE_DISABLED into AutoManualMode enum.
It allows to get rid of booleans storing enabled state for content/page boxes that essentially simplifies logic.
- Loading branch information
Showing
15 changed files
with
135 additions
and
222 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,28 @@ | ||
#include "AutoManualMode.h" | ||
|
||
QString autoManualModeToString(AutoManualMode mode) { | ||
QString str; | ||
switch (mode) { | ||
case MODE_AUTO: | ||
str = "auto"; | ||
break; | ||
case MODE_MANUAL: | ||
str = "manual"; | ||
break; | ||
case MODE_DISABLED: | ||
str = "disabled"; | ||
break; | ||
} | ||
|
||
return str; | ||
} | ||
|
||
AutoManualMode stringToAutoManualMode(const QString& str) { | ||
if (str == "disabled") { | ||
return MODE_DISABLED; | ||
} else if (str == "manual") { | ||
return MODE_MANUAL; | ||
} else { | ||
return MODE_AUTO; | ||
} | ||
} |
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,24 +1,12 @@ | ||
/* | ||
Scan Tailor - Interactive post-processing tool for scanned pages. | ||
Copyright (C) 2007-2008 Joseph Artsimovich <joseph_a@mail.ru> | ||
#ifndef SCANTAILOR_ADVANCED_AUTOMANUALMODE_H | ||
#define SCANTAILOR_ADVANCED_AUTOMANUALMODE_H | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
#include <QtCore/QString> | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
enum AutoManualMode { MODE_AUTO, MODE_MANUAL, MODE_DISABLED }; | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
QString autoManualModeToString(AutoManualMode mode); | ||
|
||
#ifndef AUTOMANUALMODE_H_ | ||
#define AUTOMANUALMODE_H_ | ||
AutoManualMode stringToAutoManualMode(const QString& str); | ||
|
||
enum AutoManualMode { MODE_AUTO, MODE_MANUAL }; | ||
|
||
#endif | ||
#endif // SCANTAILOR_ADVANCED_AUTOMANUALMODE_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
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
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
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
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
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
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
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
Oops, something went wrong.