|
|
@ -134,7 +134,7 @@ KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (TQWidget * tqparent, View * view
|
|
|
|
menu_pix = KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small);
|
|
|
|
menu_pix = KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small);
|
|
|
|
config_pix = KGlobal::iconLoader ()->loadIcon (TQString ("configure"), KIcon::Small);
|
|
|
|
config_pix = KGlobal::iconLoader ()->loadIcon (TQString ("configure"), KIcon::Small);
|
|
|
|
url_pix = KGlobal::iconLoader ()->loadIcon (TQString ("www"), KIcon::Small);
|
|
|
|
url_pix = KGlobal::iconLoader ()->loadIcon (TQString ("www"), KIcon::Small);
|
|
|
|
m_tqfind = KStdAction::find (TQT_TQOBJECT(this), TQT_SLOT (slotFind ()), ac, "tqfind");
|
|
|
|
m_find = KStdAction::find (TQT_TQOBJECT(this), TQT_SLOT (slotFind ()), ac, "find");
|
|
|
|
m_find_next = KStdAction::findNext (TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac, "next");
|
|
|
|
m_find_next = KStdAction::findNext (TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac, "next");
|
|
|
|
m_find_next->setEnabled (false);
|
|
|
|
m_find_next->setEnabled (false);
|
|
|
|
connect (this, TQT_SIGNAL (contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT (contextMenuItem (TQListViewItem *, const TQPoint &, int)));
|
|
|
|
connect (this, TQT_SIGNAL (contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT (contextMenuItem (TQListViewItem *, const TQPoint &, int)));
|
|
|
@ -312,7 +312,7 @@ void PlayListView::selectItem (const TQString & txt) {
|
|
|
|
TQListViewItem * item = selectedItem ();
|
|
|
|
TQListViewItem * item = selectedItem ();
|
|
|
|
if (item && item->text (0) == txt)
|
|
|
|
if (item && item->text (0) == txt)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
item = tqfindItem (txt, 0);
|
|
|
|
item = findItem (txt, 0);
|
|
|
|
if (item) {
|
|
|
|
if (item) {
|
|
|
|
setSelected (item, true);
|
|
|
|
setSelected (item, true);
|
|
|
|
ensureItemVisible (item);
|
|
|
|
ensureItemVisible (item);
|
|
|
@ -346,7 +346,7 @@ KDE_NO_EXPORT void PlayListView::contextMenuItem (TQListViewItem * vi, const TQP
|
|
|
|
if (item->node || item->m_attr) {
|
|
|
|
if (item->node || item->m_attr) {
|
|
|
|
RootPlayListItem * ritem = rootItem (vi);
|
|
|
|
RootPlayListItem * ritem = rootItem (vi);
|
|
|
|
if (m_itemmenu->count () > 0) {
|
|
|
|
if (m_itemmenu->count () > 0) {
|
|
|
|
m_tqfind->unplug (m_itemmenu);
|
|
|
|
m_find->unplug (m_itemmenu);
|
|
|
|
m_find_next->unplug (m_itemmenu);
|
|
|
|
m_find_next->unplug (m_itemmenu);
|
|
|
|
m_itemmenu->clear ();
|
|
|
|
m_itemmenu->clear ();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -368,7 +368,7 @@ KDE_NO_EXPORT void PlayListView::contextMenuItem (TQListViewItem * vi, const TQP
|
|
|
|
m_itemmenu->setItemChecked (2, ritem->show_all_nodes);
|
|
|
|
m_itemmenu->setItemChecked (2, ritem->show_all_nodes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_itemmenu->insertSeparator ();
|
|
|
|
m_itemmenu->insertSeparator ();
|
|
|
|
m_tqfind->plug (m_itemmenu);
|
|
|
|
m_find->plug (m_itemmenu);
|
|
|
|
m_find_next->plug (m_itemmenu);
|
|
|
|
m_find_next->plug (m_itemmenu);
|
|
|
|
emit prepareMenu (item, m_itemmenu);
|
|
|
|
emit prepareMenu (item, m_itemmenu);
|
|
|
|
m_itemmenu->exec (p);
|
|
|
|
m_itemmenu->exec (p);
|
|
|
@ -506,7 +506,7 @@ KDE_NO_EXPORT void PlayListView::itemIsRenamed (TQListViewItem * qitem) {
|
|
|
|
updateTree (ri, item->node, true);
|
|
|
|
updateTree (ri, item->node, true);
|
|
|
|
} else if (item->m_attr) {
|
|
|
|
} else if (item->m_attr) {
|
|
|
|
TQString txt = item->text (0);
|
|
|
|
TQString txt = item->text (0);
|
|
|
|
int pos = txt.tqfind (TQChar ('='));
|
|
|
|
int pos = txt.find (TQChar ('='));
|
|
|
|
if (pos > -1) {
|
|
|
|
if (pos > -1) {
|
|
|
|
item->m_attr->setName (txt.left (pos));
|
|
|
|
item->m_attr->setName (txt.left (pos));
|
|
|
|
item->m_attr->setValue (txt.mid (pos + 1));
|
|
|
|
item->m_attr->setValue (txt.mid (pos + 1));
|
|
|
@ -553,7 +553,7 @@ KDE_NO_EXPORT void PlayListView::editCurrent () {
|
|
|
|
KDE_NO_EXPORT void PlayListView::slotFind () {
|
|
|
|
KDE_NO_EXPORT void PlayListView::slotFind () {
|
|
|
|
m_current_find_elm = 0L;
|
|
|
|
m_current_find_elm = 0L;
|
|
|
|
if (!m_find_dialog) {
|
|
|
|
if (!m_find_dialog) {
|
|
|
|
m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_tqfind", KFindDialog::CaseSensitive);
|
|
|
|
m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_find", KFindDialog::CaseSensitive);
|
|
|
|
m_find_dialog->setHasSelection (false);
|
|
|
|
m_find_dialog->setHasSelection (false);
|
|
|
|
connect(m_find_dialog, TQT_SIGNAL(okClicked ()), this, TQT_SLOT(slotFindOk ()));
|
|
|
|
connect(m_find_dialog, TQT_SIGNAL(okClicked ()), this, TQT_SLOT(slotFindOk ()));
|
|
|
|
} else
|
|
|
|
} else
|
|
|
@ -607,7 +607,7 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
|
|
|
|
slotFindNext ();
|
|
|
|
slotFindNext ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* A bit tricky, but between the tqfind's PlayListItems might be gone, so
|
|
|
|
/* A bit tricky, but between the find's PlayListItems might be gone, so
|
|
|
|
* try to match on the generated tree following the source's document tree
|
|
|
|
* try to match on the generated tree following the source's document tree
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
KDE_NO_EXPORT void PlayListView::slotFindNext () {
|
|
|
|
KDE_NO_EXPORT void PlayListView::slotFindNext () {
|
|
|
@ -640,9 +640,9 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
|
|
|
|
} else if (!elm)
|
|
|
|
} else if (!elm)
|
|
|
|
val = n->nodeValue ();
|
|
|
|
val = n->nodeValue ();
|
|
|
|
if (((opt & KFindDialog::RegularExpression) &&
|
|
|
|
if (((opt & KFindDialog::RegularExpression) &&
|
|
|
|
val.tqfind (regexp, 0) > -1) ||
|
|
|
|
val.find (regexp, 0) > -1) ||
|
|
|
|
(!(opt & KFindDialog::RegularExpression) &&
|
|
|
|
(!(opt & KFindDialog::RegularExpression) &&
|
|
|
|
val.tqfind (str, 0, cs) > -1)) {
|
|
|
|
val.find (str, 0, cs) > -1)) {
|
|
|
|
node = n;
|
|
|
|
node = n;
|
|
|
|
m_current_find_attr = 0L;
|
|
|
|
m_current_find_attr = 0L;
|
|
|
|
found = true;
|
|
|
|
found = true;
|
|
|
@ -650,9 +650,9 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
|
|
|
|
for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) {
|
|
|
|
for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) {
|
|
|
|
TQString attr = a->name ().toString ();
|
|
|
|
TQString attr = a->name ().toString ();
|
|
|
|
if (((opt & KFindDialog::RegularExpression) &&
|
|
|
|
if (((opt & KFindDialog::RegularExpression) &&
|
|
|
|
(attr.tqfind (regexp, 0) || a->value ().tqfind (regexp, 0) > -1)) ||
|
|
|
|
(attr.find (regexp, 0) || a->value ().find (regexp, 0) > -1)) ||
|
|
|
|
(!(opt & KFindDialog::RegularExpression) &&
|
|
|
|
(!(opt & KFindDialog::RegularExpression) &&
|
|
|
|
(attr.tqfind (str, 0, cs) > -1 || a->value ().tqfind (str, 0, cs) > -1))) {
|
|
|
|
(attr.find (str, 0, cs) > -1 || a->value ().find (str, 0, cs) > -1))) {
|
|
|
|
node = n;
|
|
|
|
node = n;
|
|
|
|
m_current_find_attr = a;
|
|
|
|
m_current_find_attr = a;
|
|
|
|
found = true;
|
|
|
|
found = true;
|
|
|
|