Texinfo path issue repaired, Bibtex style combo, Citation, External re-layout.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4762 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2002-07-23 13:12:55 +00:00
parent 10aefc07a0
commit c4c506908d
12 changed files with 728 additions and 777 deletions

View File

@ -1,3 +1,17 @@
2002-07-23 Edwin Leuven <leuven@fee.uva.nl>
* QBibtex.C: syle combobox instead of listbox
* QBibtexDialog.C:
* ui/QBibtexDialog.ui
* QTexinfo.C: Repair view without path/selection
* QTexinfo.h
* QTexinfoDialog.C
* QTexinfoDialog.h
* ui/QTexinfoDialog.ui
* ui/QCitationDialog.ui: layout fix
* ui/QExternalDialog.ui: idem
* TODO: update
2002-07-23 John Levon <moz@compsoc.man.ac.uk>
* QCommandBuffer.C: real compile fix

View File

@ -41,10 +41,8 @@ void QBibtex::build_dialog()
bc().setCancel(dialog_->closePB);
bc().addReadOnly(dialog_->databaseLB);
bc().addReadOnly(dialog_->databasePB);
bc().addReadOnly(dialog_->styleED);
bc().addReadOnly(dialog_->stylePB);
bc().addReadOnly(dialog_->styleListLB);
bc().addReadOnly(dialog_->styleListPB);
bc().addReadOnly(dialog_->styleCB);
bc().addReadOnly(dialog_->bibtocCB);
bc().addReadOnly(dialog_->databasePB);
bc().addReadOnly(dialog_->deletePB);
@ -80,15 +78,14 @@ void QBibtex::update_contents()
} else
dialog_->bibtocCB->setChecked(false);
dialog_->styleED->setText(bibstyle.c_str());
vector<string> const str = getVectorFromString(
controller().getBibStyles(),"\n");
for (vector<string>::const_iterator it = str.begin();
it != str.end(); ++it) {
dialog_->styleListLB->insertItem(ChangeExtension(*it,"").c_str());
dialog_->styleCB->insertItem(ChangeExtension(*it,"").c_str());
}
dialog_->styleCB->insertItem(bibstyle.c_str(),0);
}
@ -103,7 +100,7 @@ void QBibtex::apply()
}
controller().params().setContents(dbs);
string bibstyle(dialog_->styleED->text().latin1());
string bibstyle(dialog_->styleCB->text(0).latin1());
bool const bibtotoc(dialog_->bibtocCB->isChecked());
@ -123,5 +120,5 @@ void QBibtex::apply()
bool QBibtex::isValid()
{
return dialog_->databaseLB->count() != 0 &&
!string(dialog_->styleED->text()).empty();
!string(dialog_->styleCB->text(0)).empty();
}

View File

@ -19,7 +19,6 @@
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qfiledialog.h>
@ -45,10 +44,15 @@ void QBibtexDialog::change_adaptor()
void QBibtexDialog::browsePressed()
{
QString file = QFileDialog::getOpenFileName(QString::null,
_("BibTeX style files (*.bst)"), this, 0, _("Select a BibTeX style"));
QString file =
QFileDialog::getOpenFileName(QString::null,
_("BibTeX style files (*.bst)"),
this,
0,
_("Select a BibTeX style"));
if (!file.isNull()) {
styleED->setText(ChangeExtension(OnlyFilename(file.latin1()), "").c_str());
string const filen = ChangeExtension(OnlyFilename(file.latin1()), "");
styleCB->insertItem(filen.c_str(),0);
form_->changed();
}
}
@ -81,7 +85,7 @@ void QBibtexDialog::deletePressed()
void QBibtexDialog::styleChanged(const QString & sel)
{
styleED->setText(sel);
styleCB->insertItem(sel,0);
}

View File

@ -50,13 +50,25 @@ void QTexinfo::build_dialog()
void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
{
bool const withFullPath = dialog_->path->isChecked();
string const str = controller().getContents(whichStyle, withFullPath);
std::vector<string> flist = getVectorFromString(str, "\n");
string const fstr = controller().getContents(whichStyle, true);
switch (whichStyle) {
case ControlTexinfo::bst:
bst_ = getVectorFromString(fstr, "\n");
break;
case ControlTexinfo::cls:
cls_ = getVectorFromString(fstr, "\n");
break;
case ControlTexinfo::sty:
sty_ = getVectorFromString(fstr, "\n");
break;
}
dialog_->fileList->clear();
bool const withFullPath = dialog_->path->isChecked();
string const str = controller().getContents(whichStyle, withFullPath);
vector<string> flist = getVectorFromString(str, "\n");
for (vector<string>::const_iterator fitem = flist.begin();
fitem != flist.end(); ++fitem) {
dialog_->fileList->insertItem((*fitem).c_str());
@ -70,3 +82,9 @@ void QTexinfo::updateStyles()
{
updateStyles(activeStyle);
}

View File

@ -44,7 +44,12 @@ private:
bool warningPosted;
///
ControlTexinfo::texFileSuffix activeStyle;
///
vector<string> cls_;
///
vector<string> sty_;
///
vector<string> bst_;
};
#endif // QTEXINFO_H

View File

@ -45,11 +45,28 @@ void QTexinfoDialog::rescanClicked()
// build new *Files.lst
form_->controller().rescanStyles();
form_->updateStyles();
enableViewPB();
}
void QTexinfoDialog::viewClicked()
{
string const sel(fileList->currentText());
int const fitem = fileList->currentItem();
string sel;
switch (whatStyle->currentItem()) {
case 0:
sel = form_->cls_[fitem];
break;
case 1:
sel = form_->sty_[fitem];
break;
case 2:
sel = form_->bst_[fitem];
break;
default:
break;
}
// a valid entry?
if (!sel.empty()) {
form_->controller().viewFile(sel.c_str());
@ -58,9 +75,7 @@ void QTexinfoDialog::viewClicked()
void QTexinfoDialog::update()
{
int item = whatStyle->currentItem();
switch (item) {
switch (whatStyle->currentItem()) {
case 0:
form_->updateStyles(ControlTexinfo::cls);
break;
@ -73,5 +88,14 @@ void QTexinfoDialog::update()
default:
break;
}
enableViewPB();
}
void QTexinfoDialog::enableViewPB()
{
viewPB->setEnabled(fileList->currentItem()>-1);
}

View File

@ -26,10 +26,10 @@ protected slots:
virtual void rescanClicked();
virtual void viewClicked();
virtual void update();
virtual void enableViewPB();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QTexinfo * form_;
};

View File

@ -98,10 +98,6 @@ QTabular
- implement me (need MVC) (*)
QTexinfo
- fix "View" when path not shown
QtView
- decide what to do about prohibit/allowInput

View File

@ -14,7 +14,7 @@
<x>0</x>
<y>0</y>
<width>301</width>
<height>435</height>
<height>318</height>
</rect>
</property>
<property stdset="1">
@ -34,7 +34,7 @@
<name>spacing</name>
<number>6</number>
</property>
<widget row="10" column="0" rowspan="1" colspan="2" >
<widget row="8" column="0" rowspan="1" colspan="2" >
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
@ -124,21 +124,6 @@
<name>vAlign</name>
</property>
</widget>
<widget row="1" column="0" rowspan="2" colspan="1" >
<class>QListBox</class>
<property stdset="1">
<name>name</name>
<cstring>databaseLB</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>true</bool>
</property>
<property>
<name>toolTip</name>
<string>Available BibTeX databases</string>
</property>
</widget>
<widget row="1" column="1" >
<class>QPushButton</class>
<property stdset="1">
@ -158,41 +143,7 @@
<string>Add a BibTeX database file</string>
</property>
</widget>
<widget row="2" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>deletePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Delete</string>
</property>
<property>
<name>toolTip</name>
<string>Remove the selected database</string>
</property>
</widget>
<widget row="3" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>styleLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>St&amp;yle</string>
</property>
<property>
<name>buddy</name>
<cstring>styleED</cstring>
</property>
<property>
<name>toolTip</name>
<string>The BibTeX style</string>
</property>
</widget>
<widget row="4" column="1" >
<widget row="5" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
@ -211,22 +162,7 @@
<string>Choose a style file</string>
</property>
</widget>
<widget row="8" column="0" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>bibtocCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Add bibliography to &amp;TOC</string>
</property>
<property>
<name>toolTip</name>
<string>Add bibliography to the table of contents</string>
</property>
</widget>
<widget row="7" column="1" >
<widget row="6" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
@ -245,54 +181,74 @@
<string>Update style list</string>
</property>
</widget>
<widget row="4" column="0" >
<class>QLineEdit</class>
<widget row="5" column="0" >
<class>QComboBox</class>
<property stdset="1">
<name>name</name>
<cstring>styleED</cstring>
<cstring>styleCB</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
<name>editable</name>
<bool>true</bool>
</property>
<property>
<name>toolTip</name>
<string>The name of the style to use</string>
<property stdset="1">
<name>autoCompletion</name>
<bool>true</bool>
</property>
<property stdset="1">
<name>duplicatesEnabled</name>
<bool>false</bool>
</property>
</widget>
<widget row="5" column="0" >
<class>QLabel</class>
<widget row="7" column="0" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>styleListL</cstring>
<cstring>bibtocCB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>A&amp;vailable styles</string>
</property>
<property>
<name>buddy</name>
<cstring>styleListLB</cstring>
</property>
</widget>
<widget row="6" column="0" rowspan="2" colspan="1" >
<class>QListBox</class>
<property stdset="1">
<name>name</name>
<cstring>styleListLB</cstring>
<string>Add bibliography to &amp;TOC</string>
</property>
<property>
<name>toolTip</name>
<string>List of available styles</string>
<string>Add bibliography to the table of contents</string>
</property>
</widget>
<spacer row="6" column="1" >
<widget row="2" column="1" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>deletePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Delete</string>
</property>
<property>
<name>toolTip</name>
<string>Remove the selected database</string>
</property>
</widget>
<widget row="1" column="0" rowspan="3" colspan="1" >
<class>QListBox</class>
<property stdset="1">
<name>name</name>
<cstring>databaseLB</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>true</bool>
</property>
<property>
<name>toolTip</name>
<string>Available BibTeX databases</string>
</property>
</widget>
<spacer row="3" column="1" >
<property>
<name>name</name>
<cstring>Spacer5</cstring>
<cstring>Spacer4</cstring>
</property>
<property stdset="1">
<name>orientation</name>
@ -310,6 +266,25 @@
</size>
</property>
</spacer>
<widget row="4" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>styleLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>St&amp;yle</string>
</property>
<property>
<name>buddy</name>
<cstring>styleCB</cstring>
</property>
<property>
<name>toolTip</name>
<string>The BibTeX style</string>
</property>
</widget>
</grid>
</widget>
<connections>
@ -343,24 +318,6 @@
<receiver>QBibtexDialogBase</receiver>
<slot>databaseChanged()</slot>
</connection>
<connection>
<sender>styleED</sender>
<signal>returnPressed()</signal>
<receiver>QBibtexDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
<sender>styleED</sender>
<signal>textChanged(const QString&amp;)</signal>
<receiver>QBibtexDialogBase</receiver>
<slot>change_adaptor()</slot>
</connection>
<connection>
<sender>styleListLB</sender>
<signal>highlighted(const QString&amp;)</signal>
<receiver>QBibtexDialogBase</receiver>
<slot>styleChanged(const QString &amp;)</slot>
</connection>
<slot access="public">addPressed()</slot>
<slot access="public">browsePressed()</slot>
<slot access="public">change_adaptor()</slot>
@ -372,9 +329,8 @@
<tabstop>databaseLB</tabstop>
<tabstop>databasePB</tabstop>
<tabstop>deletePB</tabstop>
<tabstop>styleED</tabstop>
<tabstop>stylePB</tabstop>
<tabstop>styleListLB</tabstop>
<tabstop>styleCB</tabstop>
<tabstop>styleListPB</tabstop>
<tabstop>bibtocCB</tabstop>
<tabstop>okPB</tabstop>

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>340</height>
<width>369</width>
<height>378</height>
</rect>
</property>
<property stdset="1">
@ -30,86 +30,34 @@
<name>spacing</name>
<number>6</number>
</property>
<widget row="2" column="0" >
<widget row="0" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>templateLA</cstring>
<cstring>fileLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Template:</string>
<string>&amp;File:</string>
</property>
<property>
<name>buddy</name>
<cstring>externalCO</cstring>
<cstring>fileED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Available templates</string>
<string>Filename</string>
</property>
</widget>
<widget row="3" column="0" rowspan="1" colspan="3" >
<class>QTextView</class>
<property stdset="1">
<name>name</name>
<cstring>externalTV</cstring>
</property>
<property>
<name>toolTip</name>
<string>LaTeX error messages</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>paramsLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Parameters:</string>
</property>
<property>
<name>buddy</name>
<cstring>paramsED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Parameters</string>
</property>
</widget>
<widget row="0" column="2" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>browsePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Browse...</string>
</property>
</widget>
<widget row="1" column="1" rowspan="1" colspan="2" >
<widget row="0" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>paramsED</cstring>
<cstring>fileED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Parameters</string>
</property>
</widget>
<widget row="2" column="1" rowspan="1" colspan="2" >
<class>QComboBox</class>
<property stdset="1">
<name>name</name>
<cstring>externalCO</cstring>
</property>
<property>
<name>toolTip</name>
<string>Available templates</string>
<string>Filename</string>
</property>
</widget>
<widget row="5" column="0" rowspan="1" colspan="3" >
@ -195,36 +143,6 @@
</widget>
</hbox>
</widget>
<widget row="0" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>fileLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;File:</string>
</property>
<property>
<name>buddy</name>
<cstring>fileED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Filename</string>
</property>
</widget>
<widget row="0" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>fileED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Filename</string>
</property>
</widget>
<widget row="4" column="0" rowspan="1" colspan="3" >
<class>QLayoutWidget</class>
<property stdset="1">
@ -240,28 +158,6 @@
<name>spacing</name>
<number>6</number>
</property>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>editPB</cstring>
</property>
<property stdset="1">
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
</sizepolicy>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Edit file</string>
</property>
<property>
<name>toolTip</name>
<string>Edit the file externally</string>
</property>
</widget>
<widget>
<class>QPushButton</class>
<property stdset="1">
@ -277,7 +173,7 @@
</property>
<property stdset="1">
<name>text</name>
<string>&amp;View file</string>
<string>&amp;View Result</string>
</property>
<property>
<name>toolTip</name>
@ -299,7 +195,7 @@
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Update</string>
<string>&amp;Update Result</string>
</property>
<property>
<name>toolTip</name>
@ -308,6 +204,103 @@
</widget>
</hbox>
</widget>
<widget row="3" column="0" rowspan="1" colspan="3" >
<class>QTextView</class>
<property stdset="1">
<name>name</name>
<cstring>externalTV</cstring>
</property>
<property>
<name>toolTip</name>
<string>LaTeX error messages</string>
</property>
</widget>
<widget row="2" column="1" rowspan="1" colspan="2" >
<class>QComboBox</class>
<property stdset="1">
<name>name</name>
<cstring>externalCO</cstring>
</property>
<property>
<name>toolTip</name>
<string>Available templates</string>
</property>
</widget>
<widget row="2" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>templateLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Template:</string>
</property>
<property>
<name>buddy</name>
<cstring>externalCO</cstring>
</property>
<property>
<name>toolTip</name>
<string>Available templates</string>
</property>
</widget>
<widget row="1" column="1" >
<class>QLineEdit</class>
<property stdset="1">
<name>name</name>
<cstring>paramsED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Parameters</string>
</property>
</widget>
<widget row="1" column="0" >
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>paramsLA</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Parameters:</string>
</property>
<property>
<name>buddy</name>
<cstring>paramsED</cstring>
</property>
<property>
<name>toolTip</name>
<string>Parameters</string>
</property>
</widget>
<widget row="0" column="2" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>browsePB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Browse...</string>
</property>
</widget>
<widget row="1" column="2" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>editPB</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;Edit file</string>
</property>
<property>
<name>toolTip</name>
<string>Edit the file externally</string>
</property>
</widget>
</grid>
</widget>
<connections>
@ -323,12 +316,6 @@
<receiver>QExternalDialogBase</receiver>
<slot>viewClicked()</slot>
</connection>
<connection>
<sender>editPB</sender>
<signal>clicked()</signal>
<receiver>QExternalDialogBase</receiver>
<slot>editClicked()</slot>
</connection>
<connection>
<sender>externalCO</sender>
<signal>activated(const QString&amp;)</signal>

View File

@ -13,7 +13,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<width>279</width>
<height>290</height>
</rect>
</property>
@ -186,6 +186,10 @@
<name>name</name>
<cstring>viewPB</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>false</bool>
</property>
<property stdset="1">
<name>text</name>
<string>&amp;View</string>
@ -260,10 +264,22 @@
<slot>viewClicked()</slot>
</connection>
<connection>
<sender>rescanPB</sender>
<signal>clicked()</signal>
<sender>whatStyle</sender>
<signal>activated(const QString&amp;)</signal>
<receiver>QTexinfoDialogBase</receiver>
<slot>rescanClicked()</slot>
<slot>enableViewPB()</slot>
</connection>
<connection>
<sender>whatStyle</sender>
<signal>activated(int)</signal>
<receiver>QTexinfoDialogBase</receiver>
<slot>update()</slot>
</connection>
<connection>
<sender>fileList</sender>
<signal>clicked(QListBoxItem*)</signal>
<receiver>QTexinfoDialogBase</receiver>
<slot>enableViewPB()</slot>
</connection>
<connection>
<sender>path</sender>
@ -272,12 +288,18 @@
<slot>update()</slot>
</connection>
<connection>
<sender>whatStyle</sender>
<signal>activated(int)</signal>
<sender>rescanPB</sender>
<signal>clicked()</signal>
<receiver>QTexinfoDialogBase</receiver>
<slot>update()</slot>
<slot>enableViewPB()</slot>
</connection>
<slot access="protected">helpClicked()</slot>
<connection>
<sender>rescanPB</sender>
<signal>clicked()</signal>
<receiver>QTexinfoDialogBase</receiver>
<slot>rescanClicked()</slot>
</connection>
<slot access="protected">enableViewPB()</slot>
<slot access="protected">rescanClicked()</slot>
<slot access="protected">update()</slot>
<slot access="protected">viewClicked()</slot>