Commit 7cd31167 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, Message dialog: use a nicer update button

Close #4300
parent 6ea360ad
......@@ -26,8 +26,6 @@
#include "dialogs/messages.hpp"
#include <QSpinBox>
#include <QLabel>
#include <QTextEdit>
#include <QTextCursor>
#include <QFileDialog>
......@@ -36,10 +34,8 @@
#include <QTabWidget>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QHeaderView>
#include <QMutex>
#include <QLineEdit>
#include <QPushButton>
#include <QScrollBar>
#include <assert.h>
......@@ -83,7 +79,7 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
updateTree();
/* Modules tree */
ui.modulesTree->header()->hide();
ui.modulesTree->setHeaderHidden( true );
/* Buttons and general layout */
ui.saveLogButton->setToolTip( qtr( "Saves all the displayed logs to a file" ) );
......@@ -95,14 +91,21 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf)
"--verbose-objects=+printthatobject,-dontprintthatone\n"
"(keyword 'all' to applies to all objects)");
updateButton = new QPushButton( QIcon(":/update"), "" );
ui.mainTab->setCornerWidget( updateButton );
updateButton->setVisible( false );
updateButton->setFlat( true );
BUTTONACT( ui.clearButton, clear() );
BUTTONACT( ui.updateButton, updateTree() );
BUTTONACT( updateButton, updateTree() );
BUTTONACT( ui.saveLogButton, save() );
CONNECT( ui.vbobjectsEdit, editingFinished(), this, updateConfig());
CONNECT( ui.bottomButtonsBox, rejected(), this, hide() );
CONNECT( ui.verbosityBox, valueChanged( int ),
this, changeVerbosity( int ) );
CONNECT( ui.mainTab, currentChanged( int ), this, tabChanged( int ) );
/* General action */
readSettings( "Messages", QSize( 600, 450 ) );
......@@ -279,6 +282,11 @@ void MessagesDialog::updateTree()
buildTree( NULL, VLC_OBJECT( p_intf->p_libvlc ) );
}
void MessagesDialog::tabChanged( int i )
{
updateButton->setVisible( i == 1 );
}
static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned )
{
int canc = vlc_savecancel();
......
......@@ -58,10 +58,13 @@ private slots:
void changeVerbosity( int );
void clear();
void updateTree();
void tabChanged( int );
private:
void buildTree( QTreeWidgetItem *, vlc_object_t * );
friend class Singleton<MessagesDialog>;
QPushButton *updateButton;
};
#endif
......@@ -72,7 +72,14 @@
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="vbobjectsEdit"/>
<widget class="QLineEdit" name="vbobjectsEdit">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="saveLogButton">
......@@ -97,13 +104,6 @@
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="updateButton">
<property name="text">
<string>&amp;Update</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......
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