summaryrefslogtreecommitdiffstats
path: root/qt4/encodewidget.cpp
diff options
context:
space:
mode:
authorclee <[email protected]>2007-03-29 09:31:13 +0000
committerclee <[email protected]>2007-03-29 09:31:13 +0000
commitceb981ea2c7406fac18dee17382976428a12b374 (patch)
treed8f421576aff6d75e0e4e82e2a3833437af2233b /qt4/encodewidget.cpp
parent42b83d67aac7b196b636f8d3b77be5017676fa3b (diff)
Importing the first (very much not-yet-ready-for-primetime) version of the Qt4 GUI for HandBrake into trunk.
Note: This is NOT fit for release yet. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@462 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'qt4/encodewidget.cpp')
-rw-r--r--qt4/encodewidget.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/qt4/encodewidget.cpp b/qt4/encodewidget.cpp
new file mode 100644
index 000000000..af22b80e5
--- /dev/null
+++ b/qt4/encodewidget.cpp
@@ -0,0 +1,39 @@
+#include <QtGui>
+
+#include "encodewidget.h"
+
+EncodeWidget::EncodeWidget(QWidget *parent)
+ : QWidget(parent)
+{
+ setupUi(this);
+
+ convertButton->setDisabled( true );
+
+ connect(convertButton, SIGNAL(clicked()), this, SIGNAL(convert()));
+}
+
+void EncodeWidget::setModel( QStandardItemModel *m )
+{
+ titleTree->setModel( m );
+ titleTree->setSelectionMode( QAbstractItemView::NoSelection );
+ titleTree->setRootIsDecorated( false );
+ titleTree->setFocusPolicy( Qt::NoFocus );
+
+ connect(titleTree->model(), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(changed()));
+}
+
+void EncodeWidget::changed()
+{
+ bool enable = false;
+
+ for( int row = 0; row < titleTree->model()->rowCount(); ++row )
+ {
+ QStandardItem *si = qobject_cast<QStandardItemModel *>(titleTree->model())->item( row, 0 );
+ if( si->checkState() == Qt::Checked )
+ {
+ enable = true;
+ }
+ }
+
+ convertButton->setEnabled( enable );
+}