This new citation dialog follows a new design similar to lyx-1.3:

- two panes for Selected/Available keys
- find as you search (Regular expression are supported)
- advanced search button

There are a lot of work still:
- selected citations are not inserted in the document
- find does not select the found key
- the graying/un-graying of buttons does not work properly
- the Advanced Search Dialog (which will search inside the citation) is not done yet
- ...
But the good news is that I have used the Model/View separation of Qt4. QCitation contains the list models and QCitationDialog contains the list views. The idea would be to reuse the model for a new dialog, I am thinking of a simple combo box placed on the toolbar which insert citations with default style, etc. Or a context menu insert->citation...



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13496 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-03-25 21:26:09 +00:00
parent 64aab4aa75
commit 2f415cfbb1
7 changed files with 1265 additions and 1047 deletions

View File

@ -13,7 +13,6 @@
#include "QCitation.h" #include "QCitation.h"
#include "QCitationDialog.h" #include "QCitationDialog.h"
#include "ui/QCitationFindUi.h"
#include "Qt2BC.h" #include "Qt2BC.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -24,219 +23,186 @@
#include "support/lstrings.h" #include "support/lstrings.h"
#include <qcheckbox.h> #include <vector>
#include <qlineedit.h> #include <string>
#include <q3listbox.h> #include <iostream>
#include <q3multilineedit.h> using std::cout;
#include <qpushbutton.h> using std::endl;
#include <qlabel.h>
using std::find;
using std::string;
using std::vector; using std::vector;
using std::string;
void toQStringList(QStringList & qlist, vector<string> const & v)
{
qlist.clear();
for (size_t i=0; i != v.size(); ++i) {
if (v[i].empty())
continue;
qlist.append(toqstr(v[i]));
}
}
void toVector(vector<string> & v, const QStringList & qlist)
{
v.clear();
for (size_t i=0; i != qlist.size(); ++i)
v.push_back(fromqstr(qlist[i]));
}
namespace lyx { namespace lyx {
using support::getStringFromVector;
using support::getVectorFromString;
using support::trim;
namespace frontend { namespace frontend {
typedef QController<ControlCitation, QView<QCitationDialog> > base_class; typedef QController<ControlCitation, QView<QCitationDialog> > base_class;
QCitation::QCitation(Dialog & parent) QCitation::QCitation(Dialog & parent)
: base_class(parent, _("Citation")) : base_class(parent, _("Citation"))
{} {
}
void QCitation::apply() void QCitation::apply()
{ {
vector<biblio::CiteStyle> const & styles = InsetCommandParams & params = controller().params();
ControlCitation::getCiteStyles(); dialog_->update(params);
int const choice = dialog_->citationStyleCO->currentItem(); params.setContents(fromqstr(selected_keys_.stringList().join("'")));
bool const full = dialog_->fulllistCB->isChecked();
bool const force = dialog_->forceuppercaseCB->isChecked();
string const command =
biblio::CitationStyle(styles[choice], full, force)
.asLatexStr();
controller().params().setCmdName(command);
controller().params().setContents(getStringFromVector(citekeys));
string const before = fromqstr(dialog_->textBeforeED->text());
controller().params().setSecOptions(before);
string const after = fromqstr(dialog_->textAfterED->text());
controller().params().setOptions(after);
style_ = choice;
open_find_ = false;
}
void QCitation::hide()
{
citekeys.clear();
bibkeys.clear();
open_find_ = true;
QDialogView::hide();
} }
void QCitation::build_dialog() void QCitation::build_dialog()
{ {
dialog_.reset(new QCitationDialog(this)); dialog_.reset(new QCitationDialog(this));
// Manage the ok, apply, restore and cancel/close buttons
bcview().setOK(dialog_->okPB);
bcview().setApply(dialog_->applyPB);
bcview().setCancel(dialog_->closePB);
bcview().setRestore(dialog_->restorePB);
bcview().addReadOnly(dialog_->addPB);
bcview().addReadOnly(dialog_->deletePB);
bcview().addReadOnly(dialog_->upPB);
bcview().addReadOnly(dialog_->downPB);
bcview().addReadOnly(dialog_->citationStyleCO);
bcview().addReadOnly(dialog_->forceuppercaseCB);
bcview().addReadOnly(dialog_->fulllistCB);
bcview().addReadOnly(dialog_->textBeforeED);
bcview().addReadOnly(dialog_->textAfterED);
open_find_ = true;
}
void QCitation::fillStyles()
{
if (citekeys.empty()) {
dialog_->citationStyleCO->setEnabled(false);
dialog_->citationStyleLA->setEnabled(false);
return;
}
int const orig = dialog_->citationStyleCO->currentItem();
dialog_->citationStyleCO->clear();
int curr = dialog_->selectedLB->currentItem();
if (curr < 0)
curr = 0;
string key = citekeys[curr];
vector<string> const & sty = controller().getCiteStrings(key);
biblio::CiteEngine const engine = controller().getEngine();
bool const basic_engine = engine == biblio::ENGINE_BASIC;
dialog_->citationStyleCO->setEnabled(!sty.empty() && !basic_engine);
dialog_->citationStyleLA->setEnabled(!sty.empty() && !basic_engine);
for (vector<string>::const_iterator it = sty.begin();
it != sty.end(); ++it) {
dialog_->citationStyleCO->insertItem(toqstr(*it));
}
if (orig != -1 && orig < dialog_->citationStyleCO->count())
dialog_->citationStyleCO->setCurrentItem(orig);
}
void QCitation::updateStyle()
{
biblio::CiteEngine const engine = controller().getEngine();
bool const natbib_engine =
engine == biblio::ENGINE_NATBIB_AUTHORYEAR ||
engine == biblio::ENGINE_NATBIB_NUMERICAL;
bool const basic_engine = engine == biblio::ENGINE_BASIC;
dialog_->fulllistCB->setEnabled(natbib_engine);
dialog_->forceuppercaseCB->setEnabled(natbib_engine);
dialog_->textBeforeED->setEnabled(!basic_engine);
string const & command = controller().params().getCmdName();
// Find the style of the citekeys
vector<biblio::CiteStyle> const & styles =
ControlCitation::getCiteStyles();
biblio::CitationStyle const cs(command);
vector<biblio::CiteStyle>::const_iterator cit =
find(styles.begin(), styles.end(), cs.style);
// restore the latest natbib style
if (style_ >= 0 && style_ < dialog_->citationStyleCO->count())
dialog_->citationStyleCO->setCurrentItem(style_);
else
dialog_->citationStyleCO->setCurrentItem(0);
dialog_->fulllistCB->setChecked(false);
dialog_->forceuppercaseCB->setChecked(false);
if (cit != styles.end()) {
int const i = int(cit - styles.begin());
dialog_->citationStyleCO->setCurrentItem(i);
dialog_->fulllistCB->setChecked(cs.full);
dialog_->forceuppercaseCB->setChecked(cs.forceUCase);
}
} }
void QCitation::update_contents() void QCitation::update_contents()
{ {
QStringList keys;
// Make the list of all available bibliography keys // Make the list of all available bibliography keys
bibkeys = biblio::getKeys(controller().bibkeysInfo()); toQStringList(keys,
updateBrowser(dialog_->ui_.availableLB, bibkeys); biblio::getKeys(controller().bibkeysInfo()));
available_keys_.setStringList(keys);
// Ditto for the keys cited in this inset // Ditto for the keys cited in this inset
citekeys = getVectorFromString(controller().params().getContents()); QString str = toqstr(controller().params().getContents());
updateBrowser(dialog_->selectedLB, citekeys); if (!str.isEmpty()) {
keys = str.split(",");
selected_keys_.setStringList(keys);
}
// No keys have been selected yet, so... dialog_->update(controller().params());
dialog_->infoML->clear();
dialog_->setButtons();
dialog_->textBeforeED->setText(
toqstr(controller().params().getSecOptions()));
dialog_->textAfterED->setText(
toqstr(controller().params().getOptions()));
fillStyles();
updateStyle();
// open the find dialog if nothing has been selected (yet)
// the bool prevents that this is also done after "apply"
if (open_find_)
dialog_->openFind();
bc().valid(isValid()); bc().valid(isValid());
} }
void QCitation::hide()
void QCitation::updateBrowser(Q3ListBox * browser,
vector<string> const & keys) const
{ {
browser->clear(); QDialogView::hide();
for (vector<string>::const_iterator it = keys.begin();
it < keys.end(); ++it) {
string const key = trim(*it);
// FIXME: why the .empty() test ?
if (!key.empty())
browser->insertItem(toqstr(key));
}
} }
bool QCitation::isValid() bool QCitation::isValid()
{ {
return dialog_->selectedLB->count() > 0; return selected_keys_.rowCount() > 0;
} }
QModelIndex QCitation::findKey(QString const & str, QModelIndex const & index) const
{
QStringList const avail = available_keys_.stringList();
int const pos = avail.indexOf(str, index.row());
if (pos == -1)
return index;
return available_keys_.index(pos);
}
QModelIndex QCitation::findKey(QString const & str) const
{
QStringList const avail = available_keys_.stringList();
int const pos = avail.indexOf(str);
if (pos == -1)
return QModelIndex();
return available_keys_.index(pos);
}
void QCitation::addKeys(QModelIndexList const & indexes)
{
// = selectionModel->selectedIndexes();
QModelIndex index;
if (indexes.empty())
return;
QStringList keys = selected_keys_.stringList();
foreach(index, indexes) {
if (keys.indexOf(index.data().toString()) == -1)
keys.append(index.data().toString());
}
selected_keys_.setStringList(keys);
changed();
}
void QCitation::deleteKeys(QModelIndexList const & indexes)
{
QModelIndex index;
if (indexes.empty())
return;
QStringList keys = selected_keys_.stringList();
foreach(index, indexes) {
int const pos = keys.indexOf(index.data().toString());
if (pos != -1)
keys.removeAt(pos);
}
selected_keys_.setStringList(keys);
changed();
}
void QCitation::upKey(QModelIndexList const & indexes)
{
if (indexes.empty() || indexes.size() > 1)
return;
int pos = indexes[0].row();
if (pos < 1)
return;
QStringList keys = selected_keys_.stringList();
keys.swap(pos, pos-1);
selected_keys_.setStringList(keys);
changed();
}
void QCitation::downKey(QModelIndexList const & indexes)
{
if (indexes.empty() || indexes.size() > 1)
return;
int pos = indexes[0].row();
if (pos >= selected_keys_.rowCount() - 1)
return;
QStringList keys = selected_keys_.stringList();
keys.swap(pos, pos+1);
selected_keys_.setStringList(keys);
changed();
}
} // namespace frontend } // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -14,9 +14,8 @@
#define QCITATION_H #define QCITATION_H
#include "QDialogView.h" #include "QDialogView.h"
#include <vector>
class Q3ListBox; #include <QStringListModel>
namespace lyx { namespace lyx {
namespace frontend { namespace frontend {
@ -31,8 +30,27 @@ public:
friend class QCitationDialog; friend class QCitationDialog;
/// ///
QCitation(Dialog &); QCitation(Dialog &);
QStringListModel * available()
{ return &available_keys_; }
QStringListModel * selected()
{ return &selected_keys_; }
QStringListModel * found()
{ return &found_keys_; }
QModelIndex findKey(QString const & str, QModelIndex const & index) const;
QModelIndex findKey(QString const & str) const;
void addKeys(QModelIndexList const & indexes);
void deleteKeys(QModelIndexList const & indexes);
void upKey(QModelIndexList const & indexes);
void downKey(QModelIndexList const & indexes);
protected: protected:
virtual bool isValid(); virtual bool isValid();
private: private:
/// Set the Params variable for the Controller. /// Set the Params variable for the Controller.
@ -44,22 +62,14 @@ private:
/// Update dialog before/whilst showing it. /// Update dialog before/whilst showing it.
virtual void update_contents(); virtual void update_contents();
/// fill the styles combo /// available keys
void fillStyles(); QStringListModel available_keys_;
/// set the styles combo
void updateStyle();
void updateBrowser(Q3ListBox *, std::vector<std::string> const &) const;
/// check if apply has been pressed
bool open_find_;
/// selected keys /// selected keys
std::vector<std::string> citekeys; QStringListModel selected_keys_;
/// available bib keys
std::vector<std::string> bibkeys; /// found keys
/// selected natbib style QStringListModel found_keys_;
int style_;
}; };
} // namespace frontend } // namespace frontend

View File

@ -15,29 +15,53 @@
#include "QCitationDialog.h" #include "QCitationDialog.h"
#include "ui/QCitationFindUi.h" #include "ui/QCitationFindUi.h"
#include "QCitation.h" #include "QCitation.h"
#include "Qt2BC.h"
#include "qt_helpers.h" #include "qt_helpers.h"
#include "bufferparams.h"
#include "controllers/ControlCitation.h" #include "controllers/ControlCitation.h"
#include "controllers/ButtonController.h" #include "controllers/ButtonController.h"
#include <qcheckbox.h> #include "support/lstrings.h"
#include <qlineedit.h>
#include <q3listbox.h>
#include <q3multilineedit.h>
#include <qpushbutton.h>
#include <iostream>
using std::cout;
using std::endl;
using std::vector; using std::find;
using std::string; using std::string;
using std::vector;
namespace lyx { namespace lyx {
using support::getStringFromVector;
using support::getVectorFromString;
using support::trim;
namespace frontend { namespace frontend {
void updateBrowser(Q3ListBox * browser,
vector<string> const & keys)
{
browser->clear();
for (vector<string>::const_iterator it = keys.begin();
it < keys.end(); ++it) {
string const key = trim(*it);
// FIXME: why the .empty() test ?
if (!key.empty())
browser->insertItem(toqstr(key));
}
}
QCitationDialog::QCitationDialog(QCitation * form) QCitationDialog::QCitationDialog(QCitation * form)
: form_(form) : form_(form)
{ {
setupUi(this); setupUi(this);
connect(restorePB, SIGNAL(clicked()),
/* connect(restorePB, SIGNAL(clicked()),
form, SLOT(slotRestore())); form, SLOT(slotRestore()));
connect(okPB, SIGNAL(clicked()), connect(okPB, SIGNAL(clicked()),
form, SLOT(slotOK())); form, SLOT(slotOK()));
@ -45,75 +69,212 @@ QCitationDialog::QCitationDialog(QCitation * form)
form, SLOT(slotApply())); form, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()), connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose())); form, SLOT(slotClose()));
*/
// Manage the ok, apply, restore and cancel/close buttons
form_->bcview().setOK(okPB);
form_->bcview().setApply(applyPB);
form_->bcview().setCancel(closePB);
form_->bcview().setRestore(restorePB);
connect( citationStyleCO, SIGNAL( activated(int) ), this, SLOT( changed_adaptor() ) ); form_->bcview().addReadOnly(addPB);
connect( fulllistCB, SIGNAL( clicked() ), this, SLOT( changed_adaptor() ) ); form_->bcview().addReadOnly(deletePB);
connect( forceuppercaseCB, SIGNAL( clicked() ), this, SLOT( changed_adaptor() ) ); form_->bcview().addReadOnly(upPB);
connect( textBeforeED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) ); form_->bcview().addReadOnly(downPB);
connect( textAfterED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) ); form_->bcview().addReadOnly(citationStyleCO);
connect( upPB, SIGNAL( clicked() ), this, SLOT( up() ) ); form_->bcview().addReadOnly(forceuppercaseCB);
connect( downPB, SIGNAL( clicked() ), this, SLOT( down() ) ); form_->bcview().addReadOnly(fulllistCB);
connect( selectedLB, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( selectedChanged() ) ); form_->bcview().addReadOnly(textBeforeED);
connect( addPB, SIGNAL( clicked() ), this, SLOT( add() ) ); form_->bcview().addReadOnly(textAfterED);
connect( deletePB, SIGNAL( clicked() ), this, SLOT( del() ) );
add_ = new QDialog(this, "", true); selectedLV->setModel(form_->selected());
ui_.setupUi(add_); availableLV->setModel(form_->available());
connect( ui_.addPB, SIGNAL( clicked() ), this, SLOT( accept() ) ); // foundLV.setModel(form_->found());
connect( ui_.closePB, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect(ui_.previousPB, SIGNAL(clicked()), this, SLOT(previous())); connect( citationStyleCO, SIGNAL( activated(int) ), this, SLOT( changed() ) );
connect(ui_.nextPB, SIGNAL(clicked()), this, SLOT(next())); connect( fulllistCB, SIGNAL( clicked() ), this, SLOT( changed() ) );
connect(ui_.availableLB, SIGNAL(currentChanged(Q3ListBoxItem *)), this, SLOT(availableChanged())); connect( forceuppercaseCB, SIGNAL( clicked() ), this, SLOT( changed() ) );
connect(ui_.availableLB, SIGNAL(selected(Q3ListBoxItem *)), this, SLOT(addCitation())); connect( textBeforeED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed() ) );
connect(ui_.availableLB, SIGNAL(selected(Q3ListBoxItem *)), add_, SLOT(accept())); connect( textAfterED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed() ) );
connect(ui_.addPB, SIGNAL(clicked()), this, SLOT(addCitation()));
connect(selectedLB, SIGNAL(returnPressed(Q3ListBoxItem *)), form, SLOT(slotOK()));
// find_ = new QCitationFind(form_, this);
// connect(selectedLV, SIGNAL(doubleClicked(const QModelIndex & index)),
// form_, SLOT(on_okPB_clicked()));//SLOT(slotOK()));
} }
QCitationDialog::~QCitationDialog() QCitationDialog::~QCitationDialog()
{ {
} }
void QCitationDialog::on_okPB_clicked()
{
apply(form_->controller().params());
accept();
}
void QCitationDialog::on_cancelPB_clicked()
{
reject();
}
void QCitationDialog::on_applyPB_clicked()
{
apply(form_->controller().params());
}
void QCitationDialog::on_restorePB_clicked()
{
form_->update_contents();
}
void QCitationDialog::apply(InsetCommandParams & params)
{
vector<biblio::CiteStyle> const & styles =
ControlCitation::getCiteStyles();
int const choice = std::max(0, citationStyleCO->currentItem());
bool const full = fulllistCB->isChecked();
bool const force = forceuppercaseCB->isChecked();
string const command =
biblio::CitationStyle(styles[choice], full, force)
.asLatexStr();
params.setCmdName(command);
string const before = fromqstr(textBeforeED->text());
params.setSecOptions(before);
string const after = fromqstr(textAfterED->text());
params.setOptions(after);
style_ = choice;
}
void QCitationDialog::update(InsetCommandParams const & params)
{
// No keys have been selected yet, so...
infoML->document()->clear();
setButtons();
textBeforeED->setText(
toqstr(params.getSecOptions()));
textAfterED->setText(
toqstr(params.getOptions()));
fillStyles();
updateStyle();
// find_->update();
}
void QCitationDialog::updateStyle()
{
biblio::CiteEngine const engine = form_->controller().getEngine();
bool const natbib_engine =
engine == biblio::ENGINE_NATBIB_AUTHORYEAR ||
engine == biblio::ENGINE_NATBIB_NUMERICAL;
bool const basic_engine = engine == biblio::ENGINE_BASIC;
fulllistCB->setEnabled(natbib_engine);
forceuppercaseCB->setEnabled(natbib_engine);
textBeforeED->setEnabled(!basic_engine);
string const & command = form_->controller().params().getCmdName();
// Find the style of the citekeys
vector<biblio::CiteStyle> const & styles =
ControlCitation::getCiteStyles();
biblio::CitationStyle const cs(command);
vector<biblio::CiteStyle>::const_iterator cit =
std::find(styles.begin(), styles.end(), cs.style);
// restore the latest natbib style
if (style_ >= 0 && style_ < citationStyleCO->count())
citationStyleCO->setCurrentItem(style_);
else
citationStyleCO->setCurrentItem(0);
fulllistCB->setChecked(false);
forceuppercaseCB->setChecked(false);
if (cit != styles.end()) {
int const i = int(cit - styles.begin());
citationStyleCO->setCurrentItem(i);
fulllistCB->setChecked(cs.full);
forceuppercaseCB->setChecked(cs.forceUCase);
}
}
void QCitationDialog::fillStyles()
{
if (citekeys.empty()) {
citationStyleCO->setEnabled(false);
citationStyleLA->setEnabled(false);
return;
}
int const orig = citationStyleCO->currentItem();
citationStyleCO->clear();
QStringList selected_keys = form_->selected()->stringList();
if (selected_keys.empty())
return;
if (selectedLV->selectionModel()->selectedIndexes().empty())
return;
int curr = selectedLV->selectionModel()->selectedIndexes()[0].row();//selectedLV->currentItem();
string key = fromqstr(selected_keys[curr]);
vector<string> const & sty = form_->controller().getCiteStrings(key);
biblio::CiteEngine const engine = form_->controller().getEngine();
bool const basic_engine = engine == biblio::ENGINE_BASIC;
citationStyleCO->setEnabled(!sty.empty() && !basic_engine);
citationStyleLA->setEnabled(!sty.empty() && !basic_engine);
for (vector<string>::const_iterator it = sty.begin();
it != sty.end(); ++it) {
citationStyleCO->insertItem(toqstr(*it));
}
if (orig != -1 && orig < citationStyleCO->count())
citationStyleCO->setCurrentItem(orig);
}
void QCitationDialog::setButtons() void QCitationDialog::setButtons()
{ {
if (form_->readOnly()) if (form_->readOnly())
return; return;
int const sel_nr = selectedLB->currentItem(); int const row_count = selectedLV->model()->rowCount();
int const avail_nr = ui_.availableLB->currentItem();
int sel_nr=-1;
if (! selectedLV->selectionModel()->selectedIndexes().empty()) {
sel_nr =
selectedLV->selectionModel()->selectedIndexes()[0].row();
}
ui_.addPB->setEnabled(avail_nr >= 0);
deletePB->setEnabled(sel_nr >= 0); deletePB->setEnabled(sel_nr >= 0);
upPB->setEnabled(sel_nr > 0); upPB->setEnabled(sel_nr > 0);
downPB->setEnabled(sel_nr >= 0 && sel_nr < int(selectedLB->count() - 1)); downPB->setEnabled(sel_nr >= 0 && sel_nr < row_count - 1);
} }
/*
void QCitationDialog::openFind() void QCitationDialog::on_selectedLV_currentChanged(Q3ListBoxItem*)
{ {
if (form_->readOnly()) fillStyles();
return; infoML->document()->clear();
if (isVisible() && selectedLB->count() == 0
&& ui_.availableLB->count() != 0){
// open the find dialog
add();
// and let the user press ok after a selection
if (selectedLB->count() != 0)
form_->bc().valid();
}
}
void QCitationDialog::selectedChanged()
{
form_->fillStyles();
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo();
infoML->clear();
int const sel = selectedLB->currentItem(); int const sel = selectedLB->currentItem();
if (sel < 0) { if (sel < 0) {
@ -121,187 +282,189 @@ void QCitationDialog::selectedChanged()
return; return;
} }
if (!theMap.empty()) infoML->document()->setPlainText(form_->getKeyInfo(sel));
infoML->setText(
toqstr(biblio::getInfo(theMap, form_->citekeys[sel]))); setButtons();
}
*/
void QCitationDialog::on_addPB_clicked()
{
form_->addKeys(availableLV->selectionModel()->selectedIndexes());
}
void QCitationDialog::on_deletePB_clicked()
{
form_->addKeys(selectedLV->selectionModel()->selectedIndexes());
changed();
}
void QCitationDialog::on_upPB_clicked()
{
form_->upKey(selectedLV->selectionModel()->selectedIndexes());
changed();
}
void QCitationDialog::on_downPB_clicked()
{
form_->downKey(selectedLV->selectionModel()->selectedIndexes());
changed();
}
void QCitationDialog::on_findLE_textChanged(const QString & text)
{
QModelIndex const index = form_->findKey(text);
if (! index.isValid())
return;
// QItemSelection selection(index, index);
availableLV->selectionModel()->select(index, QItemSelectionModel::Select);
changed();
}
void QCitationDialog::on_advancedSearchPB_clicked()
{
// find_->exec();
changed();
}
void QCitationDialog::changed()
{
fillStyles();
setButtons(); setButtons();
} }
void QCitationDialog::previous()
QCitationFind::QCitationFind(QCitation * form, QWidget * parent, Qt::WFlags f)
: form_(form), QDialog(parent, f)
{
setupUi(this);
connect(addPB, SIGNAL(clicked()), this, SLOT(accept()));
connect(closePB, SIGNAL(clicked()), this, SLOT(reject()));
connect(previousPB, SIGNAL(clicked()), this, SLOT(previous()));
connect(nextPB, SIGNAL(clicked()), this, SLOT(next()));
}
void QCitationFind::update()
{
// updateBrowser(availableLB, form_->availableKeys());
}
void QCitationFind::on_availableLB_currentChanged(Q3ListBoxItem *)
{
infoML->document()->clear();
int const sel = availableLB->currentItem();
if (sel < 0) {
addPB->setEnabled(false);
return;
}
addPB->setEnabled(true);
// infoML->document()->setPlainText(form_->getKeyInfo(sel));
}
void QCitationFind::on_availableLB_selected(Q3ListBoxItem *)
{
int const sel = availableLB->currentItem();
foundkeys.clear();
// foundkeys.push_back(form_->availableKeys()[sel]);
emit newCitations();
accept();
}
void QCitationFind::on_addPB_clicked()
{
// form_->addKeys(availableLB->selectionModel()->selectedIndexes());
int const sel = availableLB->currentItem();
if (sel < 0)
return;
QStringList bibkeys = form_->available()->stringList();
// Add the selected browser_bib keys to browser_cite
// multiple selections are possible
for (unsigned int i = 0; i != availableLB->count(); i++) {
if (availableLB->isSelected(i)) {
foundkeys.push_back(fromqstr(bibkeys[i]));
}
}
emit newCitations();
accept();
}
void QCitationFind::previous()
{ {
find(biblio::BACKWARD); find(biblio::BACKWARD);
} }
void QCitationDialog::next() void QCitationFind::next()
{ {
find(biblio::FORWARD); find(biblio::FORWARD);
} }
void QCitationDialog::availableChanged() void QCitationFind::find(biblio::Direction dir)
{ {
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); /* QStringList bibkeys = form_->available()->stringList();
ui_.infoML->clear();
int const sel = ui_.availableLB->currentItem();
if (sel < 0) {
setButtons();
return;
}
if (!theMap.empty())
ui_.infoML->setText(
toqstr(biblio::getInfo(theMap, form_->bibkeys[sel])));
setButtons();
}
void QCitationDialog::addCitation()
{
int const sel = ui_.availableLB->currentItem();
if (sel < 0)
return;
// Add the selected browser_bib keys to browser_cite
// multiple selections are possible
for (unsigned int i = 0; i != ui_.availableLB->count(); i++) {
if (ui_.availableLB->isSelected(i)) {
// do not allow duplicates
if ((selectedLB->findItem(ui_.availableLB->text(i))) == 0) {
selectedLB->insertItem(toqstr(form_->bibkeys[i]));
form_->citekeys.push_back(form_->bibkeys[i]);
}
}
}
int const n = int(form_->citekeys.size());
selectedLB->setSelected(n - 1, true);
form_->changed();
form_->fillStyles();
setButtons();
}
void QCitationDialog::del()
{
int const sel = selectedLB->currentItem();
// Remove the selected key from browser_cite
selectedLB->removeItem(sel);
form_->citekeys.erase(form_->citekeys.begin() + sel);
form_->changed();
form_->fillStyles();
setButtons();
}
void QCitationDialog::up()
{
int const sel = selectedLB->currentItem();
// Move the selected key up one line
vector<string>::iterator it = form_->citekeys.begin() + sel;
string const tmp = *it;
selectedLB->removeItem(sel);
form_->citekeys.erase(it);
selectedLB->insertItem(toqstr(tmp), sel - 1);
selectedLB->setSelected(sel - 1, true);
form_->citekeys.insert(it - 1, tmp);
form_->changed();
form_->fillStyles();
setButtons();
}
void QCitationDialog::down()
{
int const sel = selectedLB->currentItem();
// Move the selected key down one line
vector<string>::iterator it = form_->citekeys.begin() + sel;
string const tmp = *it;
selectedLB->removeItem(sel);
form_->citekeys.erase(it);
selectedLB->insertItem(toqstr(tmp), sel + 1);
selectedLB->setSelected(sel + 1, true);
form_->citekeys.insert(it + 1, tmp);
form_->changed();
form_->fillStyles();
setButtons();
}
void QCitationDialog::add()
{
add_->exec();
}
void QCitationDialog::changed_adaptor()
{
form_->changed();
}
void QCitationDialog::find(biblio::Direction dir)
{
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo(); biblio::InfoMap const & theMap = form_->controller().bibkeysInfo();
biblio::Search const type = ui_.searchTypeCB->isChecked() biblio::Search const type = searchTypeCB->isChecked()
? biblio::REGEX : biblio::SIMPLE; ? biblio::REGEX : biblio::SIMPLE;
vector<string>::const_iterator start = form_->bibkeys.begin(); vector<string>::const_iterator start = bibkeys.begin();
int const sel = ui_.availableLB->currentItem(); int const sel = availableLB->currentItem();
if (sel >= 0 && sel <= int(form_->bibkeys.size()-1)) if (sel >= 0 && sel <= int(bibkeys.size()-1))
start += sel; start += sel;
// Find the NEXT instance... // Find the NEXT instance...
if (dir == biblio::FORWARD) if (dir == biblio::FORWARD)
start += 1; start += 1;
bool const casesens = ui_.searchCaseCB->isChecked(); bool const casesens = searchCaseCB->isChecked();
string const str = fromqstr(ui_.searchED->text()); string const str = fromqstr(searchED->text());
vector<string>::const_iterator cit = vector<string>::const_iterator cit =
biblio::searchKeys(theMap, form_->bibkeys, str, biblio::searchKeys(theMap, bibkeys, str,
start, type, dir, casesens); start, type, dir, casesens);
// not found. let's loop round // not found. let's loop round
if (cit == form_->bibkeys.end()) { if (cit == bibkeys.end()) {
if (dir == biblio::FORWARD) { if (dir == biblio::FORWARD) {
start = form_->bibkeys.begin(); start = bibkeys.begin();
} }
else start = form_->bibkeys.end() - 1; else start = bibkeys.end() - 1;
cit = biblio::searchKeys(theMap, form_->bibkeys, str, cit = biblio::searchKeys(theMap, bibkeys, str,
start, type, dir, casesens); start, type, dir, casesens);
if (cit == form_->bibkeys.end()) if (cit == bibkeys.end())
return; return;
} }
int const found = int(cit - form_->bibkeys.begin()); int const found = int(cit - bibkeys.begin());
if (found == sel) { if (found == sel) {
return; return;
} }
// Update the display // Update the display
// note that we have multi selection mode! // note that we have multi selection mode!
ui_.availableLB->setSelected(sel, false); availableLB->setSelected(sel, false);
ui_.availableLB->setSelected(found, true); availableLB->setSelected(found, true);
ui_.availableLB->setCurrentItem(found); availableLB->setCurrentItem(found);
ui_.availableLB->ensureCurrentVisible(); availableLB->ensureCurrentVisible();
*/
} }
} // namespace frontend } // namespace frontend

View File

@ -15,12 +15,20 @@
#include "ui/QCitationUi.h" #include "ui/QCitationUi.h"
#include "ui/QCitationFindUi.h" #include "ui/QCitationFindUi.h"
#include "controllers/biblio.h" #include "controllers/biblio.h"
#include <QDialog> #include <QDialog>
#include <vector>
class Q3ListBox;
class Q3ListBoxItem;
class InsetCommandParams;
namespace lyx { namespace lyx {
namespace frontend { namespace frontend {
class QCitation; class QCitation;
class QCitationFind;
class QCitationDialog : public QDialog, public Ui::QCitationUi { class QCitationDialog : public QDialog, public Ui::QCitationUi {
Q_OBJECT Q_OBJECT
@ -30,29 +38,82 @@ public:
~QCitationDialog(); ~QCitationDialog();
void update(InsetCommandParams const & params);
void apply(InsetCommandParams & params);
// virtual bool isValid();
protected slots:
// void on_selectedLB_currentChanged(Q3ListBoxItem*);
void on_okPB_clicked();
void on_cancelPB_clicked();
void on_restorePB_clicked();
void on_applyPB_clicked();
void on_addPB_clicked();
void on_deletePB_clicked();
void on_upPB_clicked();
void on_downPB_clicked();
void on_findLE_textChanged(const QString & text);
void on_advancedSearchPB_clicked();
virtual void changed();
private:
void setButtons(); void setButtons();
/// open the find dialog if nothing selected /// open the find dialog if nothing selected
void openFind(); void openFind();
Ui::QCitationFindUi ui_; /// fill the styles combo
QDialog * add_; void fillStyles();
/// set the styles combo
void updateStyle();
/// check if apply has been pressed
bool open_find_;
/// selected keys
std::vector<std::string> citekeys;
/// selected natbib style
int style_;
QCitation * form_;
QCitationFind * find_;
};
class QCitationFind: public QDialog, public Ui::QCitationFindUi {
Q_OBJECT
public:
QCitationFind(QCitation * form, QWidget * parent = 0, Qt::WFlags f = 0);
void update();
std::vector<std::string> const & foundCitations()
{ return foundkeys; }
signals:
void newCitations();
protected slots: protected slots:
virtual void availableChanged(); void on_availableLB_currentChanged(Q3ListBoxItem *);
virtual void selectedChanged(); void on_availableLB_selected(Q3ListBoxItem *);
virtual void up(); void on_addPB_clicked();
virtual void down();
virtual void del();
virtual void addCitation();
virtual void add();
virtual void previous(); virtual void previous();
virtual void next(); virtual void next();
virtual void changed_adaptor();
private: private:
void find(biblio::Direction dir); void find(biblio::Direction dir);
/// selected keys
std::vector<std::string> foundkeys;
QCitation * form_; QCitation * form_;
}; };

View File

@ -84,7 +84,7 @@ QLayoutBox::QLayoutBox(QToolBar * toolbar, QtView & owner)
combo_->setSizeAdjustPolicy(QComboBox::AdjustToContents); combo_->setSizeAdjustPolicy(QComboBox::AdjustToContents);
combo_->setFocusPolicy(Qt::ClickFocus); combo_->setFocusPolicy(Qt::ClickFocus);
combo_->setMinimumWidth(combo_->sizeHint().width()); combo_->setMinimumWidth(combo_->sizeHint().width());
combo_->setMaxVisibleItems(30); combo_->setMaxVisibleItems(100);
QObject::connect(combo_, SIGNAL(activated(const QString &)), QObject::connect(combo_, SIGNAL(activated(const QString &)),
this, SLOT(selected(const QString &))); this, SLOT(selected(const QString &)));

View File

@ -1,287 +1,272 @@
<ui version="4.0" stdsetdef="1" > <ui version="4.0" >
<author></author> <author></author>
<comment></comment> <comment></comment>
<exportmacro></exportmacro> <exportmacro></exportmacro>
<class>QCitationFindUi</class> <class>QCitationFindUi</class>
<widget class="QDialog" name="QCitationFind" > <widget class="QDialog" name="QCitationFindUi" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>375</width> <width>375</width>
<height>257</height> <height>257</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
<hsizetype>1</hsizetype> <hsizetype>1</hsizetype>
<vsizetype>1</vsizetype> <vsizetype>1</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>LyX: Add Citation</string> <string>LyX: Add Citation</string>
</property> </property>
<property name="sizeGripEnabled" > <property name="sizeGripEnabled" >
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>11</number> <number>11</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item rowspan="2" row="0" column="0" colspan="1" > <item rowspan="2" row="0" column="0" >
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="Q3ListBox" name="availableLB" > <widget class="Q3ListBox" name="availableLB" >
<property name="vScrollBarMode" > <property name="toolTip" >
<enum>Q3ScrollView::AlwaysOn</enum> <string>Available bibliography keys</string>
</property> </property>
<property name="hScrollBarMode" > <property name="vScrollBarMode" >
<enum>Q3ScrollView::AlwaysOff</enum> <enum>Q3ScrollView::AlwaysOn</enum>
</property> </property>
<property name="selectionMode" > <property name="hScrollBarMode" >
<enum>Q3ListBox::Extended</enum> <enum>Q3ScrollView::AlwaysOff</enum>
</property> </property>
<property name="toolTip" > <property name="selectionMode" >
<string>Available bibliography keys</string> <enum>Q3ListBox::Extended</enum>
</property> </property>
<item> </widget>
<property name="text" > </item>
<string>New Item</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item rowspan="1" row="0" column="1" colspan="3" >
<widget class="Q3MultiLineEdit" name="infoML" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="wordWrap" >
<enum>WidgetWidth</enum>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string>Bibliography entry</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<spacer name="Spacer4" >
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="sizeType" >
<enum>Expanding</enum>
</property>
<property name="orientation" >
<enum>Horizontal</enum>
</property>
</spacer>
</item>
<item row="2" column="3" >
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QPushButton" name="addPB" >
<property name="text" >
<string>&amp;Add</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item rowspan="1" row="1" column="1" colspan="3" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QPushButton" name="previousPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Previous</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item rowspan="1" row="1" column="0" colspan="2" >
<widget class="QLineEdit" name="searchED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Browse the available bibliography entries</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="searchCaseCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Case &amp;sensitive</string>
</property>
<property name="toolTip" >
<string>Make the search case-sensitive</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QPushButton" name="nextPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Next</string>
</property>
<property name="shortcut" >
<number>276824142</number>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Find:</string>
</property>
<property name="buddy" >
<cstring>searchED</cstring>
</property>
</widget>
</item>
<item>
<spacer name="Spacer5" >
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="sizeType" >
<enum>Expanding</enum>
</property>
<property name="orientation" >
<enum>Horizontal</enum>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="searchTypeCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Regular Expression</string>
</property>
<property name="toolTip" >
<string>Interpret search entry as a regular expression</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </item>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <item row="2" column="1" >
<tabstops> <spacer>
<tabstop>availableLB</tabstop> <property name="orientation" >
<tabstop>searchED</tabstop> <enum>Qt::Horizontal</enum>
<tabstop>searchCaseCB</tabstop> </property>
<tabstop>searchTypeCB</tabstop> <property name="sizeType" >
<tabstop>previousPB</tabstop> <enum>QSizePolicy::Expanding</enum>
<tabstop>nextPB</tabstop> </property>
<tabstop>addPB</tabstop> <property name="sizeHint" >
<tabstop>closePB</tabstop> <size>
</tabstops> <width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="3" >
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QPushButton" name="addPB" >
<property name="text" >
<string>&amp;Add</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QPushButton" name="previousPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Previous</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QLineEdit" name="searchED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Browse the available bibliography entries</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="searchCaseCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Make the search case-sensitive</string>
</property>
<property name="text" >
<string>Case &amp;sensitive</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QPushButton" name="nextPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Next</string>
</property>
<property name="shortcut" >
<number>276824142</number>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Find:</string>
</property>
<property name="buddy" >
<cstring>searchED</cstring>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="searchTypeCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Interpret search entry as a regular expression</string>
</property>
<property name="text" >
<string>&amp;Regular Expression</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" colspan="3" >
<widget class="QTextEdit" name="infoML" />
</item>
</layout>
</widget>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3ListBox</class>
<extends></extends>
<header>q3listbox.h</header>
<container>0</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>availableLB</tabstop>
<tabstop>searchED</tabstop>
<tabstop>searchCaseCB</tabstop>
<tabstop>searchTypeCB</tabstop>
<tabstop>previousPB</tabstop>
<tabstop>nextPB</tabstop>
<tabstop>addPB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
<resources/>
<connections/>
</ui> </ui>

View File

@ -1,379 +1,412 @@
<ui version="4.0" stdsetdef="1" > <ui version="4.0" >
<author></author> <author></author>
<comment></comment> <comment></comment>
<exportmacro></exportmacro> <exportmacro></exportmacro>
<class>QCitationUi</class> <class>QCitationUi</class>
<widget class="QDialog" name="QCitation" > <widget class="QDialog" name="QCitationUi" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>401</width>
<height>310</height> <height>457</height>
</rect> </rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string/>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<widget class="QWidget" name="" >
<property name="geometry" >
<rect>
<x>320</x>
<y>20</y>
<width>79</width>
<height>118</height>
</rect>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property> </property>
<property name="sizePolicy" > <property name="spacing" >
<sizepolicy> <number>6</number>
<hsizetype>1</hsizetype> </property>
<vsizetype>1</vsizetype> <item row="2" column="0" >
<widget class="QPushButton" name="applyPB" >
<property name="text" >
<string>A&amp;pply</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QPushButton" name="restorePB" >
<property name="text" >
<string>&amp;Restore</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QPushButton" name="okPB" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="GroupBox8" >
<property name="geometry" >
<rect>
<x>10</x>
<y>220</y>
<width>201</width>
<height>156</height>
</rect>
</property>
<property name="title" >
<string>Style</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="citationStyleLA" >
<property name="text" >
<string>Citation &amp;style:</string>
</property>
<property name="buddy" >
<cstring>citationStyleCO</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="citationStyleCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property>
<property name="windowTitle" >
<string/>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property> </property>
<property name="spacing" > <property name="toolTip" >
<number>6</number> <string>Natbib citation style to use</string>
</property> </property>
<item row="0" column="1" > </widget>
<widget class="Q3MultiLineEdit" name="infoML" > </item>
<property name="sizePolicy" > <item row="4" column="0" colspan="2" >
<sizepolicy> <widget class="QCheckBox" name="forceuppercaseCB" >
<hsizetype>5</hsizetype> <property name="toolTip" >
<vsizetype>7</vsizetype> <string>Force upper case in citation</string>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="text" >
</sizepolicy> <string>Force &amp;upper case</string>
</property> </property>
<property name="focusPolicy" > </widget>
<enum>Qt::NoFocus</enum> </item>
</property> <item row="2" column="0" >
<property name="wordWrap" > <widget class="QLabel" name="textAfterLA" >
<enum>WidgetWidth</enum> <property name="text" >
</property> <string>&amp;Text after:</string>
<property name="readOnly" > </property>
<bool>true</bool> <property name="buddy" >
</property> <cstring>textAfterED</cstring>
<property name="toolTip" > </property>
<string>Bibliography entry</string> </widget>
</property> </item>
</widget> <item row="2" column="1" >
</item> <widget class="QLineEdit" name="textAfterED" >
<item rowspan="2" row="0" column="0" colspan="1" > <property name="sizePolicy" >
<layout class="QGridLayout" > <sizepolicy>
<property name="margin" > <hsizetype>5</hsizetype>
<number>0</number> <vsizetype>0</vsizetype>
</property> <horstretch>0</horstretch>
<property name="spacing" > <verstretch>0</verstretch>
<number>6</number> </sizepolicy>
</property> </property>
<item row="2" column="2" > <property name="toolTip" >
<widget class="QPushButton" name="downPB" > <string>Text to place after citation</string>
<property name="sizePolicy" > </property>
<sizepolicy> </widget>
<hsizetype>0</hsizetype> </item>
<vsizetype>0</vsizetype> <item row="1" column="1" >
<horstretch>0</horstretch> <widget class="QLineEdit" name="textBeforeED" >
<verstretch>0</verstretch> <property name="sizePolicy" >
</sizepolicy> <sizepolicy>
</property> <hsizetype>5</hsizetype>
<property name="text" > <vsizetype>0</vsizetype>
<string/> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="icon" > </sizepolicy>
<pixmap>image0</pixmap> </property>
</property> <property name="toolTip" >
<property name="toolTip" > <string>Text to place before citation</string>
<string>Move the selected citation down</string> </property>
</property> </widget>
</widget> </item>
</item> <item row="1" column="0" >
<item rowspan="3" row="1" column="0" colspan="2" > <widget class="QLabel" name="textBeforeLA" >
<widget class="Q3ListBox" name="selectedLB" > <property name="text" >
<property name="vScrollBarMode" > <string>Text &amp;before:</string>
<enum>Q3ScrollView::AlwaysOn</enum> </property>
</property> <property name="buddy" >
<property name="hScrollBarMode" > <cstring>textAfterED</cstring>
<enum>Q3ScrollView::AlwaysOff</enum> </property>
</property> </widget>
<property name="selectionMode" > </item>
<enum>Q3ListBox::Single</enum> <item row="3" column="0" colspan="2" >
</property> <widget class="QCheckBox" name="fulllistCB" >
<property name="toolTip" > <property name="toolTip" >
<string>Citations currently selected</string> <string>List all authors</string>
</property> </property>
<item> <property name="text" >
<property name="text" > <string>&amp;Full author list</string>
<string>New Item</string> </property>
</property> </widget>
</item> </item>
</widget> </layout>
</item>
<item rowspan="1" row="4" column="1" colspan="2" >
<widget class="QPushButton" name="deletePB" >
<property name="text" >
<string>D&amp;elete</string>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="upPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
<property name="icon" >
<pixmap>image1</pixmap>
</property>
<property name="toolTip" >
<string>Move the selected citation up</string>
</property>
</widget>
</item>
<item rowspan="1" row="0" column="0" colspan="3" >
<widget class="QLabel" name="insetKeysLA" >
<property name="text" >
<string>&amp;Citations:</string>
</property>
<property name="buddy" >
<cstring>selectedLB</cstring>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QPushButton" name="addPB" >
<property name="text" >
<string>&amp;Add...</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string/>
</property>
</widget>
</item>
<item row="3" column="2" >
<spacer name="Spacer14" >
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="sizeType" >
<enum>Expanding</enum>
</property>
<property name="orientation" >
<enum>Vertical</enum>
</property>
</spacer>
</item>
</layout>
</item>
<item rowspan="1" row="2" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="restorePB" >
<property name="text" >
<string>&amp;Restore</string>
</property>
</widget>
</item>
<item>
<spacer name="Spacer4" >
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="sizeType" >
<enum>Expanding</enum>
</property>
<property name="orientation" >
<enum>Horizontal</enum>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okPB" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyPB" >
<property name="text" >
<string>A&amp;pply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="closePB" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1" >
<widget class="QGroupBox" name="GroupBox8" >
<property name="title" >
<string>Style</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="citationStyleLA" >
<property name="text" >
<string>Citation &amp;style:</string>
</property>
<property name="buddy" >
<cstring>citationStyleCO</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="citationStyleCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Natbib citation style to use</string>
</property>
</widget>
</item>
<item rowspan="1" row="4" column="0" colspan="2" >
<widget class="QCheckBox" name="forceuppercaseCB" >
<property name="text" >
<string>Force &amp;upper case</string>
</property>
<property name="toolTip" >
<string>Force upper case in citation</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="textAfterLA" >
<property name="text" >
<string>&amp;Text after:</string>
</property>
<property name="buddy" >
<cstring>textAfterED</cstring>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="textAfterED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Text to place after citation</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="textBeforeED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Text to place before citation</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="textBeforeLA" >
<property name="text" >
<string>Text &amp;before:</string>
</property>
<property name="buddy" >
<cstring>textAfterED</cstring>
</property>
</widget>
</item>
<item rowspan="1" row="3" column="0" colspan="2" >
<widget class="QCheckBox" name="fulllistCB" >
<property name="text" >
<string>&amp;Full author list</string>
</property>
<property name="toolTip" >
<string>List all authors</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
<pixmapfunction></pixmapfunction> <widget class="QPushButton" name="downPB" >
<tabstops> <property name="geometry" >
<tabstop>selectedLB</tabstop> <rect>
<tabstop>upPB</tabstop> <x>140</x>
<tabstop>downPB</tabstop> <y>110</y>
<tabstop>addPB</tabstop> <width>41</width>
<tabstop>deletePB</tabstop> <height>25</height>
<tabstop>citationStyleCO</tabstop> </rect>
<tabstop>textBeforeED</tabstop> </property>
<tabstop>textAfterED</tabstop> <property name="sizePolicy" >
<tabstop>fulllistCB</tabstop> <sizepolicy>
<tabstop>forceuppercaseCB</tabstop> <hsizetype>0</hsizetype>
<tabstop>restorePB</tabstop> <vsizetype>0</vsizetype>
<tabstop>okPB</tabstop> <horstretch>0</horstretch>
<tabstop>applyPB</tabstop> <verstretch>0</verstretch>
<tabstop>closePB</tabstop> </sizepolicy>
</tabstops> </property>
<images> <property name="toolTip" >
<image name="image0" > <string>Move the selected citation down</string>
<data format="XPM.GZ" length="1337" >789ca5d2cb6ee2301480e13d4f11c10e8da6101293a89a45e9fd02a59745a5aa0bc7760ab4909424b4a1eabbd7e71c9b409559d562914fbf8d4dcc5edb79180f9df65e23cb793e158e98f0a5d396c57c5e3e3efdfb6c345dd7d11f2f70bacd3f8de65f4738a364a1e059e9e7560707b0850c7ac27781d744cf63c80b43c138b024f6fdd003ae0c43e288188611f2c45046129811235720ef0c193131e4c46343257d6041142ef114d8ed301944c017a23dd587a10c05f01c19b06e1f279f19fa410f288981cf71ed3dd1eebb24da7d5343538f806e27e2c4055130e21019dab5b7c05ed7324786924bbc140ef45dce05d60324b7efea90a8bf1927df001997ae62c035b0dfb3c778230a45754eb49367c020928c3801869ead0343ae70a367a4b093a740ee4945758cd4fbc458df8191548c780514bee2c44b62ecc6313002ca4d8d81b092aa00c61bbe2271e09fb976fcb2b4cca8293c1242ffae9a123f4fa6b397baf23a5f24697d795b66f97f4a91e5abdd42877ad725fd50386c51e57a7dc0078747d9f1c9eaf4ecfc625374ba8caf06c324cb92341d5dabad7d5439beb9d5212b720ad509742a92adb07536487755d83eb54ef755d879d7aa9c5561f7165459851ff7a3aaf0db3bfd59bef61bdf12452a24</data> </property>
</image> <property name="text" >
<image name="image1" > <string>&amp;Down</string>
<data format="XPM.GZ" length="2333" >789cc5d4c96edb301006e0bb9f42086f413191686d44d143f67ddf53f4409192b7388be3c4498abe7ba99911112768e34b5133877ce63f143779613eb838d80de6175a0f633dee99c074f52898b78fc3e1cbf71fdf7eb6e6a40cdc5f960572ee4b6bee701c9860eff6a6ac01a18308f1838ebc73b464c7ec2b761e515eb30d7bc59bf2961c85643160c712f3a260e752613e43e791610b72db243879b821c761a2d16376cc7e699c52fe926dc8a2ef4df92e3909d9176c9b15e87372aaf236d677d836a7fe5d7216b1cfd84ac5e823b65506bd4cce23f6035b69caefb02d7be84df953b2b205f55f930b6912f4c8dba237d92959e079456116f1fc5276c2ee905542e38b8aac9382c6db2217a5a5e73d918d644fd8dad2fd5a42fbe7c3335bb3efc996f3a2575b867e3f37c8fe7909d94a1e7f0fad9af3135db6caf0bce090eccfcbd46e47beff84ece71fb353f61dbb59cf23d93fff18ad7449fb2f4ab2dfff6d7229cb14fbf13ec751635864a7ec03b4f6f35d2737fb25f07d4ab4df8ffddaa96cee9700b29fef2a5aeb88cfefb576d6568aef4fc16eee13ee7f563853fe96ecebdb645b96343eae376f37eb873572333f61c86ebd94c7f73f2f6cb37e452ed38a9cd736b6925585c6fb674b6f7c7f2bfcd08fd9eced7fe541809e3defd20518b0b3e55dba840a3ad0fd58f131efd23de8c300ae610837ef2bdee75dfa16d377700f237880f174c574dea71fe10926aee2d955bcbcad789b77e9571efbc98d3d72158bb004cb6e562b1ff32ebdea56b906ebb0019b98df7215dbb003bb6e567a3aefd27bb00f07700847700c2758318153388373b8804bd77f35950f21c226dd7f036843ecf209a490b96feaef4308ffb89f3928013012426851ccb0ff7dcabbd5a6b3e585c1fcfd8ce3e7c28a525430119d59f2a22b7a2e59b7be187c9a9760c5801aac40f459feefed9fe77f7d6dfd06af616644</data> </property>
</image> <property name="icon" >
</images> <iconset/>
</property>
</widget>
<widget class="QPushButton" name="upPB" >
<property name="geometry" >
<rect>
<x>140</x>
<y>80</y>
<width>41</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Move the selected citation up</string>
</property>
<property name="text" >
<string>&amp;Up</string>
</property>
<property name="icon" >
<iconset/>
</property>
</widget>
<widget class="QPushButton" name="deletePB" >
<property name="geometry" >
<rect>
<x>140</x>
<y>50</y>
<width>41</width>
<height>25</height>
</rect>
</property>
<property name="text" >
<string>D&amp;elete</string>
</property>
</widget>
<widget class="QPushButton" name="addPB" >
<property name="geometry" >
<rect>
<x>140</x>
<y>20</y>
<width>41</width>
<height>25</height>
</rect>
</property>
<property name="toolTip" >
<string/>
</property>
<property name="text" >
<string>&amp;Add</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="selectedKeysLA" >
<property name="geometry" >
<rect>
<x>10</x>
<y>0</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text" >
<string>&amp;Citations to insert:</string>
</property>
<property name="buddy" >
<cstring>selectedLV</cstring>
</property>
</widget>
<widget class="QLabel" name="availableKeysLA" >
<property name="geometry" >
<rect>
<x>190</x>
<y>0</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text" >
<string>&amp;Available Citations:</string>
</property>
<property name="buddy" >
<cstring>selectedLB</cstring>
</property>
</widget>
<widget class="QLabel" name="findKeysLA" >
<property name="geometry" >
<rect>
<x>160</x>
<y>206</y>
<width>23</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string>&amp;Find:</string>
</property>
<property name="buddy" >
<cstring>selectedLV</cstring>
</property>
</widget>
<widget class="QPushButton" name="advancedSearchPB" >
<property name="geometry" >
<rect>
<x>260</x>
<y>240</y>
<width>111</width>
<height>31</height>
</rect>
</property>
<property name="text" >
<string>Advanced &amp;Search...</string>
</property>
</widget>
<widget class="QTextEdit" name="infoML" >
<property name="geometry" >
<rect>
<x>10</x>
<y>380</y>
<width>371</width>
<height>71</height>
</rect>
</property>
<property name="documentTitle" >
<string>Citation Information</string>
</property>
</widget>
<widget class="QListView" name="selectedLV" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>120</width>
<height>181</height>
</rect>
</property>
</widget>
<widget class="QListView" name="availableLV" >
<property name="geometry" >
<rect>
<x>190</x>
<y>20</y>
<width>120</width>
<height>181</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="findLE" >
<property name="geometry" >
<rect>
<x>190</x>
<y>204</y>
<width>120</width>
<height>20</height>
</rect>
</property>
<property name="text" >
<string/>
</property>
</widget>
</widget>
<pixmapfunction></pixmapfunction>
<tabstops>
<tabstop>upPB</tabstop>
<tabstop>downPB</tabstop>
<tabstop>addPB</tabstop>
<tabstop>deletePB</tabstop>
<tabstop>citationStyleCO</tabstop>
<tabstop>textBeforeED</tabstop>
<tabstop>textAfterED</tabstop>
<tabstop>fulllistCB</tabstop>
<tabstop>forceuppercaseCB</tabstop>
<tabstop>restorePB</tabstop>
<tabstop>okPB</tabstop>
<tabstop>applyPB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
<resources/>
<connections/>
</ui> </ui>