#include <vector>
#include <QPushButton>
+#include <QScrollArea>
+#include <QTableView>
#include <QVBoxLayout>
#include <QWidget>
#include "alg/mussa.hpp"
-#include "qui/motif_editor/MotifDetail.hpp"
+#include "qui/motif_editor/MotifModel.hpp"
class MotifEditor : public QWidget
{
Q_OBJECT
public:
- MotifEditor(Mussa* m, QWidget *parent=0);
- MotifEditor(const MotifEditor&);
+ MotifEditor(MussaRef m, QWidget *parent=0);
+ //! update our window title
+ void updateTitle();
+ //! resize cells
+ void updateView();
+
+ //! return the analysis, intended for testing
+ MussaRef get_analysis() { return analysis; }
+ //! return the internal model used by the editor
+ //! this is mostly intended for testing
+ MotifModel *get_model() { return model; }
+
public slots:
- // called to apply motif changes
- void updateMotifs();
+ //! create model and attach it to the table view
+ void updateModel();
+ //! called to apply motif changes to the analysis
+ void updateAnalysisMotifs();
signals:
- // emitted when the use has applied the motif changes
+ //! emitted when the use has applied the motif changes
void changedMotifs();
private:
- Mussa* analysis;
-
- QPushButton applyButton;
- QVBoxLayout layout;
-
- std::vector<MotifDetail *> motif_details;
+ //! initialize all our gui widgets
+ void setupWidgets();
+ MussaRef analysis;
+
+ QPushButton *applyButton;
+ QVBoxLayout *editor_layout;
+ QHBoxLayout *button_layout;
+ QTableView *table;
+ MotifEditorDelegate *delegate;
+
+ MotifModel *model;
};
#endif