Changeset View
Changeset View
Standalone View
Standalone View
src/settings/viewpropertiesdialog.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 68 | { | |||
---|---|---|---|---|---|
86 | QWidget* propsBox = this; | 86 | QWidget* propsBox = this; | ||
87 | if (!useGlobalViewProps) { | 87 | if (!useGlobalViewProps) { | ||
88 | propsBox = new QGroupBox(i18nc("@title:group", "Properties"), this); | 88 | propsBox = new QGroupBox(i18nc("@title:group", "Properties"), this); | ||
89 | layout->addWidget(propsBox); | 89 | layout->addWidget(propsBox); | ||
90 | } | 90 | } | ||
91 | 91 | | |||
92 | QLabel* viewModeLabel = new QLabel(i18nc("@label:listbox", "View mode:"), propsGrid); | 92 | QLabel* viewModeLabel = new QLabel(i18nc("@label:listbox", "View mode:"), propsGrid); | ||
93 | m_viewMode = new KComboBox(propsGrid); | 93 | m_viewMode = new KComboBox(propsGrid); | ||
94 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-icons")), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView); | 94 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-icons")), i18nc("@item:inlistbox", "Icons"), static_cast<int>(DolphinView::Mode::IconsView)); | ||
95 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-details")), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView); | 95 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-details")), i18nc("@item:inlistbox", "Compact"), static_cast<int>(DolphinView::Mode::CompactView)); | ||
96 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView); | 96 | m_viewMode->addItem(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18nc("@item:inlistbox", "Details"), static_cast<int>(DolphinView::Mode::DetailsView)); | ||
97 | 97 | | |||
98 | QLabel* sortingLabel = new QLabel(i18nc("@label:listbox", "Sorting:"), propsGrid); | 98 | QLabel* sortingLabel = new QLabel(i18nc("@label:listbox", "Sorting:"), propsGrid); | ||
99 | QWidget* sortingBox = new QWidget(propsGrid); | 99 | QWidget* sortingBox = new QWidget(propsGrid); | ||
100 | 100 | | |||
101 | m_sortOrder = new KComboBox(sortingBox); | 101 | m_sortOrder = new KComboBox(sortingBox); | ||
102 | m_sortOrder->addItem(i18nc("@item:inlistbox Sort", "Ascending")); | 102 | m_sortOrder->addItem(i18nc("@item:inlistbox Sort", "Ascending")); | ||
103 | m_sortOrder->addItem(i18nc("@item:inlistbox Sort", "Descending")); | 103 | m_sortOrder->addItem(i18nc("@item:inlistbox Sort", "Descending")); | ||
104 | 104 | | |||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Line(s) | 289 | if (m_isDirty != isDirty) { | |||
290 | m_isDirty = isDirty; | 290 | m_isDirty = isDirty; | ||
291 | emit isDirtyChanged(isDirty); | 291 | emit isDirtyChanged(isDirty); | ||
292 | } | 292 | } | ||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | void ViewPropertiesDialog::configureAdditionalInfo() | 295 | void ViewPropertiesDialog::configureAdditionalInfo() | ||
296 | { | 296 | { | ||
297 | QList<QByteArray> visibleRoles = m_viewProps->visibleRoles(); | 297 | QList<QByteArray> visibleRoles = m_viewProps->visibleRoles(); | ||
298 | const bool useDefaultRoles = (m_viewProps->viewMode() == DolphinView::DetailsView) && visibleRoles.isEmpty(); | 298 | const bool useDefaultRoles = (m_viewProps->viewMode() == DolphinView::Mode::DetailsView) && visibleRoles.isEmpty(); | ||
299 | if (useDefaultRoles) { | 299 | if (useDefaultRoles) { | ||
300 | // Using the details view without any additional information (-> additional column) | 300 | // Using the details view without any additional information (-> additional column) | ||
301 | // makes no sense and leads to a usability problem as no viewport area is available | 301 | // makes no sense and leads to a usability problem as no viewport area is available | ||
302 | // anymore. Hence as fallback provide at least a size and date column. | 302 | // anymore. Hence as fallback provide at least a size and date column. | ||
303 | visibleRoles.clear(); | 303 | visibleRoles.clear(); | ||
304 | visibleRoles.append("text"); | 304 | visibleRoles.append("text"); | ||
305 | visibleRoles.append("size"); | 305 | visibleRoles.append("size"); | ||
306 | visibleRoles.append("modificationtime"); | 306 | visibleRoles.append("modificationtime"); | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 319 | { | |||
381 | 381 | | |||
382 | markAsDirty(false); | 382 | markAsDirty(false); | ||
383 | } | 383 | } | ||
384 | 384 | | |||
385 | void ViewPropertiesDialog::loadSettings() | 385 | void ViewPropertiesDialog::loadSettings() | ||
386 | { | 386 | { | ||
387 | // Load view mode | 387 | // Load view mode | ||
388 | switch (m_viewProps->viewMode()) { | 388 | switch (m_viewProps->viewMode()) { | ||
389 | case DolphinView::IconsView: m_viewMode->setCurrentIndex(0); break; | 389 | case DolphinView::Mode::IconsView: m_viewMode->setCurrentIndex(0); break; | ||
390 | case DolphinView::CompactView: m_viewMode->setCurrentIndex(1); break; | 390 | case DolphinView::Mode::CompactView: m_viewMode->setCurrentIndex(1); break; | ||
391 | case DolphinView::DetailsView: m_viewMode->setCurrentIndex(2); break; | 391 | case DolphinView::Mode::DetailsView: m_viewMode->setCurrentIndex(2); break; | ||
392 | default: break; | 392 | default: break; | ||
393 | } | 393 | } | ||
394 | 394 | | |||
395 | // Load sort order and sorting | 395 | // Load sort order and sorting | ||
396 | const int sortOrderIndex = (m_viewProps->sortOrder() == Qt::AscendingOrder) ? 0 : 1; | 396 | const int sortOrderIndex = (m_viewProps->sortOrder() == Qt::AscendingOrder) ? 0 : 1; | ||
397 | m_sortOrder->setCurrentIndex(sortOrderIndex); | 397 | m_sortOrder->setCurrentIndex(sortOrderIndex); | ||
398 | 398 | | |||
399 | const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation(); | 399 | const QList<KFileItemModel::RoleInfo> rolesInfo = KFileItemModel::rolesInformation(); | ||
Show All 18 Lines |