mirror of
https://github.com/videolan/vlc.git
synced 2025-01-25 17:15:46 +08:00
Replace the button to the right place.
This commit is contained in:
parent
351cfac214
commit
5daa9d2949
@ -54,18 +54,8 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
|
|||||||
|
|
||||||
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
|
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
|
||||||
closeButton->setDefault( true );
|
closeButton->setDefault( true );
|
||||||
BUTTONACT( closeButton, close() );
|
clearButton = new QPushButton( qtr( "&Clear" ) );
|
||||||
|
saveLogButton = new QPushButton( qtr( "&Save as..." ) );
|
||||||
mainLayout->addWidget( mainTab, 0, 0, 1, 0 );
|
|
||||||
mainLayout->addWidget( closeButton, 1, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
/* Messages */
|
|
||||||
QWidget *msgWidget = new QWidget;
|
|
||||||
QGridLayout *msgLayout = new QGridLayout( msgWidget );
|
|
||||||
|
|
||||||
QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) );
|
|
||||||
QPushButton *saveLogButton = new QPushButton( qtr( "&Save as..." ) );
|
|
||||||
|
|
||||||
verbosityBox = new QSpinBox();
|
verbosityBox = new QSpinBox();
|
||||||
verbosityBox->setRange( 0, 2 );
|
verbosityBox->setRange( 0, 2 );
|
||||||
@ -73,7 +63,25 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
|
|||||||
verbosityBox->setWrapping( true );
|
verbosityBox->setWrapping( true );
|
||||||
verbosityBox->setMaximumWidth( 50 );
|
verbosityBox->setMaximumWidth( 50 );
|
||||||
|
|
||||||
QLabel *verbosityLabel = new QLabel( qtr( "Verbosity Level" ) );
|
verbosityLabel = new QLabel( qtr( "Verbosity Level" ) );
|
||||||
|
|
||||||
|
|
||||||
|
mainLayout->addWidget( mainTab, 0, 0, 1, 0 );
|
||||||
|
mainLayout->addWidget( verbosityLabel, 1, 0, 1, 1 );
|
||||||
|
mainLayout->addWidget( verbosityBox, 1, 1 );
|
||||||
|
mainLayout->addWidget( saveLogButton, 1, 3 );
|
||||||
|
mainLayout->addWidget( clearButton, 1, 4 );
|
||||||
|
mainLayout->addWidget( closeButton, 1, 5 );
|
||||||
|
|
||||||
|
BUTTONACT( closeButton, close() );
|
||||||
|
BUTTONACT( clearButton, clear() );
|
||||||
|
BUTTONACT( saveLogButton, save() );
|
||||||
|
CONNECT( mainTab, currentChanged( int ), this, updateTab( int ) );
|
||||||
|
|
||||||
|
|
||||||
|
/* Messages */
|
||||||
|
QWidget *msgWidget = new QWidget;
|
||||||
|
QGridLayout *msgLayout = new QGridLayout( msgWidget );
|
||||||
|
|
||||||
messages = new QTextEdit();
|
messages = new QTextEdit();
|
||||||
messages->setReadOnly( true );
|
messages->setReadOnly( true );
|
||||||
@ -81,38 +89,44 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
|
|||||||
messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
messages->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
|
||||||
msgLayout->addWidget( messages, 0, 0, 1, 0 );
|
msgLayout->addWidget( messages, 0, 0, 1, 0 );
|
||||||
msgLayout->addWidget( verbosityLabel, 1, 0, 1, 1 );
|
mainTab->addTab( msgWidget, qtr( "Messages" ) );
|
||||||
msgLayout->addWidget( verbosityBox, 1, 1 );
|
|
||||||
msgLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ), 1, 2 );
|
|
||||||
msgLayout->addWidget( saveLogButton, 1, 3 );
|
|
||||||
msgLayout->addWidget( clearButton, 1, 4 );
|
|
||||||
|
|
||||||
BUTTONACT( clearButton, clear() );
|
|
||||||
BUTTONACT( saveLogButton, save() );
|
|
||||||
ON_TIMEOUT( updateLog() );
|
ON_TIMEOUT( updateLog() );
|
||||||
|
|
||||||
mainTab->addTab( msgWidget, qtr( "Messages" ) );
|
|
||||||
|
|
||||||
/* Module tree */
|
/* Modules tree */
|
||||||
QWidget *treeWidget = new QWidget;
|
QWidget *treeWidget = new QWidget;
|
||||||
QGridLayout *treeLayout = new QGridLayout( treeWidget );
|
QGridLayout *treeLayout = new QGridLayout( treeWidget );
|
||||||
|
|
||||||
modulesTree = new QTreeWidget();
|
modulesTree = new QTreeWidget();
|
||||||
modulesTree->header()->hide();
|
modulesTree->header()->hide();
|
||||||
|
|
||||||
QPushButton *updateButton = new QPushButton( qtr( "&Update" ) );
|
|
||||||
|
|
||||||
treeLayout->addWidget( modulesTree, 0, 0, 1, 0 );
|
treeLayout->addWidget( modulesTree, 0, 0, 1, 0 );
|
||||||
treeLayout->addWidget( updateButton, 1, 6 );
|
|
||||||
|
|
||||||
BUTTONACT( updateButton, updateTree() );
|
|
||||||
|
|
||||||
mainTab->addTab( treeWidget, qtr( "Modules tree" ) );
|
mainTab->addTab( treeWidget, qtr( "Modules tree" ) );
|
||||||
|
|
||||||
|
|
||||||
|
/* General action */
|
||||||
readSettings( "Messages" );
|
readSettings( "Messages" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessagesDialog::updateTab( int index )
|
||||||
|
{
|
||||||
|
if( index == 1 )
|
||||||
|
{
|
||||||
|
verbosityLabel->hide();
|
||||||
|
verbosityBox->hide();
|
||||||
|
clearButton->hide();
|
||||||
|
saveLogButton->hide();
|
||||||
|
updateTree();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
verbosityLabel->show();
|
||||||
|
verbosityBox->show();
|
||||||
|
clearButton->show();
|
||||||
|
saveLogButton->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MessagesDialog::updateLog()
|
void MessagesDialog::updateLog()
|
||||||
{
|
{
|
||||||
msg_subscription_t *p_sub = p_intf->p_sys->p_sub;
|
msg_subscription_t *p_sub = p_intf->p_sys->p_sub;
|
||||||
|
@ -56,15 +56,20 @@ private:
|
|||||||
MessagesDialog( intf_thread_t * );
|
MessagesDialog( intf_thread_t * );
|
||||||
static MessagesDialog *instance;
|
static MessagesDialog *instance;
|
||||||
QSpinBox *verbosityBox;
|
QSpinBox *verbosityBox;
|
||||||
|
QLabel *verbosityLabel;
|
||||||
QTextEdit *messages;
|
QTextEdit *messages;
|
||||||
QTreeWidget *modulesTree;
|
QTreeWidget *modulesTree;
|
||||||
|
QPushButton *clearButton;
|
||||||
|
QPushButton *saveLogButton;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void updateTab( int );
|
||||||
void updateLog();
|
void updateLog();
|
||||||
void updateTree();
|
|
||||||
void close();
|
void close();
|
||||||
void clear();
|
void clear();
|
||||||
bool save();
|
bool save();
|
||||||
private:
|
private:
|
||||||
|
void updateTree();
|
||||||
void buildTree( QTreeWidgetItem *, vlc_object_t * );
|
void buildTree( QTreeWidgetItem *, vlc_object_t * );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user