mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 17:09:56 +00:00
#6396 no dialog when no doc changes were done and check-in or revert is done
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35828 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
80a5dd8144
commit
c6d4080694
@ -165,7 +165,9 @@ string LyXVC::checkIn()
|
|||||||
docstring empty(_("(no log message)"));
|
docstring empty(_("(no log message)"));
|
||||||
docstring response;
|
docstring response;
|
||||||
string log;
|
string log;
|
||||||
bool ok = Alert::askForText(response, _("LyX VC: Log Message"));
|
bool ok = true;
|
||||||
|
if (vcs->isCheckInWithConfirmation())
|
||||||
|
ok = Alert::askForText(response, _("LyX VC: Log Message"));
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (response.empty())
|
if (response.empty())
|
||||||
response = empty;
|
response = empty;
|
||||||
@ -214,7 +216,9 @@ void LyXVC::revert()
|
|||||||
docstring text = bformat(_("Reverting to the stored version of the "
|
docstring text = bformat(_("Reverting to the stored version of the "
|
||||||
"document %1$s will lose all current changes.\n\n"
|
"document %1$s will lose all current changes.\n\n"
|
||||||
"Do you want to revert to the older version?"), file);
|
"Do you want to revert to the older version?"), file);
|
||||||
int const ret = Alert::prompt(_("Revert to stored version of document?"),
|
int ret = 0;
|
||||||
|
if (vcs->isRevertWithConfirmation())
|
||||||
|
ret = Alert::prompt(_("Revert to stored version of document?"),
|
||||||
text, 0, 1, _("&Revert"), _("&Cancel"));
|
text, 0, 1, _("&Revert"), _("&Cancel"));
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
|
@ -195,6 +195,12 @@ bool RCS::checkInEnabled()
|
|||||||
return owner_ && !owner_->isReadonly();
|
return owner_ && !owner_->isReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RCS::isCheckInWithConfirmation()
|
||||||
|
{
|
||||||
|
//FIXME diff
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
string RCS::checkOut()
|
string RCS::checkOut()
|
||||||
{
|
{
|
||||||
@ -247,6 +253,13 @@ void RCS::revert()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool RCS::isRevertWithConfirmation()
|
||||||
|
{
|
||||||
|
//FIXME owner && diff ?
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RCS::undoLast()
|
void RCS::undoLast()
|
||||||
{
|
{
|
||||||
LYXERR(Debug::LYXVC, "LyXVC: undoLast");
|
LYXERR(Debug::LYXVC, "LyXVC: undoLast");
|
||||||
@ -612,6 +625,13 @@ bool CVS::checkInEnabled()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CVS::isCheckInWithConfirmation()
|
||||||
|
{
|
||||||
|
CvsStatus status = getStatus();
|
||||||
|
return status == LocallyModified || status == LocallyAdded;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
string CVS::checkOut()
|
string CVS::checkOut()
|
||||||
{
|
{
|
||||||
if (vcstatus != NOLOCKING && edit())
|
if (vcstatus != NOLOCKING && edit())
|
||||||
@ -705,6 +725,13 @@ bool CVS::lockingToggleEnabled()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool CVS::isRevertWithConfirmation()
|
||||||
|
{
|
||||||
|
CvsStatus status = getStatus();
|
||||||
|
return !owner_->isClean() || status == LocallyModified || status == NeedsMerge;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CVS::revert()
|
void CVS::revert()
|
||||||
{
|
{
|
||||||
// Reverts to the version in CVS repository and
|
// Reverts to the version in CVS repository and
|
||||||
@ -724,19 +751,24 @@ void CVS::revert()
|
|||||||
owner_->markClean();
|
owner_->markClean();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LocallyAdded:
|
case LocallyAdded: {
|
||||||
|
docstring const file = owner_->fileName().displayName(20);
|
||||||
frontend::Alert::error(_("Revision control error."),
|
frontend::Alert::error(_("Revision control error."),
|
||||||
_("The current file is not in repository.\n"
|
bformat(_("The document %1$s is not in repository.\n"
|
||||||
"You have to check in the first revision before you can revert.")) ;
|
"You have to check in the first revision before you can revert."),
|
||||||
|
file)) ;
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
|
default: {
|
||||||
|
docstring const file = owner_->fileName().displayName(20);
|
||||||
frontend::Alert::error(_("Revision control error."),
|
frontend::Alert::error(_("Revision control error."),
|
||||||
bformat(_("Bad status when checking in changes.\n"
|
bformat(_("Cannot revert document %1$s to repository version.\n"
|
||||||
"\n'%1$s'\n\n"),
|
"The status '%2$s' is unexpected."),
|
||||||
toString(status)));
|
file, toString(status)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CVS::undoLast()
|
void CVS::undoLast()
|
||||||
@ -928,6 +960,13 @@ bool SVN::checkInEnabled()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SVN::isCheckInWithConfirmation()
|
||||||
|
{
|
||||||
|
//FIXME diff
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// FIXME Correctly return code should be checked instead of this.
|
// FIXME Correctly return code should be checked instead of this.
|
||||||
// This would need another solution than just plain startscript.
|
// This would need another solution than just plain startscript.
|
||||||
// Hint from Andre': QProcess::readAllStandardError()...
|
// Hint from Andre': QProcess::readAllStandardError()...
|
||||||
@ -1129,7 +1168,7 @@ bool SVN::lockingToggleEnabled()
|
|||||||
|
|
||||||
void SVN::revert()
|
void SVN::revert()
|
||||||
{
|
{
|
||||||
// Reverts to the version in CVS repository and
|
// Reverts to the version in SVN repository and
|
||||||
// gets the updated version from the repository.
|
// gets the updated version from the repository.
|
||||||
string const fil = quoteName(onlyFileName(owner_->absFileName()));
|
string const fil = quoteName(onlyFileName(owner_->absFileName()));
|
||||||
|
|
||||||
@ -1139,6 +1178,13 @@ void SVN::revert()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SVN::isRevertWithConfirmation()
|
||||||
|
{
|
||||||
|
//FIXME owner && diff
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SVN::undoLast()
|
void SVN::undoLast()
|
||||||
{
|
{
|
||||||
// merge the current with the previous version
|
// merge the current with the previous version
|
||||||
|
@ -42,6 +42,8 @@ public:
|
|||||||
virtual std::string checkIn(std::string const & msg) = 0;
|
virtual std::string checkIn(std::string const & msg) = 0;
|
||||||
// can be this operation processed in the current RCS?
|
// can be this operation processed in the current RCS?
|
||||||
virtual bool checkInEnabled() = 0;
|
virtual bool checkInEnabled() = 0;
|
||||||
|
// should a log message provided for next checkin?
|
||||||
|
virtual bool isCheckInWithConfirmation() = 0;
|
||||||
/// check out for editing, returns log
|
/// check out for editing, returns log
|
||||||
virtual std::string checkOut() = 0;
|
virtual std::string checkOut() = 0;
|
||||||
// can be this operation processed in the current RCS?
|
// can be this operation processed in the current RCS?
|
||||||
@ -56,6 +58,8 @@ public:
|
|||||||
virtual bool lockingToggleEnabled() = 0;
|
virtual bool lockingToggleEnabled() = 0;
|
||||||
/// revert current edits
|
/// revert current edits
|
||||||
virtual void revert() = 0;
|
virtual void revert() = 0;
|
||||||
|
// should a confirmation before revert requested?
|
||||||
|
virtual bool isRevertWithConfirmation() = 0;
|
||||||
/// FIXME
|
/// FIXME
|
||||||
virtual void undoLast() = 0;
|
virtual void undoLast() = 0;
|
||||||
// can be this operation processed in the current RCS?
|
// can be this operation processed in the current RCS?
|
||||||
@ -129,6 +133,8 @@ public:
|
|||||||
|
|
||||||
virtual bool checkInEnabled();
|
virtual bool checkInEnabled();
|
||||||
|
|
||||||
|
virtual bool isCheckInWithConfirmation();
|
||||||
|
|
||||||
virtual std::string checkOut();
|
virtual std::string checkOut();
|
||||||
|
|
||||||
virtual bool checkOutEnabled();
|
virtual bool checkOutEnabled();
|
||||||
@ -143,6 +149,8 @@ public:
|
|||||||
|
|
||||||
virtual void revert();
|
virtual void revert();
|
||||||
|
|
||||||
|
virtual bool isRevertWithConfirmation();
|
||||||
|
|
||||||
virtual void undoLast();
|
virtual void undoLast();
|
||||||
|
|
||||||
virtual bool undoLastEnabled();
|
virtual bool undoLastEnabled();
|
||||||
@ -190,6 +198,8 @@ public:
|
|||||||
|
|
||||||
virtual bool checkInEnabled();
|
virtual bool checkInEnabled();
|
||||||
|
|
||||||
|
virtual bool isCheckInWithConfirmation();
|
||||||
|
|
||||||
virtual std::string checkOut();
|
virtual std::string checkOut();
|
||||||
|
|
||||||
virtual bool checkOutEnabled();
|
virtual bool checkOutEnabled();
|
||||||
@ -202,6 +212,8 @@ public:
|
|||||||
|
|
||||||
virtual bool lockingToggleEnabled();
|
virtual bool lockingToggleEnabled();
|
||||||
|
|
||||||
|
virtual bool isRevertWithConfirmation();
|
||||||
|
|
||||||
virtual void revert();
|
virtual void revert();
|
||||||
|
|
||||||
virtual void undoLast();
|
virtual void undoLast();
|
||||||
@ -287,6 +299,8 @@ public:
|
|||||||
|
|
||||||
virtual bool checkInEnabled();
|
virtual bool checkInEnabled();
|
||||||
|
|
||||||
|
virtual bool isCheckInWithConfirmation();
|
||||||
|
|
||||||
virtual std::string checkOut();
|
virtual std::string checkOut();
|
||||||
|
|
||||||
virtual bool checkOutEnabled();
|
virtual bool checkOutEnabled();
|
||||||
@ -301,6 +315,8 @@ public:
|
|||||||
|
|
||||||
virtual void revert();
|
virtual void revert();
|
||||||
|
|
||||||
|
virtual bool isRevertWithConfirmation();
|
||||||
|
|
||||||
virtual void undoLast();
|
virtual void undoLast();
|
||||||
|
|
||||||
virtual bool undoLastEnabled();
|
virtual bool undoLastEnabled();
|
||||||
|
Loading…
Reference in New Issue
Block a user