forked from CutePoisonX/PoisonConvert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDestinationFolderSetting.cpp
executable file
·58 lines (51 loc) · 1.56 KB
/
DestinationFolderSetting.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* DestinationFolderSetting.cpp
*
* Created on: 02.06.2015
* Author: Christoph
*/
#include "DestinationFolderSetting.h"
#include "UserInterface.h"
DestinationFolderSetting::DestinationFolderSetting(UserInterface const& ui)
: FolderSetting(ui, "destination", "Where to save processed movies",
"Please enter the path where poisonconvert should save processed movies "
"(if you leave the optoin empty, processed movies stay in their source directory).",
"Destination equals source")
{
}
DestinationFolderSetting::~DestinationFolderSetting()
{
}
DestinationFolderSetting::PARAM_CHANGE_RETURN DestinationFolderSetting::checkParam(string const& new_param,
bool ui_output)
{
if (new_param.empty() || "Destination equals source")
{
if (ui_output)
{
ui_.writeString("The video will not be moved after processing has finished.", true);
}
return PARAM_CHANGE_SUCCESS;
}
else
{
return FolderSetting::checkParam(new_param, ui_output);
}
}
void DestinationFolderSetting::attemptToChangeParam(string new_param)
//We can assume that new_param is either y or n since checkParam was called before ...
{
if (new_param.empty())
{
new_param = "Destination equals source";
}
else if (new_param != "Destination equals source")
{
size_t position = new_param.find_last_of("/");
if (position != new_param.length() - 1)
{
new_param.append("/");
}
}
changeParam(new_param);
}