began implementation of footage properties

This commit is contained in:
itsmattkc
2019-09-28 04:12:09 +10:00
parent d2dc0d2823
commit 9a78f5ce86
20 changed files with 551 additions and 299 deletions
@@ -113,7 +113,7 @@ PlaybackControls::PlaybackControls(QWidget *parent) :
lower_right_layout->setMargin(0);
lower_right_layout->addStretch();
end_tc_lbl_ = new QLabel("00:00:00;00");
end_tc_lbl_ = new QLabel();
lower_right_layout->addWidget(end_tc_lbl_);
UpdateIcons();
@@ -132,7 +132,9 @@ void PlaybackControls::SetTimebase(const rational &r)
void PlaybackControls::SetTime(const int64_t &r)
{
Q_ASSERT(time_base_.denominator() != 0);
if (time_base_.isNull()) {
return;
}
cur_tc_lbl_->setText(olive::timestamp_to_timecode(r,
time_base_,
@@ -21,8 +21,10 @@
#include "projectexplorer.h"
#include <QDebug>
#include <QMenu>
#include <QVBoxLayout>
#include "dialog/footageproperties/footageproperties.h"
#include "projectexplorerdefines.h"
ProjectExplorer::ProjectExplorer(QWidget *parent) :
@@ -47,14 +49,17 @@ ProjectExplorer::ProjectExplorer(QWidget *parent) :
// Add tree view to stacked widget
tree_view_ = new ProjectExplorerTreeView(stacked_widget_);
tree_view_->setContextMenuPolicy(Qt::CustomContextMenu);
AddView(tree_view_);
// Add list view to stacked widget
list_view_ = new ProjectExplorerListView(stacked_widget_);
list_view_->setContextMenuPolicy(Qt::CustomContextMenu);
AddView(list_view_);
// Add icon view to stacked widget
icon_view_ = new ProjectExplorerIconView(stacked_widget_);
icon_view_->setContextMenuPolicy(Qt::CustomContextMenu);
AddView(icon_view_);
// Set default view to tree view
@@ -66,6 +71,10 @@ ProjectExplorer::ProjectExplorer(QWidget *parent) :
// Set rename timer timeout
rename_timer_.setInterval(500);
connect(&rename_timer_, SIGNAL(timeout()), this, SLOT(RenameTimerSlot()));
connect(tree_view_, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu()));
connect(list_view_, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu()));
connect(icon_view_, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowContextMenu()));
}
const olive::ProjectViewType &ProjectExplorer::view_type()
@@ -210,6 +219,29 @@ void ProjectExplorer::RenameTimerSlot()
rename_timer_.stop();
}
void ProjectExplorer::ShowContextMenu()
{
QMenu menu;
// FIXME: Support for multiple items and items other than Footage
QList<Item*> selected_items = SelectedItems();
QAction* properties_action = menu.addAction(tr("P&roperties"));
if (selected_items.first()->type() == Item::kFootage) {
connect(properties_action, SIGNAL(triggered(bool)), this, SLOT(ShowFootagePropertiesDialog()));
}
menu.exec(QCursor::pos());
}
void ProjectExplorer::ShowFootagePropertiesDialog()
{
// FIXME: Support for multiple items and items other than Footage
FootagePropertiesDialog fpd(this, static_cast<Footage*>(SelectedItems().first()));
fpd.exec();
}
Project *ProjectExplorer::project()
{
return model_.project();
@@ -142,6 +142,10 @@ private slots:
void DirUpSlot();
void RenameTimerSlot();
void ShowContextMenu();
void ShowFootagePropertiesDialog();
};
#endif // PROJECTEXPLORER_H