+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:
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 !
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()) {
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;
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;
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
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?
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);
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;
/**
* 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());
/**
// 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);
+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
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
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;
}
+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
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);
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()
{
form_->changed();
}
+
void QTabularDialog::borderUnset_clicked()
{
form_->controller().set(LyXTabular::UNSET_ALL_LINES);
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();
<rect>
<x>0</x>
<y>0</y>
- <width>480</width>
- <height>383</height>
+ <width>463</width>
+ <height>408</height>
</rect>
</property>
<property stdset="1">
<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>
<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>&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>
<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>&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>Spacer75</cstring>
+ <cstring>rotateCellCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Rotate &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&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>Horizontal</enum>
+ <enum>Vertical</enum>
</property>
<property stdset="1">
<name>sizeType</name>
</size>
</property>
</spacer>
- <widget row="3" column="2" rowspan="1" colspan="2" >
- <class>QGroupBox</class>
- <property stdset="1">
+ <spacer row="0" column="3" >
+ <property>
<name>name</name>
- <cstring>GroupBox38</cstring>
+ <cstring>Spacer75</cstring>
</property>
<property stdset="1">
- <name>title</name>
- <string>Column</string>
+ <name>orientation</name>
+ <enum>Horizontal</enum>
</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&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&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>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget row="2" column="0" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>GroupBox39</cstring>
+ <cstring>multicolumnCB</cstring>
</property>
<property stdset="1">
- <name>title</name>
- <string>Row</string>
+ <name>text</name>
+ <string>&Multicolumn</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Merge cells</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>&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>
</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>&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 &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&X argument:</string>
- </property>
- <property>
- <name>buddy</name>
- <cstring>specialAlignmentED</cstring>
- </property>
- </widget>
</grid>
</widget>
<widget>
</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>
<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>
</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>
<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>
</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>
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;
+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
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);
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;
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();
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."));
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));
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();