Commit 241469c7 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: fix bookmarks dialog

parent fda57ab5
...@@ -27,9 +27,10 @@ ...@@ -27,9 +27,10 @@
#include "dialogs/bookmarks.hpp" #include "dialogs/bookmarks.hpp"
#include "input_manager.hpp" #include "input_manager.hpp"
#include <QGridLayout> #include <QHBoxLayout>
#include <QSpacerItem> #include <QSpacerItem>
#include <QPushButton> #include <QPushButton>
#include <QDialogButtonBox>
BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
{ {
...@@ -38,19 +39,26 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -38,19 +39,26 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
setWindowTitle( qtr( "Edit Bookmarks" ) ); setWindowTitle( qtr( "Edit Bookmarks" ) );
setWindowRole( "vlc-bookmarks" ); setWindowRole( "vlc-bookmarks" );
QGridLayout *layout = new QGridLayout( this ); QHBoxLayout *layout = new QHBoxLayout( this );
QDialogButtonBox *buttonsBox = new QDialogButtonBox( Qt::Vertical );
QPushButton *addButton = new QPushButton( qtr( "Create" ) ); QPushButton *addButton = new QPushButton( qtr( "Create" ) );
addButton->setToolTip( qtr( "Create a new bookmark" ) ); addButton->setToolTip( qtr( "Create a new bookmark" ) );
buttonsBox->addButton( addButton, QDialogButtonBox::ActionRole );
QPushButton *delButton = new QPushButton( qtr( "Delete" ) ); QPushButton *delButton = new QPushButton( qtr( "Delete" ) );
delButton->setToolTip( qtr( "Delete the selected item" ) ); delButton->setToolTip( qtr( "Delete the selected item" ) );
buttonsBox->addButton( delButton, QDialogButtonBox::ActionRole );
QPushButton *clearButton = new QPushButton( qtr( "Clear" ) ); QPushButton *clearButton = new QPushButton( qtr( "Clear" ) );
clearButton->setToolTip( qtr( "Delete all the bookmarks" ) ); clearButton->setToolTip( qtr( "Delete all the bookmarks" ) );
buttonsBox->addButton( clearButton, QDialogButtonBox::ResetRole );
#if 0 #if 0
QPushButton *extractButton = new QPushButton( qtr( "Extract" ) ); QPushButton *extractButton = new QPushButton( qtr( "Extract" ) );
extractButton->setToolTip( qtr() ); extractButton->setToolTip( qtr() );
buttonsBox->addButton( extractButton, QDialogButtonBox::ActionRole );
#endif #endif
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); /* ?? Feels strange as Qt guidelines will put reject on top */
buttonsBox->addButton( new QPushButton( qtr( "&Close" ) ),
QDialogButtonBox::RejectRole);
bookmarksList = new QTreeWidget( this ); bookmarksList = new QTreeWidget( this );
bookmarksList->setRootIsDecorated( false ); bookmarksList->setRootIsDecorated( false );
...@@ -67,17 +75,8 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -67,17 +75,8 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
headerLabels << qtr( "Time" ); headerLabels << qtr( "Time" );
bookmarksList->setHeaderLabels( headerLabels ); bookmarksList->setHeaderLabels( headerLabels );
layout->addWidget( buttonsBox );
layout->addWidget( addButton, 0, 0 ); layout->addWidget( bookmarksList );
layout->addWidget( delButton, 1, 0 );
layout->addWidget( clearButton, 2, 0 );
layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ), 4, 0 );
#if 0
layout->addWidget( extractButton, 5, 0 );
#endif
layout->addWidget( bookmarksList, 0, 1, 6, 2);
layout->setColumnStretch( 1, 1 );
layout->addWidget( closeButton, 7, 2 );
CONNECT( THEMIM->getIM(), bookmarksChanged(), CONNECT( THEMIM->getIM(), bookmarksChanged(),
this, update() ); this, update() );
...@@ -93,7 +92,7 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf ) ...@@ -93,7 +92,7 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf ):QVLCFrame( _p_intf )
#if 0 #if 0
BUTTONACT( extractButton, extract() ); BUTTONACT( extractButton, extract() );
#endif #endif
BUTTONACT( closeButton, close() ); CONNECT( buttonsBox, rejected(), this, close() );
readSettings( "Bookmarks", QSize( 435, 280 ) ); readSettings( "Bookmarks", QSize( 435, 280 ) );
updateGeometry(); updateGeometry();
......
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