Fix up Alert::prompt for cancel button stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6863 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-04-27 16:40:50 +00:00
parent eab8eaec5c
commit d6546c2bf4
17 changed files with 166 additions and 314 deletions

View File

@ -1,3 +1,10 @@
2003-04-27 John Levon <levon@movementarian.org>
* bufferlist.C:
* lyx_cb.C:
* lyxfunc.C:
* lyxvc.C: specify cancel button in Alert::prompt
2003-04-26 John Levon <levon@movementarian.org>
* text3.C:

View File

@ -78,7 +78,7 @@ bool BufferList::quitWriteBuffer(Buffer * buf)
text += file + _(" has unsaved changes.\n\nWhat do you want to do with it?");
#endif
int const ret = Alert::prompt(_("Save changed document?"),
text, 0, _("&Save"), _("&Discard"), _("&Cancel"));
text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
if (ret == 0) {
// FIXME: WriteAs can be asynch !
@ -187,7 +187,7 @@ bool BufferList::close(Buffer * buf, bool ask)
text += fname + _(" has unsaved changes.\n\nWhat do you want to do with it?");
#endif
int const ret = Alert::prompt(_("Save changed document?"),
text, 0, _("&Save"), _("&Discard"), _("&Cancel"));
text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel"));
if (ret == 0) {
if (buf->isUnnamed()) {
@ -368,7 +368,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
text += file + _(" exists.\n\nRecover emergency save?");
#endif
int const ret = Alert::prompt(_("Load emergency save?"),
text, 0, _("&Recover"), _("&Load Original"));
text, 0, 1, _("&Recover"), _("&Load Original"));
if (ret == 0) {
ts = e;
@ -402,7 +402,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
text += file + _(" is newer.\n\nLoad the backup instead?");
#endif
int const ret = Alert::prompt(_("Load backup?"),
text, 0, _("&Load backup"), _("Load &original"));
text, 0, 1, _("&Load backup"), _("Load &original"));
if (ret == 0) {
ts = a;
@ -525,7 +525,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
text += file + _(" is already loaded.\n\nDo you want to revert to the saved version?");
#endif
int const ret = Alert::prompt(_("Revert to saved document?"),
text, 1, _("&Revert"), _("&Switch to document"));
text, 0, 1, _("&Revert"), _("&Switch to document"));
if (ret == 0) {
// FIXME: should be LFUN_REVERT
@ -565,7 +565,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
text += file + _(" from version control?");
#endif
int const ret = Alert::prompt(_("Retrieve from version control?"),
text, 0, _("&Retrieve"), _("&Cancel"));
text, 0, 1, _("&Retrieve"), _("&Cancel"));
if (ret == 0) {
// How can we know _how_ to do the checkout?
@ -585,7 +585,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
text += file + _(" does not yet exist.\n\nDo you want to create a new document?");
#endif
int const ret = Alert::prompt(_("Create new document?"),
text, 0, _("&Create"), _("Cancel"));
text, 0, 1, _("&Create"), _("Cancel"));
if (ret == 0)
b = newFile(s, string(), true);

View File

@ -22,11 +22,12 @@ using std::pair;
using std::make_pair;
int Alert::prompt(string const & title, string const & question,
int default_button,
int default_button, int escape_button,
string const & b1, string const & b2, string const & b3)
{
if (lyx_gui::use_gui)
return prompt_pimpl(title, question, default_button, b1, b2, b3);
return prompt_pimpl(title, question,
default_button, escape_button, b1, b2, b3);
lyxerr << title << endl;
lyxerr << "----------------------------------------" << endl;

View File

@ -20,16 +20,17 @@ namespace Alert {
/**
* Prompt for a question. Returns 0-2 for the chosen button.
* Set default_button to a reasonable value. b1-b3 should have
* accelerators marked with an '&'. title should be a short summary.
* Strings should be gettextised. Please think about the poor user.
* Set default_button and cancel_button to reasonable values. b1-b3
* should have accelerators marked with an '&'. title should be
* a short summary. Strings should be gettextised.
* Please think about the poor user.
*
* Remember to use boost::format. If you make any of these buttons
* "Yes" or "No", I will personally come around to your house and
* slap you with fish, and not in an enjoyable way either.
*/
int prompt(string const & title, string const & question,
int default_button,
int default_button, int cancel_button,
string const & b1, string const & b2, string const & b3 = string());
/**

View File

@ -13,7 +13,7 @@
// GUI-specific implementations
int prompt_pimpl(string const & title, string const & question,
int default_button,
int default_button, int escape_button,
string const & b1, string const & b2, string const & b3);
void warning_pimpl(string const & title, string const & warning);

View File

@ -1,3 +1,9 @@
2003-04-27 John Levon <levon@movementarian.org>
* Alert.h:
* Alert.C:
* Alert_pimpl.h: ::prompt() takes cancel_button
2003-04-16 Alfredo Braunstein <abraunst@libero.it>
* screen.C (redraw): added a missing call to updateRowPositions

View File

@ -30,7 +30,7 @@ using std::pair;
using std::make_pair;
int prompt_pimpl(string const & tit, string const & question,
int default_button,
int default_button, int cancel_button,
string const & b1, string const & b2, string const & b3)
{
#if USE_BOOST_FORMAT
@ -41,9 +41,14 @@ int prompt_pimpl(string const & tit, string const & question,
string const title = _("LyX: ") + tit;
#endif
return QMessageBox::information(0, toqstr(title), toqstr(formatted(question)),
int res = QMessageBox::information(0, toqstr(title), toqstr(formatted(question)),
toqstr(b1), toqstr(b2), b3.empty() ? QString::null : toqstr(b3),
default_button);
default_button, cancel_button);
// Qt bug: can return -1 on cancel or WM close, despite the docs.
if (res == -1)
res = cancel_button;
return res;
}

View File

@ -1,3 +1,12 @@
2003-04-27 John Levon <levon@movementarian.org>
* Alert_pimpl.C: handle cancel_button
* QTabular.C:
* QTabularDialog.C:
* QTabularDialog.h:
* ui/QTabularDialogBase.ui: ui fixes
2003-04-23 John Levon <levon@movementarian.org>
* QCitationDialog.C: close dialog on return in listbox

View File

@ -53,10 +53,6 @@ void QTabular::build_dialog()
bcview().addReadOnly(dialog_->widthUnit);
bcview().addReadOnly(dialog_->hAlignCB);
bcview().addReadOnly(dialog_->vAlignCB);
bcview().addReadOnly(dialog_->columnAddPB);
bcview().addReadOnly(dialog_->columnDeletePB);
bcview().addReadOnly(dialog_->rowAddPB);
bcview().addReadOnly(dialog_->rowDeletePB);
bcview().addReadOnly(dialog_->borderSetPB);
bcview().addReadOnly(dialog_->borderUnsetPB);
bcview().addReadOnly(dialog_->borders);

View File

@ -50,34 +50,12 @@ void QTabularDialog::closeEvent(QCloseEvent * e)
e->accept();
}
void QTabularDialog::close_clicked()
{
form_->closeGUI();
}
void QTabularDialog::columnAppend_clicked()
{
form_->controller().set(LyXTabular::APPEND_COLUMN);
}
void QTabularDialog::rowAppend_clicked()
{
form_->controller().set(LyXTabular::APPEND_ROW);
}
void QTabularDialog::columnDelete_clicked()
{
form_->controller().set(LyXTabular::DELETE_COLUMN);
}
void QTabularDialog::rowDelete_clicked()
{
form_->controller().set(LyXTabular::DELETE_ROW);
}
void QTabularDialog::borderSet_clicked()
{
@ -86,6 +64,7 @@ void QTabularDialog::borderSet_clicked()
form_->changed();
}
void QTabularDialog::borderUnset_clicked()
{
form_->controller().set(LyXTabular::UNSET_ALL_LINES);

View File

@ -28,10 +28,6 @@ protected slots:
virtual void change_adaptor();
virtual void close_clicked();
virtual void columnAppend_clicked();
virtual void rowAppend_clicked();
virtual void columnDelete_clicked();
virtual void rowDelete_clicked();
virtual void borderSet_clicked();
virtual void borderUnset_clicked();
virtual void leftBorder_changed();

View File

@ -13,8 +13,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>383</height>
<width>463</width>
<height>408</height>
</rect>
</property>
<property stdset="1">
@ -71,7 +71,7 @@
<name>spacing</name>
<number>6</number>
</property>
<widget row="0" column="0" >
<widget row="0" column="0" rowspan="1" colspan="2" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
@ -86,22 +86,7 @@
<cstring>hAlignCB</cstring>
</property>
</widget>
<widget row="0" column="3" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>multicolumnCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Multicolumn</string>
</property>
<property>
<name>toolTip</name>
<string>Merge cells</string>
</property>
</widget>
<widget row="0" column="1" >
<widget row="0" column="2" >
<class>QComboBox</class>
<item>
<property>
@ -136,7 +121,88 @@
<string>Horizontal alignment in column</string>
</property>
</widget>
<spacer row="0" column="2" >
<widget row="3" column="0" rowspan="1" colspan="4" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>rotateTabularCB</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>true</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Rotate table 90 degrees</string>
</property>
<property>
<name>toolTip</name>
<string>Rotate the table by 90 degrees</string>
</property>
</widget>
<widget row="4" column="0" rowspan="1" colspan="4" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>rotateCellCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Rotate &amp;cell 90 degrees</string>
</property>
<property>
<name>toolTip</name>
<string>Rotate this cell by 90 degrees</string>
</property>
</widget>
<widget row="5" column="0" rowspan="1" colspan="2" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>specialAlignmentLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>LaTe&amp;X argument:</string>
</property>
<property>
<name>buddy</name>
<cstring>specialAlignmentED</cstring>
</property>
</widget>
<widget row="5" column="2" rowspan="1" colspan="2" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>specialAlignmentED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Custom column format (LaTeX)</string>
</property>
</widget>
<spacer row="6" column="2" >
<property>
<name>name</name>
<cstring>Spacer5</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<spacer row="0" column="3" >
<property>
<name>name</name>
<cstring>Spacer75</cstring>
@ -157,125 +223,22 @@
</size>
</property>
</spacer>
<widget row="3" column="2" rowspan="1" colspan="2" >
<class>QGroupBox</class>
<widget row="2" column="0" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox38</cstring>
<cstring>multicolumnCB</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Column</string>
<name>text</name>
<string>&amp;Multicolumn</string>
</property>
<property>
<name>toolTip</name>
<string>Merge cells</string>
</property>
<grid>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget row="0" column="0" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>columnAddPB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>A&amp;dd</string>
</property>
<property stdset="1">
<name>autoDefault</name>
<bool>false</bool>
</property>
<property>
<name>toolTip</name>
<string>Append column (right)</string>
</property>
</widget>
<widget row="0" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>columnDeletePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>De&amp;lete</string>
</property>
<property stdset="1">
<name>autoDefault</name>
<bool>false</bool>
</property>
<property>
<name>toolTip</name>
<string>Delete current column</string>
</property>
</widget>
</grid>
</widget>
<widget row="3" column="0" rowspan="1" colspan="2" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox39</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Row</string>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>rowAddPB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Add</string>
</property>
<property stdset="1">
<name>autoDefault</name>
<bool>false</bool>
</property>
<property>
<name>toolTip</name>
<string>Append row (below)</string>
</property>
</widget>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>rowDeletePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Delete</string>
</property>
<property stdset="1">
<name>autoDefault</name>
<bool>false</bool>
</property>
<property>
<name>toolTip</name>
<string>Delete this row</string>
</property>
</widget>
</hbox>
</widget>
<widget row="2" column="0" rowspan="1" colspan="3" >
<widget row="1" column="0" rowspan="1" colspan="4" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
@ -400,87 +363,6 @@
</widget>
</grid>
</widget>
<widget row="2" column="3" >
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox21</cstring>
</property>
<property stdset="1">
<name>title</name>
<string>Rotate 90 degrees</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>rotateTabularCB</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>true</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Rotate Table</string>
</property>
<property>
<name>toolTip</name>
<string>Rotate the table by 90 degrees</string>
</property>
</widget>
<widget>
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>rotateCellCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Rotate &amp;Cell</string>
</property>
<property>
<name>toolTip</name>
<string>Rotate this cell by 90 degrees</string>
</property>
</widget>
</vbox>
</widget>
<widget row="1" column="1" rowspan="1" colspan="3" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>specialAlignmentED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Custom column format (LaTeX)</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>specialAlignmentLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>LaTe&amp;X argument:</string>
</property>
<property>
<name>buddy</name>
<cstring>specialAlignmentED</cstring>
</property>
</widget>
</grid>
</widget>
<widget>
@ -1389,24 +1271,6 @@
</image>
</images>
<connections>
<connection>
<sender>columnAddPB</sender>
<signal>clicked()</signal>
<receiver>QTabularDialogBase</receiver>
<slot>columnAppend_clicked()</slot>
</connection>
<connection>
<sender>rowAddPB</sender>
<signal>clicked()</signal>
<receiver>QTabularDialogBase</receiver>
<slot>rowAppend_clicked()</slot>
</connection>
<connection>
<sender>columnDeletePB</sender>
<signal>clicked()</signal>
<receiver>QTabularDialogBase</receiver>
<slot>columnDelete_clicked()</slot>
</connection>
<connection>
<sender>borderSetPB</sender>
<signal>clicked()</signal>
@ -1431,12 +1295,6 @@
<receiver>newpageCB</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>rowDeletePB</sender>
<signal>clicked()</signal>
<receiver>QTabularDialogBase</receiver>
<slot>rowDelete_clicked()</slot>
</connection>
<connection>
<sender>hAlignCB</sender>
<signal>activated(int)</signal>
@ -1613,14 +1471,11 @@
</connection>
<slot access="protected">borderSet_clicked()</slot>
<slot access="protected">borderUnset_clicked()</slot>
<slot access="protected">border_toggled()</slot>
<slot access="protected">bottomBorder_changed()</slot>
<slot access="protected">change_adaptor()</slot>
<slot access="protected">close_clicked()</slot>
<slot access="protected">columnAppend_clicked()</slot>
<slot access="protected">columnDelete_clicked()</slot>
<slot access="protected">hAlign_changed(int)</slot>
<slot access="protected">leftBorder_changed()</slot>
<slot access="public">longTabular()</slot>
<slot access="protected">ltFirstHeaderBorderAbove_clicked()</slot>
<slot access="protected">ltFirstHeaderBorderBelow_clicked()</slot>
<slot access="protected">ltFirstHeaderEmpty_clicked()</slot>
@ -1637,12 +1492,9 @@
<slot access="protected">ltLastFooterStatus_clicked()</slot>
<slot access="protected">ltNewpage_clicked()</slot>
<slot access="protected">multicolumn_clicked()</slot>
<slot access="public">longTabular()</slot>
<slot access="protected">rightBorder_changed()</slot>
<slot access="protected">rotateCell()</slot>
<slot access="protected">rotateTabular()</slot>
<slot access="protected">rowAppend_clicked()</slot>
<slot access="protected">rowDelete_clicked()</slot>
<slot access="public">setEnabled(bool)</slot>
<slot access="protected">specialAlignment_changed()</slot>
<slot access="protected">topBorder_changed()</slot>
@ -1651,36 +1503,32 @@
</connections>
<tabstops>
<tabstop>TabWidget</tabstop>
<tabstop>specialAlignmentED</tabstop>
<tabstop>columnAddPB</tabstop>
<tabstop>columnDeletePB</tabstop>
<tabstop>rowAddPB</tabstop>
<tabstop>rowDeletePB</tabstop>
<tabstop>hAlignCB</tabstop>
<tabstop>multicolumnCB</tabstop>
<tabstop>widthED</tabstop>
<tabstop>widthUnit</tabstop>
<tabstop>vAlignCB</tabstop>
<tabstop>multicolumnCB</tabstop>
<tabstop>rotateTabularCB</tabstop>
<tabstop>rotateCellCB</tabstop>
<tabstop>closePB</tabstop>
<tabstop>specialAlignmentED</tabstop>
<tabstop>borderSetPB</tabstop>
<tabstop>borderUnsetPB</tabstop>
<tabstop>longTabularCB</tabstop>
<tabstop>headerStatusCB</tabstop>
<tabstop>firstheaderStatusCB</tabstop>
<tabstop>footerStatusCB</tabstop>
<tabstop>lastfooterStatusCB</tabstop>
<tabstop>headerBorderAboveCB</tabstop>
<tabstop>headerBorderBelowCB</tabstop>
<tabstop>firstheaderStatusCB</tabstop>
<tabstop>firstheaderBorderAboveCB</tabstop>
<tabstop>firstheaderBorderBelowCB</tabstop>
<tabstop>firstheaderNoContentsCB</tabstop>
<tabstop>footerStatusCB</tabstop>
<tabstop>footerBorderAboveCB</tabstop>
<tabstop>footerBorderBelowCB</tabstop>
<tabstop>lastfooterStatusCB</tabstop>
<tabstop>lastfooterBorderAboveCB</tabstop>
<tabstop>lastfooterBorderBelowCB</tabstop>
<tabstop>footerBorderBelowCB</tabstop>
<tabstop>firstheaderBorderBelowCB</tabstop>
<tabstop>headerBorderBelowCB</tabstop>
<tabstop>lastfooterNoContentsCB</tabstop>
<tabstop>firstheaderNoContentsCB</tabstop>
<tabstop>newpageCB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
</UI>

View File

@ -44,7 +44,7 @@ void information_pimpl(string const &, string const & message)
int prompt_pimpl(string const &, string const & question,
int default_button,
int default_button, int /*escape_button*/,
string const & b1, string const & b2, string const & b3)
{
string b1label, b1sc;

View File

@ -1,3 +1,7 @@
2003-04-27 John Levon <levon@movementarian.org>
* Alert_pimpl.C: ignore cancel_button (for now)
2003-04-15 John Levon <levon@movementarian.org>
* Toolbar_pimpl.C: ignore Minibuffer

View File

@ -96,7 +96,7 @@ bool MenuWrite(BufferView * bv, Buffer * buffer)
text += file + _(" could not be saved.\n\nDo you want to rename the document and try again?");
#endif
int const ret = Alert::prompt(_("Rename and save?"),
text, 0, _("&Rename"), _("&Cancel"));
text, 0, 1, _("&Rename"), _("&Cancel"));
if (ret == 0)
return WriteAs(bv, buffer);
@ -155,7 +155,7 @@ bool WriteAs(BufferView * bv, Buffer * buffer, string const & filename)
text += file + _(" already exists.\n\nDo you want to over-write that document?");
#endif
int const ret = Alert::prompt(_("Over-write document?"),
text, 1, _("&Over-write"), _("&Cancel"));
text, 0, 1, _("&Over-write"), _("&Cancel"));
if (ret == 1)
return false;

View File

@ -1085,7 +1085,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
text += file + _("?");
#endif
int const ret = Alert::prompt(_("Revert to saved document?"),
text, 1, _("&Revert"), _("&Cancel"));
text, 0, 1, _("&Revert"), _("&Cancel"));
if (ret == 0)
view()->reload();
@ -1935,7 +1935,7 @@ void LyXFunc::doImport(string const & argument)
text += file + _(" already exists.\n\nDo you want to over-write that document?");
#endif
int const ret = Alert::prompt(_("Over-write document?"),
text, 1, _("&Over-write"), _("&Cancel"));
text, 0, 1, _("&Over-write"), _("&Cancel"));
if (ret == 1) {
owner->message(_("Canceled."));

View File

@ -89,7 +89,7 @@ bool LyXVC::ensureClean()
text += file + _(" has unsaved changes.\n\nDo you want to save the document?");
#endif
int const ret = Alert::prompt(_("Save changed document?"),
text, 0, _("&Save"), _("&Cancel"));
text, 0, 1, _("&Save"), _("&Cancel"));
if (ret == 0) {
vcs->owner()->getUser()->owner()->dispatch(FuncRequest(LFUN_MENUWRITE));
@ -203,7 +203,7 @@ void LyXVC::revert()
text += file + _(" will lose all current changes.\n\nDo you want to revert to the saved version?");
#endif
int const ret = Alert::prompt(_("Revert to stored version of document?"),
text, 1, _("&Revert"), _("&Cancel"));
text, 0, 1, _("&Revert"), _("&Cancel"));
if (ret == 0)
vcs->revert();