Commit 74e842ea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: get Bookmark events from the core and update in Bookmark dialog.

This remove the update() calls from within the bookmark dialog, since the update() is triggered from the core.
This needs more testing.
parent c2af399f
......@@ -80,6 +80,9 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
layout->setColumnStretch( 1, 1 );
layout->addWidget( closeButton, 7, 2 );
CONNECT( THEMIM->getIM(), bookmarksChanged(),
this, update() );
CONNECT( bookmarksList, activated( QModelIndex ), this,
activateItem( QModelIndex ) );
CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ),
......@@ -154,7 +157,6 @@ void BookmarksDialog::add()
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
}
update();
}
void BookmarksDialog::del()
......@@ -168,8 +170,6 @@ void BookmarksDialog::del()
{
input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
}
update();
}
void BookmarksDialog::clear()
......@@ -178,8 +178,6 @@ void BookmarksDialog::clear()
if( !p_input ) return;
input_Control( p_input, INPUT_CLEAR_BOOKMARKS );
update();
}
void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
......@@ -239,9 +237,6 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
VLC_SUCCESS )
goto clear;
// Everything goes fine : update
update();
// Clear the bookmark list
clear:
for( int i = 0; i < i_bookmarks; i++)
......
......@@ -165,7 +165,8 @@ void InputManager::customEvent( QEvent *event )
i_type != NameChanged_Type &&
i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type &&
i_type != CachingEvent_Type )
i_type != CachingEvent_Type &&
i_type != BookmarksChanged_Type )
return;
if( i_type == CachingEvent_Type )
......@@ -183,7 +184,8 @@ void InputManager::customEvent( QEvent *event )
i_type != MetaChanged_Type &&
i_type != NameChanged_Type &&
i_type != InfoChanged_Type &&
i_type != SynchroChanged_Type
i_type != SynchroChanged_Type &&
i_type != BookmarksChanged_Type
)
&& ( i_input_id != ple->i_id ) )
return;
......@@ -248,6 +250,9 @@ void InputManager::customEvent( QEvent *event )
case CachingEvent_Type:
UpdateCaching();
break;
case BookmarksChanged_Type:
emit bookmarksChanged();
break;
default:
msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
}
......@@ -837,8 +842,8 @@ static int InputEvent( vlc_object_t *p_this, const char *,
break;
case INPUT_EVENT_BOOKMARK:
/* event = new IMEvent( BookmarkChanged_Type, 0 );
break; */
event = new IMEvent( BookmarksChanged_Type, 0 );
break;
case INPUT_EVENT_PROGRAM:
/* event = new IMEvent( ProgramChanged_Type, 0 );
break; */
......
......@@ -53,8 +53,8 @@ enum {
InfoChanged_Type,
SynchroChanged_Type,
CachingEvent_Type,
/* BookmarkChanged_Type,
RecordingEvent_Type,
BookmarksChanged_Type,
/* RecordingEvent_Type,
ProgramChanged_Type,
SignalChanged_Type, */
......@@ -180,6 +180,7 @@ signals:
/// Vout
void voutChanged( bool );
void synchroChanged();
void bookmarksChanged();
void cachingChanged( float );
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment