Changeset 5daa9d294991621f86cf3b501f4fb04c70bb182b
- Timestamp:
- 09/02/08 23:55:42
(10 months ago)
- Author:
- Rémi Duraffort <ivoire@videolan.org>
- git-committer:
- Rémi Duraffort <ivoire@videolan.org> 1202597742 +0000
- git-parent:
[351cfac214128c936ab7e6dd684a7d589547495c]
- git-author:
- Rémi Duraffort <ivoire@videolan.org> 1202597742 +0000
- Message:
Replace the button to the right place.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r832be47 |
r5daa9d2 |
|
| 55 | 55 | QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); |
|---|
| 56 | 56 | closeButton->setDefault( true ); |
|---|
| 57 | | BUTTONACT( closeButton, close() ); |
|---|
| 58 | | |
|---|
| 59 | | mainLayout->addWidget( mainTab, 0, 0, 1, 0 ); |
|---|
| 60 | | mainLayout->addWidget( closeButton, 1, 5 ); |
|---|
| 61 | | |
|---|
| 62 | | |
|---|
| 63 | | /* Messages */ |
|---|
| 64 | | QWidget *msgWidget = new QWidget; |
|---|
| 65 | | QGridLayout *msgLayout = new QGridLayout( msgWidget ); |
|---|
| 66 | | |
|---|
| 67 | | QPushButton *clearButton = new QPushButton( qtr( "&Clear" ) ); |
|---|
| 68 | | QPushButton *saveLogButton = new QPushButton( qtr( "&Save as..." ) ); |
|---|
| | 57 | clearButton = new QPushButton( qtr( "&Clear" ) ); |
|---|
| | 58 | saveLogButton = new QPushButton( qtr( "&Save as..." ) ); |
|---|
| 69 | 59 | |
|---|
| 70 | 60 | verbosityBox = new QSpinBox(); |
|---|
| … | … | |
| 74 | 64 | verbosityBox->setMaximumWidth( 50 ); |
|---|
| 75 | 65 | |
|---|
| 76 | | QLabel *verbosityLabel = new QLabel( qtr( "Verbosity Level" ) ); |
|---|
| | 66 | verbosityLabel = new QLabel( qtr( "Verbosity Level" ) ); |
|---|
| | 67 | |
|---|
| | 68 | |
|---|
| | 69 | mainLayout->addWidget( mainTab, 0, 0, 1, 0 ); |
|---|
| | 70 | mainLayout->addWidget( verbosityLabel, 1, 0, 1, 1 ); |
|---|
| | 71 | mainLayout->addWidget( verbosityBox, 1, 1 ); |
|---|
| | 72 | mainLayout->addWidget( saveLogButton, 1, 3 ); |
|---|
| | 73 | mainLayout->addWidget( clearButton, 1, 4 ); |
|---|
| | 74 | mainLayout->addWidget( closeButton, 1, 5 ); |
|---|
| | 75 | |
|---|
| | 76 | BUTTONACT( closeButton, close() ); |
|---|
| | 77 | BUTTONACT( clearButton, clear() ); |
|---|
| | 78 | BUTTONACT( saveLogButton, save() ); |
|---|
| | 79 | CONNECT( mainTab, currentChanged( int ), this, updateTab( int ) ); |
|---|
| | 80 | |
|---|
| | 81 | |
|---|
| | 82 | /* Messages */ |
|---|
| | 83 | QWidget *msgWidget = new QWidget; |
|---|
| | 84 | QGridLayout *msgLayout = new QGridLayout( msgWidget ); |
|---|
| 77 | 85 | |
|---|
| 78 | 86 | messages = new QTextEdit(); |
|---|
| … | … | |
| 82 | 90 | |
|---|
| 83 | 91 | msgLayout->addWidget( messages, 0, 0, 1, 0 ); |
|---|
| 84 | | msgLayout->addWidget( verbosityLabel, 1, 0, 1, 1 ); |
|---|
| 85 | | msgLayout->addWidget( verbosityBox, 1, 1 ); |
|---|
| 86 | | msgLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding ), 1, 2 ); |
|---|
| 87 | | msgLayout->addWidget( saveLogButton, 1, 3 ); |
|---|
| 88 | | msgLayout->addWidget( clearButton, 1, 4 ); |
|---|
| 89 | | |
|---|
| 90 | | BUTTONACT( clearButton, clear() ); |
|---|
| 91 | | BUTTONACT( saveLogButton, save() ); |
|---|
| | 92 | mainTab->addTab( msgWidget, qtr( "Messages" ) ); |
|---|
| 92 | 93 | ON_TIMEOUT( updateLog() ); |
|---|
| 93 | 94 | |
|---|
| 94 | | mainTab->addTab( msgWidget, qtr( "Messages" ) ); |
|---|
| 95 | | |
|---|
| 96 | | /* Module tree */ |
|---|
| | 95 | |
|---|
| | 96 | /* Modules tree */ |
|---|
| 97 | 97 | QWidget *treeWidget = new QWidget; |
|---|
| 98 | 98 | QGridLayout *treeLayout = new QGridLayout( treeWidget ); |
|---|
| … | … | |
| 101 | 101 | modulesTree->header()->hide(); |
|---|
| 102 | 102 | |
|---|
| 103 | | QPushButton *updateButton = new QPushButton( qtr( "&Update" ) ); |
|---|
| 104 | | |
|---|
| 105 | 103 | treeLayout->addWidget( modulesTree, 0, 0, 1, 0 ); |
|---|
| 106 | | treeLayout->addWidget( updateButton, 1, 6 ); |
|---|
| 107 | | |
|---|
| 108 | | BUTTONACT( updateButton, updateTree() ); |
|---|
| 109 | | |
|---|
| 110 | 104 | mainTab->addTab( treeWidget, qtr( "Modules tree" ) ); |
|---|
| 111 | 105 | |
|---|
| 112 | 106 | |
|---|
| | 107 | /* General action */ |
|---|
| 113 | 108 | readSettings( "Messages" ); |
|---|
| | 109 | } |
|---|
| | 110 | |
|---|
| | 111 | void MessagesDialog::updateTab( int index ) |
|---|
| | 112 | { |
|---|
| | 113 | if( index == 1 ) |
|---|
| | 114 | { |
|---|
| | 115 | verbosityLabel->hide(); |
|---|
| | 116 | verbosityBox->hide(); |
|---|
| | 117 | clearButton->hide(); |
|---|
| | 118 | saveLogButton->hide(); |
|---|
| | 119 | updateTree(); |
|---|
| | 120 | } |
|---|
| | 121 | else |
|---|
| | 122 | { |
|---|
| | 123 | verbosityLabel->show(); |
|---|
| | 124 | verbosityBox->show(); |
|---|
| | 125 | clearButton->show(); |
|---|
| | 126 | saveLogButton->show(); |
|---|
| | 127 | } |
|---|
| 114 | 128 | } |
|---|
| 115 | 129 | |
|---|
| rce10771 |
r5daa9d2 |
|
| 57 | 57 | static MessagesDialog *instance; |
|---|
| 58 | 58 | QSpinBox *verbosityBox; |
|---|
| | 59 | QLabel *verbosityLabel; |
|---|
| 59 | 60 | QTextEdit *messages; |
|---|
| 60 | 61 | QTreeWidget *modulesTree; |
|---|
| | 62 | QPushButton *clearButton; |
|---|
| | 63 | QPushButton *saveLogButton; |
|---|
| | 64 | |
|---|
| 61 | 65 | private slots: |
|---|
| | 66 | void updateTab( int ); |
|---|
| 62 | 67 | void updateLog(); |
|---|
| 63 | | void updateTree(); |
|---|
| 64 | 68 | void close(); |
|---|
| 65 | 69 | void clear(); |
|---|
| 66 | 70 | bool save(); |
|---|
| 67 | 71 | private: |
|---|
| | 72 | void updateTree(); |
|---|
| 68 | 73 | void buildTree( QTreeWidgetItem *, vlc_object_t * ); |
|---|
| 69 | 74 | }; |
|---|