2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Brian McGillion
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2009-11-02 18:50:06 +01:00
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
#include "mercurialsettings.h"
|
2021-03-19 14:12:25 +01:00
|
|
|
|
2009-09-15 13:03:13 +03:00
|
|
|
#include "constants.h"
|
|
|
|
|
|
2021-03-19 14:12:25 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
|
|
|
|
|
|
|
|
|
#include <vcsbase/vcsbaseconstants.h>
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
2011-06-10 15:27:57 +00:00
|
|
|
|
|
|
|
|
namespace Mercurial {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2012-01-07 14:32:59 +01:00
|
|
|
MercurialSettings::MercurialSettings()
|
|
|
|
|
{
|
2021-03-19 14:12:25 +01:00
|
|
|
setSettingsGroup("Mercurial");
|
|
|
|
|
setAutoApply(false);
|
|
|
|
|
|
|
|
|
|
registerAspect(&binaryPath);
|
|
|
|
|
binaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
|
|
|
binaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
|
|
|
|
binaryPath.setDefaultValue(Constants::MERCURIALDEFAULT);
|
|
|
|
|
binaryPath.setDisplayName(tr("Mercurial Command"));
|
|
|
|
|
binaryPath.setHistoryCompleter("Bazaar.Command.History");
|
|
|
|
|
binaryPath.setLabelText(tr("Command:"));
|
|
|
|
|
|
|
|
|
|
registerAspect(&userName);
|
|
|
|
|
userName.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
userName.setLabelText(tr("Default username:"));
|
|
|
|
|
userName.setToolTip(tr("Username to use by default on commit."));
|
|
|
|
|
|
|
|
|
|
registerAspect(&userEmail);
|
|
|
|
|
userEmail.setDisplayStyle(StringAspect::LineEditDisplay);
|
|
|
|
|
userEmail.setLabelText(tr("Default email:"));
|
|
|
|
|
userEmail.setToolTip(tr("Email to use by default on commit."));
|
|
|
|
|
|
|
|
|
|
registerAspect(&diffIgnoreWhiteSpace);
|
|
|
|
|
diffIgnoreWhiteSpace.setSettingsKey("diffIgnoreWhiteSpace");
|
|
|
|
|
|
|
|
|
|
registerAspect(&diffIgnoreBlankLines);
|
|
|
|
|
diffIgnoreBlankLines.setSettingsKey("diffIgnoreBlankLines");
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-06 12:10:29 +02:00
|
|
|
// MercurialSettingsPage
|
2021-03-19 14:12:25 +01:00
|
|
|
|
2021-04-06 12:10:29 +02:00
|
|
|
MercurialSettingsPage::MercurialSettingsPage(MercurialSettings *settings)
|
2021-03-19 14:12:25 +01:00
|
|
|
{
|
|
|
|
|
setId(VcsBase::Constants::VCS_ID_MERCURIAL);
|
2021-04-06 12:10:29 +02:00
|
|
|
setDisplayName(MercurialSettings::tr("Mercurial"));
|
2021-03-19 14:12:25 +01:00
|
|
|
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
|
2022-02-21 11:27:53 +01:00
|
|
|
setSettings(settings);
|
2021-04-06 12:10:29 +02:00
|
|
|
|
|
|
|
|
setLayouter([settings](QWidget *widget) {
|
|
|
|
|
MercurialSettings &s = *settings;
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Group {
|
2022-07-26 13:46:27 +02:00
|
|
|
title(MercurialSettings::tr("Configuration")),
|
2021-04-06 12:10:29 +02:00
|
|
|
Row { s.binaryPath }
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
Group {
|
2022-07-26 13:46:27 +02:00
|
|
|
title(MercurialSettings::tr("User")),
|
2021-04-06 12:10:29 +02:00
|
|
|
Form {
|
|
|
|
|
s.userName,
|
|
|
|
|
s.userEmail
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
Group {
|
2022-07-26 13:46:27 +02:00
|
|
|
title(MercurialSettings::tr("Miscellaneous")),
|
2021-04-06 12:10:29 +02:00
|
|
|
Row {
|
|
|
|
|
s.logCount,
|
|
|
|
|
s.timeout,
|
2022-07-22 18:54:04 +02:00
|
|
|
st
|
2021-04-06 12:10:29 +02:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2022-07-22 18:54:04 +02:00
|
|
|
st
|
2021-04-06 12:10:29 +02:00
|
|
|
}.attachTo(widget);
|
|
|
|
|
});
|
2012-01-07 14:32:59 +01:00
|
|
|
}
|
2011-06-10 15:27:57 +00:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Mercurial
|