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);
56 QString iconThemeName = QString::fromUtf8(
"system-file-manager");
57 if (QIcon::hasThemeIcon(iconThemeName)) {
58 icon = QIcon::fromTheme(iconThemeName);
60 icon.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/apps/system-file-manager.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
62 FilesDock->setWindowIcon(icon);
63 dockWidgetContents =
new QWidget();
64 dockWidgetContents->setObjectName(
"dockWidgetContents");
65 verticalLayout =
new QVBoxLayout(dockWidgetContents);
66 verticalLayout->setSpacing(0);
67 verticalLayout->setObjectName(
"verticalLayout");
68 verticalLayout->setContentsMargins(0, 0, 0, 0);
69 locationsLayout =
new QHBoxLayout();
70 locationsLayout->setSpacing(5);
71 locationsLayout->setObjectName(
"locationsLayout");
72 horizontalSpacer =
new QSpacerItem(5, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Minimum);
74 locationsLayout->addItem(horizontalSpacer);
76 label =
new QLabel(dockWidgetContents);
77 label->setObjectName(
"label");
79 locationsLayout->addWidget(label);
81 locationsCombo =
new QComboBox(dockWidgetContents);
82 locationsCombo->setObjectName(
"locationsCombo");
83 QSizePolicy sizePolicy(QSizePolicy::Policy::MinimumExpanding, QSizePolicy::Policy::Fixed);
84 sizePolicy.setHorizontalStretch(0);
85 sizePolicy.setVerticalStretch(0);
86 sizePolicy.setHeightForWidth(locationsCombo->sizePolicy().hasHeightForWidth());
87 locationsCombo->setSizePolicy(sizePolicy);
88 locationsCombo->setEditable(
true);
89 locationsCombo->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon);
91 locationsLayout->addWidget(locationsCombo);
93 addLocationButton =
new QPushButton(dockWidgetContents);
94 addLocationButton->setObjectName(
"addLocationButton");
95 addLocationButton->setMaximumSize(QSize(20, 20));
97 iconThemeName = QString::fromUtf8(
"list-add");
98 if (QIcon::hasThemeIcon(iconThemeName)) {
99 icon1 = QIcon::fromTheme(iconThemeName);
101 icon1.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/actions/list-add.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
103 addLocationButton->setIcon(icon1);
105 locationsLayout->addWidget(addLocationButton);
107 removeLocationButton =
new QPushButton(dockWidgetContents);
108 removeLocationButton->setObjectName(
"removeLocationButton");
109 removeLocationButton->setMaximumSize(QSize(20, 20));
111 iconThemeName = QString::fromUtf8(
"list-remove");
112 if (QIcon::hasThemeIcon(iconThemeName)) {
113 icon2 = QIcon::fromTheme(iconThemeName);
115 icon2.addFile(QString::fromUtf8(
":/icons/oxygen/32x32/actions/list-remove.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
117 removeLocationButton->setIcon(icon2);
119 locationsLayout->addWidget(removeLocationButton);
122 verticalLayout->addLayout(locationsLayout);
124 filtersLayout =
new QHBoxLayout();
125 filtersLayout->setObjectName(
"filtersLayout");
127 verticalLayout->addLayout(filtersLayout);
129 splitter =
new QSplitter(dockWidgetContents);
130 splitter->setObjectName(
"splitter");
131 splitter->setOrientation(Qt::Orientation::Horizontal);
132 treeView =
new QTreeView(splitter);
133 treeView->setObjectName(
"treeView");
134 treeView->setAcceptDrops(
true);
135 treeView->setUniformRowHeights(
true);
136 treeView->setAnimated(
true);
137 splitter->addWidget(treeView);
138 layoutWidget_2 =
new QWidget(splitter);
139 layoutWidget_2->setObjectName(
"layoutWidget_2");
140 verticalLayout_3 =
new QVBoxLayout(layoutWidget_2);
141 verticalLayout_3->setObjectName(
"verticalLayout_3");
142 verticalLayout_3->setContentsMargins(0, 0, 0, 0);
143 tableView =
new PlaylistTable(layoutWidget_2);
144 tableView->setObjectName(
"tableView");
145 tableView->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
146 tableView->setDragEnabled(
false);
147 tableView->setAlternatingRowColors(
true);
148 tableView->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
149 tableView->setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows);
150 tableView->setHorizontalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel);
151 tableView->horizontalHeader()->setDefaultSectionSize(200);
152 tableView->horizontalHeader()->setProperty(
"showSortIndicator", QVariant(
true));
153 tableView->verticalHeader()->setVisible(
false);
155 verticalLayout_3->addWidget(tableView);
157 listView =
new PlaylistListView(layoutWidget_2);
158 listView->setObjectName(
"listView");
159 listView->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
160 listView->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
161 listView->setMovement(QListView::Movement::Static);
163 verticalLayout_3->addWidget(listView);
165 splitter->addWidget(layoutWidget_2);
167 verticalLayout->addWidget(splitter);
169 FilesDock->setWidget(dockWidgetContents);
171 retranslateUi(FilesDock);
173 QMetaObject::connectSlotsByName(FilesDock);
176 void retranslateUi(QDockWidget *FilesDock)
178 FilesDock->setWindowTitle(QCoreApplication::translate(
"FilesDock",
"Files",
nullptr));
179 label->setText(QCoreApplication::translate(
"FilesDock",
"Location",
nullptr));
180#if QT_CONFIG(tooltip)
181 addLocationButton->setToolTip(QCoreApplication::translate(
"FilesDock",
"Add the current folder to the saved locations",
nullptr));
183 addLocationButton->setText(QString());
184#if QT_CONFIG(tooltip)
185 removeLocationButton->setToolTip(QCoreApplication::translate(
"FilesDock",
"Remove the selected location",
nullptr));
187 removeLocationButton->setText(QString());
188#if QT_CONFIG(tooltip)
189 tableView->setToolTip(QString());
196 class FilesDock:
public Ui_FilesDock {};