12#include <QtCore/QVariant>
14#include <QtWidgets/QApplication>
15#include <QtWidgets/QComboBox>
16#include <QtWidgets/QDockWidget>
17#include <QtWidgets/QHBoxLayout>
18#include <QtWidgets/QHeaderView>
19#include <QtWidgets/QLabel>
20#include <QtWidgets/QPushButton>
21#include <QtWidgets/QSpacerItem>
22#include <QtWidgets/QSplitter>
23#include <QtWidgets/QTreeView>
24#include <QtWidgets/QVBoxLayout>
25#include <QtWidgets/QWidget>
26#include "widgets/playlistlistview.h"
27#include "widgets/playlisttable.h"
34 QWidget *dockWidgetContents;
35 QVBoxLayout *verticalLayout;
36 QHBoxLayout *locationsLayout;
37 QSpacerItem *horizontalSpacer;
39 QComboBox *locationsCombo;
40 QPushButton *addLocationButton;
41 QPushButton *removeLocationButton;
42 QHBoxLayout *filtersLayout;
45 QWidget *layoutWidget_2;
46 QVBoxLayout *verticalLayout_3;
47 PlaylistTable *tableView;
48 PlaylistListView *listView;
50 void setupUi(QDockWidget *FilesDock)
52 if (FilesDock->objectName().isEmpty())
53 FilesDock->setObjectName(
"FilesDock");
54 FilesDock->resize(460, 278);
55 dockWidgetContents =
new QWidget();
56 dockWidgetContents->setObjectName(
"dockWidgetContents");
57 verticalLayout =
new QVBoxLayout(dockWidgetContents);
58 verticalLayout->setSpacing(0);
59 verticalLayout->setObjectName(
"verticalLayout");
60 verticalLayout->setContentsMargins(0, 0, 0, 0);
61 locationsLayout =
new QHBoxLayout();
62 locationsLayout->setSpacing(5);
63 locationsLayout->setObjectName(
"locationsLayout");
64 horizontalSpacer =
new QSpacerItem(5, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Minimum);
66 locationsLayout->addItem(horizontalSpacer);
68 label =
new QLabel(dockWidgetContents);
69 label->setObjectName(
"label");
71 locationsLayout->addWidget(label);
73 locationsCombo =
new QComboBox(dockWidgetContents);
74 locationsCombo->setObjectName(
"locationsCombo");
75 QSizePolicy sizePolicy(QSizePolicy::Policy::MinimumExpanding, QSizePolicy::Policy::Fixed);
76 sizePolicy.setHorizontalStretch(0);
77 sizePolicy.setVerticalStretch(0);
78 sizePolicy.setHeightForWidth(locationsCombo->sizePolicy().hasHeightForWidth());
79 locationsCombo->setSizePolicy(sizePolicy);
80 locationsCombo->setEditable(
true);
81 locationsCombo->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon);
83 locationsLayout->addWidget(locationsCombo);
85 addLocationButton =
new QPushButton(dockWidgetContents);
86 addLocationButton->setObjectName(
"addLocationButton");
87 addLocationButton->setMaximumSize(QSize(20, 20));
89 QString iconThemeName = QString::fromUtf8(
"list-add");
90 if (QIcon::hasThemeIcon(iconThemeName)) {
91 icon = QIcon::fromTheme(iconThemeName);
93 icon.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/actions/list-add.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
95 addLocationButton->setIcon(icon);
97 locationsLayout->addWidget(addLocationButton);
99 removeLocationButton =
new QPushButton(dockWidgetContents);
100 removeLocationButton->setObjectName(
"removeLocationButton");
101 removeLocationButton->setMaximumSize(QSize(20, 20));
103 iconThemeName = QString::fromUtf8(
"list-remove");
104 if (QIcon::hasThemeIcon(iconThemeName)) {
105 icon1 = QIcon::fromTheme(iconThemeName);
107 icon1.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/actions/list-remove.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
109 removeLocationButton->setIcon(icon1);
111 locationsLayout->addWidget(removeLocationButton);
114 verticalLayout->addLayout(locationsLayout);
116 filtersLayout =
new QHBoxLayout();
117 filtersLayout->setObjectName(
"filtersLayout");
119 verticalLayout->addLayout(filtersLayout);
121 splitter =
new QSplitter(dockWidgetContents);
122 splitter->setObjectName(
"splitter");
123 splitter->setOrientation(Qt::Orientation::Horizontal);
124 treeView =
new QTreeView(splitter);
125 treeView->setObjectName(
"treeView");
126 treeView->setAcceptDrops(
true);
127 treeView->setUniformRowHeights(
true);
128 treeView->setAnimated(
true);
129 splitter->addWidget(treeView);
130 layoutWidget_2 =
new QWidget(splitter);
131 layoutWidget_2->setObjectName(
"layoutWidget_2");
132 verticalLayout_3 =
new QVBoxLayout(layoutWidget_2);
133 verticalLayout_3->setObjectName(
"verticalLayout_3");
134 verticalLayout_3->setContentsMargins(0, 0, 0, 0);
135 tableView =
new PlaylistTable(layoutWidget_2);
136 tableView->setObjectName(
"tableView");
137 tableView->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
138 tableView->setDragEnabled(
false);
139 tableView->setAlternatingRowColors(
true);
140 tableView->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
141 tableView->setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows);
142 tableView->setHorizontalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel);
143 tableView->horizontalHeader()->setDefaultSectionSize(200);
144 tableView->horizontalHeader()->setProperty(
"showSortIndicator", QVariant(
true));
145 tableView->verticalHeader()->setVisible(
false);
147 verticalLayout_3->addWidget(tableView);
149 listView =
new PlaylistListView(layoutWidget_2);
150 listView->setObjectName(
"listView");
151 listView->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
152 listView->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
153 listView->setMovement(QListView::Movement::Static);
155 verticalLayout_3->addWidget(listView);
157 splitter->addWidget(layoutWidget_2);
159 verticalLayout->addWidget(splitter);
161 FilesDock->setWidget(dockWidgetContents);
163 retranslateUi(FilesDock);
165 QMetaObject::connectSlotsByName(FilesDock);
168 void retranslateUi(QDockWidget *FilesDock)
170 FilesDock->setWindowTitle(QCoreApplication::translate(
"FilesDock",
"Files",
nullptr));
171 label->setText(QCoreApplication::translate(
"FilesDock",
"Location",
nullptr));
172#if QT_CONFIG(tooltip)
173 addLocationButton->setToolTip(QCoreApplication::translate(
"FilesDock",
"Add the current folder to the saved locations",
nullptr));
175 addLocationButton->setText(QString());
176#if QT_CONFIG(tooltip)
177 removeLocationButton->setToolTip(QCoreApplication::translate(
"FilesDock",
"Remove the selected location",
nullptr));
179 removeLocationButton->setText(QString());
180#if QT_CONFIG(tooltip)
181 tableView->setToolTip(QString());
188 class FilesDock:
public Ui_FilesDock {};