this, SLOT(changed()));
connect(textAfterED, SIGNAL(textChanged(const QString&)),
this, SLOT(changed()));
+ connect(clearPB, SIGNAL(clicked()),
+ findLE, SLOT(clear()));
+ connect(availableLV->selectionModel(),
+ SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
+ this, SLOT(availableChanged(const QModelIndex &, const QModelIndex &)));
+ connect(selectedLV->selectionModel(),
+ SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
+ this, SLOT(selectedChanged(const QModelIndex &, const QModelIndex &)));
}
void QCitationDialog::on_okPB_clicked()
{
apply();
+ form_->clearSelection();
accept();
}
void QCitationDialog::on_cancelPB_clicked()
{
+ form_->clearSelection();
accept();
}
{
form_->updateModel();
- QModelIndex idxa = availableLV->currentIndex();
- if (!idxa.isValid())
+ QModelIndex const idxa = availableLV->currentIndex();
+ if (form_->available()->rowCount() > 0 && !idxa.isValid())
availableLV->setCurrentIndex(availableLV->model()->index(0,0));
- QModelIndex idx = selectedLV->currentIndex();
- if (form_->isValid() && !idx.isValid()) {
+ QModelIndex const idx = selectedLV->currentIndex();
+ if (form_->selected()->rowCount() > 0 && !idx.isValid()) {
selectedLV->setCurrentIndex(selectedLV->model()->index(0,0));
updateInfo(selectedLV->currentIndex());
} else
fulllistCB->setEnabled(natbib_engine);
forceuppercaseCB->setEnabled(natbib_engine);
textBeforeED->setEnabled(!basic_engine);
+ textBeforeLA->setEnabled(!basic_engine);
string const & command = form_->params().getCmdName();
return;
}
- if (selectedLV->selectionModel()->selectedIndexes().empty())
+ int curr = selectedLV->model()->rowCount() - 1;
+ if (curr < 0)
return;
-
- int curr = selectedLV->selectionModel()->selectedIndexes()[0].row();//selectedLV->currentItem();
+
+ if (!selectedLV->selectionModel()->selectedIndexes().empty())
+ curr = selectedLV->selectionModel()->selectedIndexes()[0].row();
QStringList sty = form_->citationStyles(curr);
citationStyleCO->setEnabled(!sty.isEmpty() && !basic_engine);
citationStyleLA->setEnabled(!sty.isEmpty() && !basic_engine);
+ if (sty.isEmpty() || basic_engine)
+ return;
+
citationStyleCO->insertItems(0, sty);
if (orig != -1 && orig < citationStyleCO->count())
void QCitationDialog::on_selectedLV_clicked(const QModelIndex & idx)
{
+ availableLV->selectionModel()->clear();
+
+ updateInfo(idx);
+ changed();
+}
+
+
+void QCitationDialog::selectedChanged(const QModelIndex & idx, const QModelIndex &)
+{
+ if (!idx.isValid())
+ return;
+
updateInfo(idx);
changed();
}
+
void QCitationDialog::on_availableLV_clicked(const QModelIndex & idx)
{
+ selectedLV->selectionModel()->clear();
+
+ updateInfo(idx);
+ setButtons();
+}
+
+
+void QCitationDialog::availableChanged(const QModelIndex & idx, const QModelIndex &)
+{
+ if (!idx.isValid())
+ return;
+
updateInfo(idx);
setButtons();
}
void QCitationDialog::on_findLE_textChanged(const QString & text)
{
+ clearPB->setDisabled(text.isEmpty());
+ if (text.isEmpty())
+ findLE->setFocus();
+
form_->findKey(text);
+ if (form_->found()->rowCount() == 0) {
+ findLE->backspace();
+ return;
+ }
availableLV->setModel(form_->found());
changed();
}
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item>
- <layout class="QGridLayout" >
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item row="0" column="0" colspan="2" >
- <widget class="QLabel" name="availableKeysLA" >
+ <item>
+ <widget class="QLabel" name="findKeysLA" >
<property name="text" >
- <string>&Available Citations:</string>
- </property>
- <property name="buddy" >
- <cstring>availableLV</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QPushButton" name="addPB" >
- <property name="toolTip" >
- <string/>
+ <string>&Find:</string>
</property>
- <property name="text" >
- <string>&Add</string>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
- <property name="autoDefault" >
- <bool>true</bool>
+ <property name="buddy" >
+ <cstring>selectedLV</cstring>
</property>
</widget>
</item>
- <item row="0" column="2" >
- <widget class="QLabel" name="selectedKeysLA" >
+ <item>
+ <widget class="QLineEdit" name="findLE" >
<property name="text" >
- <string>&Selected Citations:</string>
- </property>
- <property name="buddy" >
- <cstring>selectedLV</cstring>
+ <string/>
</property>
</widget>
</item>
- <item row="4" column="1" >
- <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="toolTip" >
- <string>Move the selected citation up</string>
+ <item>
+ <widget class="QPushButton" name="clearPB" >
+ <property name="enabled" >
+ <bool>false</bool>
</property>
<property name="text" >
- <string>&Up</string>
- </property>
- <property name="icon" >
- <iconset/>
+ <string><- Clear</string>
</property>
</widget>
</item>
- <item rowspan="5" row="1" column="2" >
- <widget class="QListView" name="selectedLV" >
- <property name="editTriggers" >
- <set>QAbstractItemView::NoEditTriggers</set>
+ </layout>
+ </item>
+ <item row="4" column="0" >
+ <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>&Restore</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
+ <item>
<spacer>
<property name="orientation" >
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
- <width>20</width>
- <height>16</height>
+ <width>40</width>
+ <height>20</height>
</size>
</property>
</spacer>
</item>
- <item rowspan="5" row="1" column="0" >
- <widget class="QListView" name="availableLV" >
- <property name="editTriggers" >
- <set>QAbstractItemView::NoEditTriggers</set>
- </property>
- </widget>
- </item>
- <item row="5" column="1" >
- <widget class="QPushButton" name="downPB" >
- <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 down</string>
- </property>
+ <item>
+ <widget class="QPushButton" name="okPB" >
<property name="text" >
- <string>&Down</string>
+ <string>&OK</string>
</property>
- <property name="icon" >
- <iconset/>
+ <property name="autoDefault" >
+ <bool>true</bool>
</property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QPushButton" name="deletePB" >
- <property name="text" >
- <string>D&elete</string>
+ <property name="default" >
+ <bool>true</bool>
</property>
</widget>
</item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
<item>
- <widget class="QLabel" name="findKeysLA" >
+ <widget class="QPushButton" name="applyPB" >
<property name="text" >
- <string>&Find:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- <property name="buddy" >
- <cstring>selectedLV</cstring>
+ <string>A&pply</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="findLE" >
+ <widget class="QPushButton" name="cancelPB" >
<property name="text" >
- <string/>
+ <string>&Cancel</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
- <item>
- <widget class="QTextBrowser" name="infoML" />
- </item>
- <item>
+ <item row="3" column="0" >
<widget class="QGroupBox" name="styleGB" >
<property name="title" >
<string>Formatting</string>
</property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</layout>
</widget>
</item>
- <item>
- <layout class="QHBoxLayout" >
+ <item row="2" column="0" >
+ <widget class="QTextBrowser" name="infoML" />
+ </item>
+ <item row="0" column="0" >
+ <layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item>
- <widget class="QPushButton" name="restorePB" >
+ <item row="0" column="0" colspan="2" >
+ <widget class="QLabel" name="availableKeysLA" >
<property name="text" >
- <string>&Restore</string>
+ <string>&Available Citations:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>availableLV</cstring>
</property>
</widget>
</item>
- <item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="addPB" >
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="text" >
+ <string>&Add</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLabel" name="selectedKeysLA" >
+ <property name="text" >
+ <string>&Selected Citations:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>selectedLV</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <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="toolTip" >
+ <string>Move the selected citation up</string>
+ </property>
+ <property name="text" >
+ <string>&Up</string>
+ </property>
+ <property name="icon" >
+ <iconset/>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="5" row="1" column="2" >
+ <widget class="QListView" name="selectedLV" >
+ <property name="editTriggers" >
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
<spacer>
<property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
- <width>40</width>
- <height>20</height>
+ <width>20</width>
+ <height>16</height>
</size>
</property>
</spacer>
</item>
- <item>
- <widget class="QPushButton" name="okPB" >
- <property name="text" >
- <string>&OK</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="default" >
- <bool>true</bool>
+ <item rowspan="5" row="1" column="0" >
+ <widget class="QListView" name="availableLV" >
+ <property name="editTriggers" >
+ <set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="applyPB" >
+ <item row="5" column="1" >
+ <widget class="QPushButton" name="downPB" >
+ <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 down</string>
+ </property>
<property name="text" >
- <string>A&pply</string>
+ <string>&Down</string>
+ </property>
+ <property name="icon" >
+ <iconset/>
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="cancelPB" >
+ <item row="2" column="1" >
+ <widget class="QPushButton" name="deletePB" >
<property name="text" >
- <string>&Cancel</string>
- </property>
- <property name="autoDefault" >
- <bool>false</bool>
+ <string>D&elete</string>
</property>
</widget>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
- <includes>
- <include location="local" >qt_helpers.h</include>
- </includes>
<tabstops>
<tabstop>availableLV</tabstop>
<tabstop>selectedLV</tabstop>
<tabstop>applyPB</tabstop>
<tabstop>cancelPB</tabstop>
</tabstops>
+ <includes>
+ <include location="local" >qt_helpers.h</include>
+ </includes>
<resources/>
<connections/>
</ui>