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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
// Copyright (c) 2018 Artur Shepilko
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "fossilsettings.h"
#include "constants.h"
#include "fossiltr.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/icore.h>
#include <utils/layoutbuilder.h>
#include <utils/pathchooser.h>
#include <vcsbase/vcsbaseconstants.h>
using namespace Utils;
namespace Fossil::Internal {
FossilSettings &settings()
{
static FossilSettings theSettings;
return theSettings;
}
FossilSettings::FossilSettings()
{
setAutoApply(false);
setSettingsGroup(Constants::FOSSIL);
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
binaryPath.setDefaultValue(Constants::FOSSILDEFAULT);
binaryPath.setDisplayName(Tr::tr("Fossil Command"));
binaryPath.setHistoryCompleter("Fossil.Command.History");
binaryPath.setLabelText(Tr::tr("Command:"));
defaultRepoPath.setSettingsKey("defaultRepoPath");
defaultRepoPath.setExpectedKind(PathChooser::Directory);
defaultRepoPath.setDisplayName(Tr::tr("Fossil Repositories"));
defaultRepoPath.setLabelText(Tr::tr("Default path:"));
defaultRepoPath.setToolTip(Tr::tr("Directory to store local repositories by default."));
userName.setDisplayStyle(StringAspect::LineEditDisplay);
userName.setLabelText(Tr::tr("Default user:"));
userName.setToolTip(Tr::tr("Existing user to become an author of changes made to the repository."));
sslIdentityFile.setSettingsKey("sslIdentityFile");
sslIdentityFile.setExpectedKind(PathChooser::File);
sslIdentityFile.setDisplayName(Tr::tr("SSL/TLS Identity Key"));
sslIdentityFile.setLabelText(Tr::tr("SSL/TLS identity:"));
sslIdentityFile.setToolTip(Tr::tr("SSL/TLS client identity key to use if requested by the server."));
diffIgnoreAllWhiteSpace.setSettingsKey("diffIgnoreAllWhiteSpace");
diffStripTrailingCR.setSettingsKey("diffStripTrailingCR");
annotateShowCommitters.setSettingsKey("annotateShowCommitters");
annotateListVersions.setSettingsKey("annotateListVersions");
timelineWidth.setSettingsKey("timelineWidth");
timelineWidth.setLabelText(Tr::tr("Log width:"));
timelineWidth.setToolTip(Tr::tr("The width of log entry line (>20). "
"Choose 0 to see a single line per entry."));
timelineLineageFilter.setSettingsKey("timelineLineageFilter");
timelineVerbose.setSettingsKey("timelineVerbose");
timelineItemType.setDefaultValue("all");
timelineItemType.setSettingsKey("timelineItemType");
disableAutosync.setSettingsKey("disableAutosync");
disableAutosync.setDefaultValue(true);
disableAutosync.setLabelText(Tr::tr("Disable auto-sync"));
disableAutosync.setToolTip(Tr::tr("Disable automatic pull prior to commit or update and "
"automatic push after commit or tag or branch creation."));
timeout.setLabelText(Tr::tr("Timeout:"));
timeout.setSuffix(Tr::tr("s"));
logCount.setLabelText(Tr::tr("Log count:"));
logCount.setToolTip(Tr::tr("The number of recent commit log entries to show. "
"Choose 0 to see all entries."));
setLayouter([this] {
using namespace Layouting;
return Column {
Group {
title(Tr::tr("Configuration")),
Row { binaryPath }
},
Group {
title(Tr::tr("Local Repositories")),
Row { defaultRepoPath }
},
Group {
title(Tr::tr("User")),
Form {
userName, br,
sslIdentityFile
}
},
Group {
title(Tr::tr("Miscellaneous")),
Column {
Row { logCount, timelineWidth, timeout, st },
disableAutosync
},
},
st
};
});
readSettings();
}
// FossilSettingsPage
class FossilSettingsPage final : public Core::IOptionsPage
{
public:
FossilSettingsPage()
{
setId(Constants::VCS_ID_FOSSIL);
setDisplayName(Tr::tr("Fossil"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setSettingsProvider([] { return &settings(); });
}
};
const FossilSettingsPage settingsPage;
} // Fossil::Internal
|