InsetListings: properly clear values of widgets when jumping between insets

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18329 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-05-15 02:37:59 +00:00
parent 49cb2e69e7
commit d7ccd7a35f
2 changed files with 23 additions and 2 deletions

View File

@ -183,7 +183,6 @@ void QInclude::build_dialog()
bcview().addReadOnly(dialog_->visiblespaceCB);
bcview().addReadOnly(dialog_->typeCO);
bcview().addReadOnly(dialog_->listingsED);
dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
addCheckedLineEdit(bcview(), dialog_->filenameED, dialog_->filenameLA);
}
@ -204,6 +203,10 @@ void QInclude::update_contents()
dialog_->previewCB->setChecked(false);
dialog_->previewCB->setEnabled(false);
dialog_->listingsGB->setEnabled(false);
dialog_->captionLE->clear();
dialog_->labelLE->clear();
dialog_->listingsED->clear();
dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
string cmdname = controller().params().getCmdName();
if (cmdname != "include" &&

View File

@ -247,8 +247,26 @@ void QListings::update_contents()
dialog_->lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
dialog_->placementLE->setValidator(new QRegExpValidator(QRegExp("[tbph]*"), this));
//
// set default values
dialog_->listingsTB->setPlainText("Input listings parameters on the right. Enter ? for a list of parameters.");
dialog_->languageCO->setCurrentIndex(
dialog_->languageCO->findText(toqstr("no language")));
dialog_->floatCB->setChecked(false);
dialog_->placementLE->clear();
dialog_->numberLeftCB->setChecked(false);
dialog_->numberRightCB->setChecked(false);
dialog_->numberStepLE->clear();
dialog_->numberFontSizeCO->setCurrentIndex(
dialog_->numberFontSizeCO->findText(toqstr("default")));
dialog_->firstlineLE->clear();
dialog_->lastlineLE->clear();
dialog_->fontstyleCO->setCurrentIndex(
dialog_->fontstyleCO->findText(toqstr("default")));
dialog_->fontsizeCO->setCurrentIndex(
dialog_->fontsizeCO->findText(toqstr("default")));
dialog_->breaklinesCB->setChecked(false);
dialog_->spaceCB->setChecked(false);
dialog_->extendedcharsCB->setChecked(false);
// set values from param string
InsetListingsParams & params = controller().params();