Commit 68db9417 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - remove trailing space due to Bookmark implementation.

parent 734452c8
...@@ -35,14 +35,14 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -35,14 +35,14 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
setWindowFlags( Qt::Tool ); setWindowFlags( Qt::Tool );
setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
setWindowTitle( qtr( "Edit bookmark" ) ); setWindowTitle( qtr( "Edit bookmark" ) );
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
QPushButton *addButton = new QPushButton( qtr( "Add" ) ); QPushButton *addButton = new QPushButton( qtr( "Add" ) );
QPushButton *delButton = new QPushButton( qtr( "Delete" ) ); QPushButton *delButton = new QPushButton( qtr( "Delete" ) );
QPushButton *clearButton = new QPushButton( qtr( "Clear" ) ); QPushButton *clearButton = new QPushButton( qtr( "Clear" ) );
QPushButton *extractButton = new QPushButton( qtr( "Extract" ) ); QPushButton *extractButton = new QPushButton( qtr( "Extract" ) );
bookmarksList = new QTreeWidget( this ); bookmarksList = new QTreeWidget( this );
bookmarksList->setRootIsDecorated( false ); bookmarksList->setRootIsDecorated( false );
bookmarksList->setAlternatingRowColors( true ); bookmarksList->setAlternatingRowColors( true );
...@@ -55,8 +55,8 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -55,8 +55,8 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
headerLabels << qtr( "Bytes" ); headerLabels << qtr( "Bytes" );
headerLabels << qtr( "Time" ); headerLabels << qtr( "Time" );
bookmarksList->setHeaderLabels( headerLabels ); bookmarksList->setHeaderLabels( headerLabels );
layout->addWidget( addButton, 0, 0 ); layout->addWidget( addButton, 0, 0 );
layout->addWidget( delButton, 1, 0 ); layout->addWidget( delButton, 1, 0 );
layout->addWidget( clearButton, 2, 0 ); layout->addWidget( clearButton, 2, 0 );
...@@ -64,16 +64,16 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -64,16 +64,16 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
layout->addWidget( extractButton, 5, 0 ); layout->addWidget( extractButton, 5, 0 );
layout->addWidget( bookmarksList, 0, 1, 6, 1); layout->addWidget( bookmarksList, 0, 1, 6, 1);
layout->setColumnStretch( 1, 1 ); layout->setColumnStretch( 1, 1 );
CONNECT( bookmarksList, activated( QModelIndex ), this, CONNECT( bookmarksList, activated( QModelIndex ), this,
activateItem( QModelIndex ) ); activateItem( QModelIndex ) );
CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ), this, edit( QTreeWidgetItem*, int ) ); CONNECT( bookmarksList, itemChanged( QTreeWidgetItem*, int ), this, edit( QTreeWidgetItem*, int ) );
BUTTONACT( addButton, add() ); BUTTONACT( addButton, add() );
BUTTONACT( delButton, del() ); BUTTONACT( delButton, del() );
BUTTONACT( clearButton, clear() ); BUTTONACT( clearButton, clear() );
BUTTONACT( extractButton, extract() ); BUTTONACT( extractButton, extract() );
} }
BookmarksDialog::~BookmarksDialog() BookmarksDialog::~BookmarksDialog()
...@@ -84,19 +84,19 @@ void BookmarksDialog::update() ...@@ -84,19 +84,19 @@ void BookmarksDialog::update()
{ {
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
seekpoint_t **pp_bookmarks; seekpoint_t **pp_bookmarks;
int i_bookmarks; int i_bookmarks;
if( bookmarksList->topLevelItemCount() > 0 ) if( bookmarksList->topLevelItemCount() > 0 )
{ {
bookmarksList->model()->removeRows( 0, bookmarksList->topLevelItemCount() ); bookmarksList->model()->removeRows( 0, bookmarksList->topLevelItemCount() );
} }
if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks,
&i_bookmarks ) != VLC_SUCCESS ) &i_bookmarks ) != VLC_SUCCESS )
return; return;
for( int i = 0; i < i_bookmarks; i++ ) for( int i = 0; i < i_bookmarks; i++ )
{ {
// List with the differents elements of the row // List with the differents elements of the row
...@@ -109,51 +109,51 @@ void BookmarksDialog::update() ...@@ -109,51 +109,51 @@ void BookmarksDialog::update()
Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
bookmarksList->insertTopLevelItem( i, item ); bookmarksList->insertTopLevelItem( i, item );
} }
} }
void BookmarksDialog::add() void BookmarksDialog::add()
{ {
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
seekpoint_t bookmark; seekpoint_t bookmark;
vlc_value_t pos; vlc_value_t pos;
bookmark.psz_name = NULL; bookmark.psz_name = NULL;
bookmark.i_byte_offset = 0; bookmark.i_byte_offset = 0;
bookmark.i_time_offset = 0; bookmark.i_time_offset = 0;
input_Control( p_input, INPUT_GET_BYTE_POSITION, &bookmark.i_byte_offset ); input_Control( p_input, INPUT_GET_BYTE_POSITION, &bookmark.i_byte_offset );
var_Get( p_input, "time", &pos ); var_Get( p_input, "time", &pos );
bookmark.i_time_offset = pos.i_time; bookmark.i_time_offset = pos.i_time;
input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark ); input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
update(); update();
} }
void BookmarksDialog::del() void BookmarksDialog::del()
{ {
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
int i_focused = bookmarksList->currentIndex().row(); int i_focused = bookmarksList->currentIndex().row();
if( i_focused >= 0 ) if( i_focused >= 0 )
{ {
input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused ); input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
} }
update(); update();
} }
void BookmarksDialog::clear() void BookmarksDialog::clear()
{ {
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
input_Control( p_input, INPUT_CLEAR_BOOKMARKS ); input_Control( p_input, INPUT_CLEAR_BOOKMARKS );
update(); update();
} }
...@@ -163,24 +163,24 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column ) ...@@ -163,24 +163,24 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
if( bookmarksList->selectedItems().isEmpty() || if( bookmarksList->selectedItems().isEmpty() ||
bookmarksList->selectedItems().last() != item ) bookmarksList->selectedItems().last() != item )
return; return;
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
// We get the row number of the item // We get the row number of the item
int i_edit = bookmarksList->indexOfTopLevelItem( item ); int i_edit = bookmarksList->indexOfTopLevelItem( item );
// We get the bookmarks list // We get the bookmarks list
seekpoint_t **pp_bookmarks; seekpoint_t **pp_bookmarks;
int i_bookmarks; int i_bookmarks;
if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks,
&i_bookmarks ) != VLC_SUCCESS ) &i_bookmarks ) != VLC_SUCCESS )
return; return;
if( i_edit >= i_bookmarks ) if( i_edit >= i_bookmarks )
return; return;
// We modify the seekpoint // We modify the seekpoint
seekpoint_t *p_seekpoint = pp_bookmarks[i_edit]; seekpoint_t *p_seekpoint = pp_bookmarks[i_edit];
if( column == 0 ) if( column == 0 )
...@@ -189,13 +189,13 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column ) ...@@ -189,13 +189,13 @@ void BookmarksDialog::edit( QTreeWidgetItem *item, int column )
p_seekpoint->i_byte_offset = atoi( qtu( item->text( column ) ) ); p_seekpoint->i_byte_offset = atoi( qtu( item->text( column ) ) );
else if( column == 2 ) else if( column == 2 )
p_seekpoint->i_time_offset = 1000000 * atoll( qtu( item->text( column ) ) ); p_seekpoint->i_time_offset = 1000000 * atoll( qtu( item->text( column ) ) );
if( input_Control( p_input, INPUT_CHANGE_BOOKMARK, p_seekpoint, i_edit ) != if( input_Control( p_input, INPUT_CHANGE_BOOKMARK, p_seekpoint, i_edit ) !=
VLC_SUCCESS ) VLC_SUCCESS )
return; return;
update(); update();
} }
void BookmarksDialog::extract() void BookmarksDialog::extract()
...@@ -207,6 +207,6 @@ void BookmarksDialog::activateItem( QModelIndex index ) ...@@ -207,6 +207,6 @@ void BookmarksDialog::activateItem( QModelIndex index )
{ {
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return; if( !p_input ) return;
input_Control( p_input, INPUT_SET_BOOKMARK, index.row() ); input_Control( p_input, INPUT_SET_BOOKMARK, index.row() );
} }
...@@ -205,7 +205,7 @@ void DialogsProvider::mediaCodecDialog() ...@@ -205,7 +205,7 @@ void DialogsProvider::mediaCodecDialog()
void DialogsProvider::bookmarksDialog() void DialogsProvider::bookmarksDialog()
{ {
BookmarksDialog::getInstance( p_intf )->toggleVisible(); BookmarksDialog::getInstance( p_intf )->toggleVisible();
} }
void DialogsProvider::podcastConfigureDialog() void DialogsProvider::podcastConfigureDialog()
......
...@@ -297,9 +297,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, ...@@ -297,9 +297,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
SLOT( mediaInfoDialog() ), "Ctrl+I" ); SLOT( mediaInfoDialog() ), "Ctrl+I" );
addDPStaticEntry( menu, qtr( I_MENU_CODECINFO ) , "", addDPStaticEntry( menu, qtr( I_MENU_CODECINFO ) , "",
":/pixmaps/menus_info_16px.png", SLOT( mediaCodecDialog() ), "Ctrl+J" ); ":/pixmaps/menus_info_16px.png", SLOT( mediaCodecDialog() ), "Ctrl+J" );
addDPStaticEntry( menu, qtr( I_MENU_BOOKMARK ), "","",
addDPStaticEntry( menu, qtr( I_MENU_BOOKMARK ), "","",
SLOT( bookmarksDialog() ), "Ctrl+B" ); SLOT( bookmarksDialog() ), "Ctrl+B" );
#ifdef ENABLE_VLM #ifdef ENABLE_VLM
addDPStaticEntry( menu, qtr( I_MENU_VLM ), "", "", SLOT( vlmDialog() ), addDPStaticEntry( menu, qtr( I_MENU_VLM ), "", "", SLOT( vlmDialog() ),
......
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