summaryrefslogtreecommitdiffstats
path: root/qt4/encodewidget.cpp
diff options
context:
space:
mode:
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 );
+}