Use Dispatch in FormTabCreate, some minor tidying.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1325 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2001-01-12 15:12:18 +00:00
parent 0f4053721e
commit 0c2bbc6801
5 changed files with 42 additions and 52 deletions

View File

@ -0,0 +1,11 @@
2000-01-12 John Levon <moz@compsoc.man.ac.uk>
* FormTabularCreate.C: use LFUN_INSET_TABULAR Dispatch
instead of creating by hand
* FormUrl.C: add accelerators for Close and Cancel
* paradlg.C: add accelerators for Close and Cancel,
clean the code up a little
* printdlg.C: add FIXME for later

View File

@ -22,6 +22,7 @@
#include "QtLyXView.h"
#include "BufferView.h"
#include "insets/insettabular.h"
#include "support/lstrings.h"
FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d)
: dialog_(0), lv_(v), d_(d), h_(0)
@ -42,9 +43,8 @@ void FormTabularCreate::apply(unsigned int rows, unsigned cols)
if (!lv_->view()->available())
return;
InsetTabular * in = new InsetTabular(*lv_->buffer(), rows, cols);
if (!lv_->view()->open_new_inset(in))
delete in;
string tmp = tostr(rows) + " " + tostr(cols);
lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
}
void FormTabularCreate::show()

View File

@ -83,14 +83,14 @@ void FormUrl::update(bool switched)
dialog_->urlname->setFocusPolicy(QWidget::NoFocus);
dialog_->url->setFocusPolicy(QWidget::NoFocus);
dialog_->buttonOk->setEnabled(false);
dialog_->buttonCancel->setText(_("Close"));
dialog_->buttonCancel->setText(_("&Close"));
dialog_->htmlurl->setEnabled(false);
} else {
dialog_->urlname->setFocusPolicy(QWidget::StrongFocus);
dialog_->url->setFocusPolicy(QWidget::StrongFocus);
dialog_->url->setFocus();
dialog_->buttonOk->setEnabled(true);
dialog_->buttonCancel->setText(_("Cancel"));
dialog_->buttonCancel->setText(_("&Cancel"));
dialog_->htmlurl->setEnabled(true);
}
}

View File

@ -86,7 +86,7 @@ void ParaDialog::setReadOnly(bool readonly)
ok->setEnabled(!readonly);
apply->setEnabled(!readonly);
restore->setEnabled(!readonly);
cancel->setText(readonly ? _("Close") : _("Cancel"));
cancel->setText(readonly ? _("&Close") : _("&Cancel"));
}
void ParaDialog::setLabelWidth(const char *text)
@ -130,52 +130,29 @@ void ParaDialog::setChecks(bool labove, bool lbelow, bool pabove, bool pbelow, b
void ParaDialog::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow)
{
int item;
switch (kindabove) {
case VSpace::NONE:
generalpage->abovepage->spaceabove->setCurrentItem(0);
break;
case VSpace::DEFSKIP:
generalpage->abovepage->spaceabove->setCurrentItem(1);
break;
case VSpace::SMALLSKIP:
generalpage->abovepage->spaceabove->setCurrentItem(2);
break;
case VSpace::MEDSKIP:
generalpage->abovepage->spaceabove->setCurrentItem(3);
break;
case VSpace::BIGSKIP:
generalpage->abovepage->spaceabove->setCurrentItem(4);
break;
case VSpace::VFILL:
generalpage->abovepage->spaceabove->setCurrentItem(5);
break;
case VSpace::LENGTH:
generalpage->abovepage->spaceabove->setCurrentItem(6);
break;
case VSpace::NONE: item = 0; break;
case VSpace::DEFSKIP: item = 1; break;
case VSpace::SMALLSKIP: item = 2; break;
case VSpace::MEDSKIP: item = 3; break;
case VSpace::BIGSKIP: item = 4; break;
case VSpace::VFILL: item = 5; break;
case VSpace::LENGTH: item = 6; break;
}
generalpage->abovepage->spaceabove->setCurrentItem(item);
switch (kindbelow) {
case VSpace::NONE:
generalpage->belowpage->spacebelow->setCurrentItem(0);
break;
case VSpace::DEFSKIP:
generalpage->belowpage->spacebelow->setCurrentItem(1);
break;
case VSpace::SMALLSKIP:
generalpage->belowpage->spacebelow->setCurrentItem(2);
break;
case VSpace::MEDSKIP:
generalpage->belowpage->spacebelow->setCurrentItem(3);
break;
case VSpace::BIGSKIP:
generalpage->belowpage->spacebelow->setCurrentItem(4);
break;
case VSpace::VFILL:
generalpage->belowpage->spacebelow->setCurrentItem(5);
break;
case VSpace::LENGTH:
generalpage->belowpage->spacebelow->setCurrentItem(6);
break;
case VSpace::NONE: item = 0; break;
case VSpace::DEFSKIP: item = 1; break;
case VSpace::SMALLSKIP: item = 2; break;
case VSpace::MEDSKIP: item = 3; break;
case VSpace::BIGSKIP: item = 4; break;
case VSpace::VFILL: item = 5; break;
case VSpace::LENGTH: item = 6; break;
}
generalpage->belowpage->spacebelow->setCurrentItem(item);
generalpage->abovepage->spaceabovevalue->setEnabled(kindabove == VSpace::LENGTH);
generalpage->abovepage->spaceabovevalueunits->setEnabled(kindabove == VSpace::LENGTH);

View File

@ -18,6 +18,8 @@
#define Inherited PrintDialogData
/* FIXME: tab order is out of whack */
PrintDialog::PrintDialog(FormPrint *f, QWidget* parent, const char * name)
: PrintDialogData(parent, name), form_(f)
{