ensured parenting of qwidgets

This commit is contained in:
itsmattkc
2019-01-30 17:36:54 +11:00
parent 54180e5e0d
commit 6f3a826da7
32 changed files with 350 additions and 357 deletions
-1
View File
@@ -12,7 +12,6 @@ AboutDialog::AboutDialog(QWidget *parent) :
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(20);
setLayout(layout);
QLabel* label =
new QLabel("<html><head/><body>"
-2
View File
@@ -37,8 +37,6 @@ ActionSearch::ActionSearch(QWidget *parent) :
layout->addWidget(list_widget);
connect(list_widget, SIGNAL(dbl_click()), this, SLOT(perform_action()));
setLayout(layout);
entry_field->setFocus();
}
-1
View File
@@ -12,7 +12,6 @@ DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("Debug Log"));
QVBoxLayout* layout = new QVBoxLayout(this);
setLayout(layout);
textEdit = new QTextEdit(this);
textEdit->setWordWrapMode(QTextOption::NoWrap);
-1
View File
@@ -11,7 +11,6 @@ DemoNotice::DemoNotice(QWidget *parent) :
setMaximumWidth(600);
QVBoxLayout* vlayout = new QVBoxLayout(this);
setLayout(vlayout);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(10);
+10 -10
View File
@@ -628,27 +628,27 @@ void ExportDialog::setup_ui() {
QGridLayout* videoGridLayout = new QGridLayout(videoGroupbox);
videoGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Codec:"), this), 0, 0, 1, 1);
vcodecCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(vcodecCombobox, 0, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Width:")), 1, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Width:"), this), 1, 0, 1, 1);
widthSpinbox = new QSpinBox(videoGroupbox);
widthSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(widthSpinbox, 1, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Height:")), 2, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Height:"), this), 2, 0, 1, 1);
heightSpinbox = new QSpinBox(videoGroupbox);
heightSpinbox->setMaximum(16777216);
videoGridLayout->addWidget(heightSpinbox, 2, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Frame Rate:")), 3, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Frame Rate:"), this), 3, 0, 1, 1);
framerateSpinbox = new QDoubleSpinBox(videoGroupbox);
framerateSpinbox->setMaximum(60);
framerateSpinbox->setValue(0);
videoGridLayout->addWidget(framerateSpinbox, 3, 1, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Compression Type:")), 4, 0, 1, 1);
videoGridLayout->addWidget(new QLabel(tr("Compression Type:"), this), 4, 0, 1, 1);
compressionTypeCombobox = new QComboBox(videoGroupbox);
videoGridLayout->addWidget(compressionTypeCombobox, 4, 1, 1, 1);
@@ -667,17 +667,17 @@ void ExportDialog::setup_ui() {
QGridLayout* audioGridLayout = new QGridLayout(audioGroupbox);
audioGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Codec:"), this), 0, 0, 1, 1);
acodecCombobox = new QComboBox(audioGroupbox);
audioGridLayout->addWidget(acodecCombobox, 0, 1, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:")), 1, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:"), this), 1, 0, 1, 1);
samplingRateSpinbox = new QSpinBox(audioGroupbox);
samplingRateSpinbox->setMaximum(96000);
samplingRateSpinbox->setValue(0);
audioGridLayout->addWidget(samplingRateSpinbox, 1, 1, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):")), 3, 0, 1, 1);
audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):"), this), 3, 0, 1, 1);
audiobitrateSpinbox = new QSpinBox(audioGroupbox);
audiobitrateSpinbox->setMaximum(320);
audiobitrateSpinbox->setValue(256);
@@ -685,7 +685,7 @@ void ExportDialog::setup_ui() {
verticalLayout->addWidget(audioGroupbox);
QHBoxLayout* progressLayout = new QHBoxLayout();
QHBoxLayout* progressLayout = new QHBoxLayout(this);
progressBar = new QProgressBar(this);
progressBar->setFormat("%p% (ETA: 0:00:00)");
progressBar->setEnabled(false);
@@ -701,7 +701,7 @@ void ExportDialog::setup_ui() {
verticalLayout->addLayout(progressLayout);
QHBoxLayout* buttonLayout = new QHBoxLayout();
QHBoxLayout* buttonLayout = new QHBoxLayout(this);
buttonLayout->addStretch();
export_button = new QPushButton(this);
+6 -7
View File
@@ -14,22 +14,21 @@
#include "mainwindow.h"
LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) {
setWindowTitle(tr("Loading..."));
setWindowTitle(tr("Loading..."));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1))));
layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1)), this));
bar = new QProgressBar();
bar = new QProgressBar(this);
bar->setValue(0);
layout->addWidget(bar);
cancel_button = new QPushButton(tr("Cancel"));
cancel_button = new QPushButton(tr("Cancel"), this);
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel()));
hboxLayout = new QHBoxLayout();
hboxLayout = new QHBoxLayout(this);
hboxLayout->addStretch();
hboxLayout->addWidget(cancel_button);
hboxLayout->addStretch();
+15 -14
View File
@@ -23,17 +23,16 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
setWindowTitle(tr("\"%1\" Properties").arg(i->get_name()));
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QGridLayout* grid = new QGridLayout();
setLayout(grid);
QGridLayout* grid = new QGridLayout(this);
int row = 0;
Footage* f = item->to_footage();
grid->addWidget(new QLabel(tr("Tracks:")), row, 0, 1, 2);
grid->addWidget(new QLabel(tr("Tracks:"), this), row, 0, 1, 2);
row++;
track_list = new QListWidget();
track_list = new QListWidget(this);
for (int i=0;i<f->video_tracks.size();i++) {
const FootageStream& fs = f->video_tracks.at(i);
@@ -43,7 +42,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QString::number(fs.video_width),
QString::number(fs.video_height),
QString::number(fs.video_frame_rate)
)
),
track_list
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
@@ -57,7 +57,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
QString::number(fs.file_index),
QString::number(fs.audio_frequency),
QString::number(fs.audio_channels)
)
),
track_list
);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked);
@@ -70,8 +71,8 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
if (f->video_tracks.size() > 0) {
// frame conforming
if (!f->video_tracks.at(0).infinite_length) {
grid->addWidget(new QLabel(tr("Conform to Frame Rate:")), row, 0);
conform_fr = new QDoubleSpinBox();
grid->addWidget(new QLabel(tr("Conform to Frame Rate:"), this), row, 0);
conform_fr = new QDoubleSpinBox(this);
conform_fr->setMinimum(0.01);
conform_fr->setValue(f->video_tracks.at(0).video_frame_rate * f->speed);
grid->addWidget(conform_fr, row, 1);
@@ -80,14 +81,14 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
row++;
// premultiplied alpha mode
premultiply_alpha_setting = new QCheckBox(tr("Alpha is Premultiplied"));
premultiply_alpha_setting = new QCheckBox(tr("Alpha is Premultiplied"), this);
premultiply_alpha_setting->setChecked(f->alpha_is_premultiplied);
grid->addWidget(premultiply_alpha_setting, row, 0);
row++;
// deinterlacing mode
interlacing_box = new QComboBox();
interlacing_box = new QComboBox(this);
interlacing_box->addItem(
tr("Auto (%1)").arg(
get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing)
@@ -102,18 +103,18 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) :
? 0
: f->video_tracks.at(0).video_interlacing + 1);
grid->addWidget(new QLabel(tr("Interlacing:")), row, 0);
grid->addWidget(new QLabel(tr("Interlacing:"), this), row, 0);
grid->addWidget(interlacing_box, row, 1);
row++;
}
name_box = new QLineEdit(item->get_name());
grid->addWidget(new QLabel(tr("Name:")), row, 0);
name_box = new QLineEdit(item->get_name(), this);
grid->addWidget(new QLabel(tr("Name:"), this), row, 0);
grid->addWidget(name_box, row, 1);
row++;
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttons->setCenterButtons(true);
grid->addWidget(buttons, row, 0, 1, 2);
+9 -10
View File
@@ -103,8 +103,7 @@ void NewSequenceDialog::create() {
accept();
}
void NewSequenceDialog::preset_changed(int index)
{
void NewSequenceDialog::preset_changed(int index) {
switch (index) {
case 0: // FILM 4K
width_numeric->setValue(4096);
@@ -157,7 +156,7 @@ void NewSequenceDialog::setup_ui() {
QHBoxLayout* preset_layout = new QHBoxLayout(widget);
preset_layout->setContentsMargins(0, 0, 0, 0);
preset_layout->addWidget(new QLabel(tr("Preset:")));
preset_layout->addWidget(new QLabel(tr("Preset:"), this));
preset_combobox = new QComboBox(widget);
@@ -183,19 +182,19 @@ void NewSequenceDialog::setup_ui() {
QGridLayout* videoLayout = new QGridLayout(videoGroupBox);
videoLayout->addWidget(new QLabel(tr("Width:")), 0, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Width:"), this), 0, 0, 1, 1);
width_numeric = new QSpinBox(videoGroupBox);
width_numeric->setMaximum(9999);
width_numeric->setValue(1920);
videoLayout->addWidget(width_numeric, 0, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Height:")), 1, 0, 1, 2);
videoLayout->addWidget(new QLabel(tr("Height:"), this), 1, 0, 1, 2);
height_numeric = new QSpinBox(videoGroupBox);
height_numeric->setMaximum(9999);
height_numeric->setValue(1080);
videoLayout->addWidget(height_numeric, 1, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Frame Rate:")), 2, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Frame Rate:"), this), 2, 0, 1, 1);
frame_rate_combobox = new QComboBox(videoGroupBox);
frame_rate_combobox->addItem("10 FPS", 10.0);
frame_rate_combobox->addItem("12.5 FPS", 12.5);
@@ -211,12 +210,12 @@ void NewSequenceDialog::setup_ui() {
frame_rate_combobox->setCurrentIndex(6);
videoLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:")), 4, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:"), this), 4, 0, 1, 1);
par_combobox = new QComboBox(videoGroupBox);
par_combobox->addItem(tr("Square Pixels (1.0)"));
videoLayout->addWidget(par_combobox, 4, 2, 1, 2);
videoLayout->addWidget(new QLabel(tr("Interlacing:")), 6, 0, 1, 1);
videoLayout->addWidget(new QLabel(tr("Interlacing:"), this), 6, 0, 1, 1);
interlacing_combobox = new QComboBox(videoGroupBox);
interlacing_combobox->addItem(tr("None (Progressive)"));
// interlacing_combobox->addItem("Upper Field First");
@@ -230,7 +229,7 @@ void NewSequenceDialog::setup_ui() {
QGridLayout* audioLayout = new QGridLayout(audioGroupBox);
audioLayout->addWidget(new QLabel(tr("Sample Rate: ")), 0, 0, 1, 1);
audioLayout->addWidget(new QLabel(tr("Sample Rate: "), this), 0, 0, 1, 1);
audio_frequency_combobox = new QComboBox(audioGroupBox);
audio_frequency_combobox->addItem("22050 Hz", 22050);
@@ -250,7 +249,7 @@ void NewSequenceDialog::setup_ui() {
QHBoxLayout* nameLayout = new QHBoxLayout(nameWidget);
nameLayout->setContentsMargins(0, 0, 0, 0);
nameLayout->addWidget(new QLabel("Name:"));
nameLayout->addWidget(new QLabel(tr("Name:"), this));
sequence_name_edit = new QLineEdit(nameWidget);
+24 -24
View File
@@ -71,7 +71,7 @@ void PreferencesDialog::setup_kbd_shortcut_worker(QMenu* menu, QTreeWidgetItem*
QAction* a = actions.at(i);
if (!a->isSeparator() && a->property("keyignore").isNull()) {
QTreeWidgetItem* item = new QTreeWidgetItem();
QTreeWidgetItem* item = new QTreeWidgetItem(parent);
item->setText(0, a->text().replace("&", ""));
parent->addChild(item);
@@ -93,7 +93,7 @@ void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) {
for (int i=0;i<menus.size();i++) {
QMenu* menu = menus.at(i)->menu();
QTreeWidgetItem* item = new QTreeWidgetItem();
QTreeWidgetItem* item = new QTreeWidgetItem(keyboard_tree);
item->setText(0, menu->title().replace("&", ""));
keyboard_tree->addTopLevelItem(item);
@@ -286,11 +286,11 @@ void PreferencesDialog::setup_ui() {
QTabWidget* tabWidget = new QTabWidget(this);
// General
QTabWidget* general_tab = new QTabWidget();
QTabWidget* general_tab = new QTabWidget(this);
QGridLayout* general_layout = new QGridLayout(general_tab);
// General -> Custom CSS
general_layout->addWidget(new QLabel(tr("Custom CSS:")), 0, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Custom CSS:"), this), 0, 0, 1, 1);
custom_css_fn = new QLineEdit(general_tab);
custom_css_fn->setText(config.css_path);
@@ -301,14 +301,14 @@ void PreferencesDialog::setup_ui() {
general_layout->addWidget(custom_css_browse, 0, 2, 1, 1);
// General -> Image Sequence Formats
general_layout->addWidget(new QLabel(tr("Image sequence formats:")), 1, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Image sequence formats:"), this), 1, 0, 1, 1);
imgSeqFormatEdit = new QLineEdit(general_tab);
general_layout->addWidget(imgSeqFormatEdit, 1, 1, 1, 2);
// General -> Audio Recording
general_layout->addWidget(new QLabel(tr("Audio Recording:")), 2, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Audio Recording:"), this), 2, 0, 1, 1);
recordingComboBox = new QComboBox(general_tab);
recordingComboBox->addItem(tr("Mono"));
@@ -316,7 +316,7 @@ void PreferencesDialog::setup_ui() {
general_layout->addWidget(recordingComboBox, 2, 1, 1, 2);
// General -> Effect Textbox Lines
general_layout->addWidget(new QLabel(tr("Effect Textbox Lines:")), 3, 0, 1, 1);
general_layout->addWidget(new QLabel(tr("Effect Textbox Lines:"), this), 3, 0, 1, 1);
effect_textbox_lines_field = new QSpinBox(general_tab);
effect_textbox_lines_field->setMinimum(1);
@@ -332,15 +332,15 @@ void PreferencesDialog::setup_ui() {
tabWidget->addTab(general_tab, tr("General"));
// Behavior
QWidget* behavior_tab = new QWidget();
QWidget* behavior_tab = new QWidget(this);
tabWidget->addTab(behavior_tab, tr("Behavior"));
// Playback
QWidget* playback_tab = new QWidget();
QWidget* playback_tab = new QWidget(this);
QVBoxLayout* playback_tab_layout = new QVBoxLayout(playback_tab);
// Playback -> Disable Multithreading on Images
disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images"));
disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images"), playback_tab);
disable_img_multithread->setChecked(config.disable_multithreading_for_images);
playback_tab_layout->addWidget(disable_img_multithread);
@@ -360,20 +360,20 @@ void PreferencesDialog::setup_ui() {
QGroupBox* memory_usage_group = new QGroupBox(playback_tab);
memory_usage_group->setTitle(tr("Memory Usage"));
QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group);
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:")), 0, 0);
upcoming_queue_spinbox = new QDoubleSpinBox();
memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:"), playback_tab), 0, 0);
upcoming_queue_spinbox = new QDoubleSpinBox(playback_tab);
upcoming_queue_spinbox->setValue(config.upcoming_queue_size);
memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1);
upcoming_queue_type = new QComboBox();
upcoming_queue_type = new QComboBox(playback_tab);
upcoming_queue_type->addItem(tr("frames"));
upcoming_queue_type->addItem(tr("seconds"));
upcoming_queue_type->setCurrentIndex(config.upcoming_queue_type);
memory_usage_layout->addWidget(upcoming_queue_type, 0, 2);
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:")), 1, 0);
previous_queue_spinbox = new QDoubleSpinBox();
memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:"), playback_tab), 1, 0);
previous_queue_spinbox = new QDoubleSpinBox(playback_tab);
previous_queue_spinbox->setValue(config.previous_queue_size);
memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1);
previous_queue_type = new QComboBox();
previous_queue_type = new QComboBox(playback_tab);
previous_queue_type->addItem(tr("frames"));
previous_queue_type->addItem(tr("seconds"));
previous_queue_type->setCurrentIndex(config.previous_queue_type);
@@ -382,39 +382,39 @@ void PreferencesDialog::setup_ui() {
tabWidget->addTab(playback_tab, tr("Playback"));
QWidget* shortcut_tab = new QWidget();
QWidget* shortcut_tab = new QWidget(this);
QVBoxLayout* shortcut_layout = new QVBoxLayout(shortcut_tab);
QLineEdit* key_search_line = new QLineEdit();
QLineEdit* key_search_line = new QLineEdit(shortcut_tab);
key_search_line->setPlaceholderText(tr("Search for action or shortcut"));
connect(key_search_line, SIGNAL(textChanged(const QString &)), this, SLOT(refine_shortcut_list(const QString &)));
shortcut_layout->addWidget(key_search_line);
keyboard_tree = new QTreeWidget();
keyboard_tree = new QTreeWidget(shortcut_tab);
QTreeWidgetItem* tree_header = keyboard_tree->headerItem();
tree_header->setText(0, tr("Action"));
tree_header->setText(1, tr("Shortcut"));
shortcut_layout->addWidget(keyboard_tree);
QHBoxLayout* reset_shortcut_layout = new QHBoxLayout();
QHBoxLayout* reset_shortcut_layout = new QHBoxLayout(shortcut_tab);
QPushButton* import_shortcut_button = new QPushButton(tr("Import"));
QPushButton* import_shortcut_button = new QPushButton(tr("Import"), shortcut_tab);
reset_shortcut_layout->addWidget(import_shortcut_button);
connect(import_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(load_shortcut_file()));
QPushButton* export_shortcut_button = new QPushButton(tr("Export"));
QPushButton* export_shortcut_button = new QPushButton(tr("Export"), shortcut_tab);
reset_shortcut_layout->addWidget(export_shortcut_button);
connect(export_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(save_shortcut_file()));
reset_shortcut_layout->addStretch();
QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected"));
QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected"), shortcut_tab);
reset_shortcut_layout->addWidget(reset_selected_shortcut_button);
connect(reset_selected_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_default_shortcut()));
QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All"));
QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All"), shortcut_tab);
reset_shortcut_layout->addWidget(reset_all_shortcut_button);
connect(reset_all_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_all_shortcuts()));
+32 -34
View File
@@ -23,31 +23,31 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
QDialog(parent),
media(old_media)
{
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name()));
resize(300, 400);
QVBoxLayout* layout = new QVBoxLayout();
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:")));
layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:"), this));
tree = new QTreeView();
tree = new QTreeView(this);
layout->addWidget(tree);
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"));
use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points"), this);
use_same_media_in_points->setChecked(true);
layout->addWidget(use_same_media_in_points);
QHBoxLayout* buttons = new QHBoxLayout();
QHBoxLayout* buttons = new QHBoxLayout(this);
buttons->addStretch();
QPushButton* replace_button = new QPushButton(tr("Replace"));
QPushButton* replace_button = new QPushButton(tr("Replace"), this);
connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace()));
buttons->addWidget(replace_button);
QPushButton* cancel_button = new QPushButton(tr("Cancel"));
QPushButton* cancel_button = new QPushButton(tr("Cancel"), this);
connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close()));
buttons->addWidget(cancel_button);
@@ -55,44 +55,42 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media
layout->addLayout(buttons);
setLayout(layout);
tree->setModel(&project_model);
}
void ReplaceClipMediaDialog::replace() {
QModelIndexList selected_items = tree->selectionModel()->selectedRows();
if (selected_items.size() != 1) {
QMessageBox::critical(
this,
tr("No media selected"),
tr("Please select a media to replace with or click 'Cancel'."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("No media selected"),
tr("Please select a media to replace with or click 'Cancel'."),
QMessageBox::Ok
);
} else {
Media* new_item = static_cast<Media*>(selected_items.at(0).internalPointer());
if (media == new_item) {
QMessageBox::critical(
this,
tr("Same media selected"),
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Same media selected"),
tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."),
QMessageBox::Ok
);
} else if (new_item->get_type() == MEDIA_TYPE_FOLDER) {
QMessageBox::critical(
this,
tr("Folder selected"),
tr("You cannot replace footage with a folder."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Folder selected"),
tr("You cannot replace footage with a folder."),
QMessageBox::Ok
);
} else {
if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == new_item->to_sequence()) {
QMessageBox::critical(
this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself."),
QMessageBox::Ok
);
QMessageBox::critical(
this,
tr("Active sequence selected"),
tr("You cannot insert a sequence into itself."),
QMessageBox::Ok
);
} else {
ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand(
media,
+13 -14
View File
@@ -19,43 +19,42 @@
#include "project/media.h"
SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle(tr("Speed/Duration"));
setWindowTitle(tr("Speed/Duration"));
QVBoxLayout* main_layout = new QVBoxLayout();
setLayout(main_layout);
QVBoxLayout* main_layout = new QVBoxLayout(this);
QGridLayout* grid = new QGridLayout();
QGridLayout* grid = new QGridLayout(this);
grid->setSpacing(6);
grid->addWidget(new QLabel(tr("Speed:")), 0, 0);
percent = new LabelSlider();
grid->addWidget(new QLabel(tr("Speed:"), this), 0, 0);
percent = new LabelSlider(this);
percent->decimal_places = 2;
percent->set_display_type(LABELSLIDER_PERCENT);
percent->set_default_value(1);
grid->addWidget(percent, 0, 1);
grid->addWidget(new QLabel(tr("Frame Rate:")), 1, 0);
frame_rate = new LabelSlider();
grid->addWidget(new QLabel(tr("Frame Rate:"), this), 1, 0);
frame_rate = new LabelSlider(this);
frame_rate->decimal_places = 3;
grid->addWidget(frame_rate, 1, 1);
grid->addWidget(new QLabel(tr("Duration:")), 2, 0);
duration = new LabelSlider();
grid->addWidget(new QLabel(tr("Duration:"), this), 2, 0);
duration = new LabelSlider(this);
duration->set_display_type(LABELSLIDER_FRAMENUMBER);
duration->set_frame_rate(sequence->frame_rate);
grid->addWidget(duration, 2, 1);
main_layout->addLayout(grid);
reverse = new QCheckBox(tr("Reverse"));
maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch"));
ripple = new QCheckBox(tr("Ripple Changes"));
reverse = new QCheckBox(tr("Reverse"), this);
maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch"), this);
ripple = new QCheckBox(tr("Ripple Changes"), this);
main_layout->addWidget(reverse);
main_layout->addWidget(maintain_pitch);
main_layout->addWidget(ripple);
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setCenterButtons(true);
main_layout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+64 -63
View File
@@ -8,96 +8,97 @@
#include "ui/labelslider.h"
// NOTE: this is never used in Olive, hasn't been maintained, and needs to be written
StabilizerDialog::StabilizerDialog(QWidget *parent) : QDialog(parent) {
setWindowTitle("Stabilizer");
setWindowTitle("Stabilizer");
layout = new QVBoxLayout(this);
setLayout(layout);
layout = new QVBoxLayout(this);
enable_stab = new QCheckBox(this);
enable_stab->setText("Enable Stabilizer");
layout->addWidget(enable_stab);
enable_stab = new QCheckBox(this);
enable_stab->setText("Enable Stabilizer");
layout->addWidget(enable_stab);
analysis = new QGroupBox("Analysis", this);
layout->addWidget(analysis);
analysis = new QGroupBox("Analysis", this);
layout->addWidget(analysis);
analysis_layout = new QGridLayout(analysis);
analysis->setLayout(analysis_layout);
analysis_layout = new QGridLayout(analysis);
analysis->setLayout(analysis_layout);
analysis_layout->addWidget(new QLabel("Shakiness:"), 0, 0);
analysis_layout->addWidget(new QLabel("Shakiness:", this), 0, 0);
shakiness_slider = new LabelSlider();
shakiness_slider->set_minimum_value(1);
shakiness_slider->set_default_value(5);
shakiness_slider->set_maximum_value(10);
analysis_layout->addWidget(shakiness_slider, 0, 1);
shakiness_slider = new LabelSlider(this);
shakiness_slider->set_minimum_value(1);
shakiness_slider->set_default_value(5);
shakiness_slider->set_maximum_value(10);
analysis_layout->addWidget(shakiness_slider, 0, 1);
analysis_layout->addWidget(new QLabel("Accuracy:"), 1, 0);
analysis_layout->addWidget(new QLabel("Accuracy:", this), 1, 0);
accuracy_slider = new LabelSlider();
accuracy_slider->set_minimum_value(1);
accuracy_slider->set_default_value(15);
accuracy_slider->set_maximum_value(15);
analysis_layout->addWidget(accuracy_slider, 1, 1);
accuracy_slider = new LabelSlider(this);
accuracy_slider->set_minimum_value(1);
accuracy_slider->set_default_value(15);
accuracy_slider->set_maximum_value(15);
analysis_layout->addWidget(accuracy_slider, 1, 1);
analysis_layout->addWidget(new QLabel("Step Size:"), 2, 0);
analysis_layout->addWidget(new QLabel("Step Size:", this), 2, 0);
stepsize_slider = new LabelSlider();
stepsize_slider->set_minimum_value(1);
stepsize_slider->set_default_value(6);
analysis_layout->addWidget(stepsize_slider, 2, 1);
stepsize_slider = new LabelSlider(this);
stepsize_slider->set_minimum_value(1);
stepsize_slider->set_default_value(6);
analysis_layout->addWidget(stepsize_slider, 2, 1);
analysis_layout->addWidget(new QLabel("Minimum Contrast:"), 3, 0);
analysis_layout->addWidget(new QLabel("Minimum Contrast:", this), 3, 0);
mincontrast_slider = new LabelSlider();
mincontrast_slider->set_minimum_value(0);
mincontrast_slider->set_default_value(0.3);
mincontrast_slider->set_maximum_value(1);
analysis_layout->addWidget(mincontrast_slider, 3, 1);
mincontrast_slider = new LabelSlider(this);
mincontrast_slider->set_minimum_value(0);
mincontrast_slider->set_default_value(0.3);
mincontrast_slider->set_maximum_value(1);
analysis_layout->addWidget(mincontrast_slider, 3, 1);
/*analysis_layout->addWidget(new QLabel("Tripod Mode:"), 4, 0);
/*analysis_layout->addWidget(new QLabel("Tripod Mode:"), 4, 0);
tripod_mode_box = new QCheckBox();
analysis_layout->addWidget(tripod_mode_box, 4, 1);*/
tripod_mode_box = new QCheckBox();
analysis_layout->addWidget(tripod_mode_box, 4, 1);*/
stabilization = new QGroupBox("Stabilization", this);
layout->addWidget(stabilization);
stabilization = new QGroupBox("Stabilization", this);
layout->addWidget(stabilization);
stabilization_layout = new QGridLayout();
stabilization->setLayout(stabilization_layout);
stabilization_layout = new QGridLayout(this);
stabilization->setLayout(stabilization_layout);
stabilization_layout->addWidget(new QLabel("Smoothing:"), 0, 0);
stabilization_layout->addWidget(new QLabel("Smoothing:", this), 0, 0);
smoothing_slider = new LabelSlider();
smoothing_slider->set_minimum_value(0);
smoothing_slider->set_default_value(10);
stabilization_layout->addWidget(smoothing_slider, 0, 1);
smoothing_slider = new LabelSlider();
smoothing_slider->set_minimum_value(0);
smoothing_slider->set_default_value(10);
stabilization_layout->addWidget(smoothing_slider, 0, 1);
stabilization_layout->addWidget(new QLabel("Gaussian Motion:"), 1, 0);
stabilization_layout->addWidget(new QLabel("Gaussian Motion:"), 1, 0);
gaussian_motion = new QCheckBox();
gaussian_motion->setChecked(true);
stabilization_layout->addWidget(gaussian_motion, 1, 1);
gaussian_motion = new QCheckBox();
gaussian_motion->setChecked(true);
stabilization_layout->addWidget(gaussian_motion, 1, 1);
stabilization_layout->addWidget(new QLabel("Maximum Movement:"), 2, 0);
stabilization_layout->addWidget(new QLabel("Maximum Rotation:"), 3, 0);
stabilization_layout->addWidget(new QLabel("Crop:"), 4, 0);
stabilization_layout->addWidget(new QLabel("Zoom Behavior:"), 5, 0);
stabilization_layout->addWidget(new QLabel("Zoom Speed:"), 6, 0);
stabilization_layout->addWidget(new QLabel("Interpolation Quality:"), 7, 0);
stabilization_layout->addWidget(new QLabel("Maximum Movement:"), 2, 0);
stabilization_layout->addWidget(new QLabel("Maximum Rotation:"), 3, 0);
stabilization_layout->addWidget(new QLabel("Crop:"), 4, 0);
stabilization_layout->addWidget(new QLabel("Zoom Behavior:"), 5, 0);
stabilization_layout->addWidget(new QLabel("Zoom Speed:"), 6, 0);
stabilization_layout->addWidget(new QLabel("Interpolation Quality:"), 7, 0);
buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(enable_stab, SIGNAL(toggled(bool)), this, SLOT(set_all_enabled(bool)));
connect(enable_stab, SIGNAL(toggled(bool)), this, SLOT(set_all_enabled(bool)));
set_all_enabled(false);
set_all_enabled(false);
}
void StabilizerDialog::set_all_enabled(bool e) {
analysis->setEnabled(e);
stabilization->setEnabled(e);
analysis->setEnabled(e);
stabilization->setEnabled(e);
}
+4 -5
View File
@@ -7,16 +7,15 @@
TextEditDialog::TextEditDialog(QWidget *parent, const QString &s) :
QDialog(parent)
{
setWindowTitle(tr("Edit Text"));
setWindowTitle(tr("Edit Text"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
textEdit = new QPlainTextEdit();
textEdit = new QPlainTextEdit(this);
textEdit->setPlainText(s);
layout->addWidget(textEdit);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), this, SLOT(save()));
connect(buttons, SIGNAL(rejected()), this, SLOT(cancel()));