[vlc-commits] Qt, Message dialog: use a nicer update button
Jean-Baptiste Kempf
git at videolan.org
Fri Apr 22 18:58:37 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 22 18:58:01 2011 +0200| [7cd3116711b77cce7526f6d9a5d87513482b6636] | committer: Jean-Baptiste Kempf
Qt, Message dialog: use a nicer update button
Close #4300
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7cd3116711b77cce7526f6d9a5d87513482b6636
---
modules/gui/qt4/dialogs/messages.cpp | 20 ++++++++++++++------
modules/gui/qt4/dialogs/messages.hpp | 3 +++
modules/gui/qt4/ui/messages_panel.ui | 16 ++++++++--------
3 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index 61472d3..f78e87b 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -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();
diff --git a/modules/gui/qt4/dialogs/messages.hpp b/modules/gui/qt4/dialogs/messages.hpp
index 85bc889..24ba195 100644
--- a/modules/gui/qt4/dialogs/messages.hpp
+++ b/modules/gui/qt4/dialogs/messages.hpp
@@ -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
diff --git a/modules/gui/qt4/ui/messages_panel.ui b/modules/gui/qt4/ui/messages_panel.ui
index e0a4329..f347a08 100644
--- a/modules/gui/qt4/ui/messages_panel.ui
+++ b/modules/gui/qt4/ui/messages_panel.ui
@@ -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>&Update</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
</widget>
More information about the vlc-commits
mailing list