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