- cleanup
(1): http://kdenlive.org/mantis/view.php?id=1644
svn path=/trunk/kdenlive/; revision=4506
search_effect->setTreeWidget(m_effectsList);
buttonInfo->setIcon(KIcon("help-about"));
setFocusPolicy(Qt::StrongFocus);
search_effect->setTreeWidget(m_effectsList);
buttonInfo->setIcon(KIcon("help-about"));
setFocusPolicy(Qt::StrongFocus);
+ setFocusProxy(search_effect);
if (KdenliveSettings::showeffectinfo()) {
buttonInfo->setDown(true);
if (KdenliveSettings::showeffectinfo()) {
buttonInfo->setDown(true);
connect(m_effectsList, SIGNAL(itemSelectionChanged()), this, SLOT(slotUpdateInfo()));
connect(m_effectsList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotEffectSelected()));
connect(search_effect, SIGNAL(hiddenChanged(QTreeWidgetItem *, bool)), this, SLOT(slotUpdateSearch(QTreeWidgetItem *, bool)));
connect(m_effectsList, SIGNAL(itemSelectionChanged()), this, SLOT(slotUpdateInfo()));
connect(m_effectsList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(slotEffectSelected()));
connect(search_effect, SIGNAL(hiddenChanged(QTreeWidgetItem *, bool)), this, SLOT(slotUpdateSearch(QTreeWidgetItem *, bool)));
+ connect(search_effect, SIGNAL(textChanged(QString)), this, SLOT(slotAutoExpand(QString)));
//m_effectsList->setCurrentRow(0);
}
//m_effectsList->setCurrentRow(0);
}
-
-void EffectsListView::focusInEvent(QFocusEvent * /*event*/)
-{
- search_effect->setFocus();
-}
-
void EffectsListView::filterList(int pos)
{
for (int i = 0; i < m_effectsList->topLevelItemCount(); i++) {
void EffectsListView::filterList(int pos)
{
for (int i = 0; i < m_effectsList->topLevelItemCount(); i++) {
// make sure we don't show anything not matching the search expression
search_effect->updateSearch();
// make sure we don't show anything not matching the search expression
search_effect->updateSearch();
/*item = m_effectsList->currentItem();
if (item) {
if (item->isHidden()) {
/*item = m_effectsList->currentItem();
if (item) {
if (item->isHidden()) {
void EffectsListView::showInfoPanel()
{
void EffectsListView::showInfoPanel()
{
- if (infopanel->isVisible()) {
- infopanel->setVisible(false);
- buttonInfo->setDown(false);
- KdenliveSettings::setShoweffectinfo(false);
- } else {
- infopanel->setVisible(true);
- buttonInfo->setDown(true);
- KdenliveSettings::setShoweffectinfo(true);
- }
+ bool show = !infopanel->isVisible();
+ infopanel->setVisible(show);
+ buttonInfo->setDown(show);
+ KdenliveSettings::setShoweffectinfo(show);
}
void EffectsListView::slotEffectSelected()
}
void EffectsListView::slotEffectSelected()
+void EffectsListView::slotAutoExpand(QString text)
+{
+ for (int i = 0; i < m_effectsList->topLevelItemCount(); ++i) {
+ QTreeWidgetItem *folder = m_effectsList->topLevelItem(i);
+ bool expandFolder = false;
+ /*if (folder->isHidden())
+ continue;*/
+ if (!text.isEmpty()) {
+ for (int j = 0; j < folder->childCount(); j++) {
+ QTreeWidgetItem *item = folder->child(j);
+ if (!item->isHidden())
+ expandFolder = true;
+ }
+ }
+ folder->setExpanded(expandFolder);
+ }
+}
+
#include "effectslistview.moc"
#include "effectslistview.moc"
class EffectsListWidget;
class QTreeWidget;
class EffectsListWidget;
class QTreeWidget;
+/**
+ * @class EffectsListView
+ * @brief Manages the controls for the treewidget containing the effects.
+ * @author Jean-Baptiste Mardelle
+ */
+
class EffectsListView : public QWidget, public Ui::EffectList_UI
{
Q_OBJECT
public:
EffectsListView(QWidget *parent = 0);
class EffectsListView : public QWidget, public Ui::EffectList_UI
{
Q_OBJECT
public:
EffectsListView(QWidget *parent = 0);
+
+ /** @brief Re-initializes the list of effets. */
void reloadEffectList();
//void slotAddEffect(GenTime pos, int track, QString name);
void reloadEffectList();
//void slotAddEffect(GenTime pos, int track, QString name);
-protected:
- virtual void focusInEvent(QFocusEvent * event);
-
private:
EffectsListWidget *m_effectsList;
private slots:
private:
EffectsListWidget *m_effectsList;
private slots:
+ /** @brief Applies the type filter to the effect list.
+ * @param pos Index of the combo box; where 0 = All, 1 = Video, 2 = Audio, 3 = Custom */
void filterList(int pos);
void filterList(int pos);
+
+ /** @brief Updates the info panel to match the selected effect. */
+
+ /** @brief Toggles the info panel's visibility. */
+
+ /** @brief Emits addEffect signal for the selected effect. */
void slotEffectSelected();
void slotEffectSelected();
+
+ /** @brief Removes the XML file for the selected effect.
+ *
+ * Only used for custom effects */
+
+ /** @brief Makes sure the item fits the type filter.
+ * @param item Current item
+ * @param hidden Hidden or not
+ *
+ * This is necessary to make the search obey to the type filter.
+ * Called when the visibility of this item was changed by searching */
void slotUpdateSearch(QTreeWidgetItem *item, bool hidden);
void slotUpdateSearch(QTreeWidgetItem *item, bool hidden);
+ /** @brief Expands folders that match our search.
+ * @param text Current search string */
+ void slotAutoExpand(QString text);
signals:
void addEffect(const QDomElement);
signals:
void addEffect(const QDomElement);