Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/PanelView/krview.cpp
| Show First 20 Lines • Show All 1079 Lines • ▼ Show 20 Line(s) | 1078 | { | |||
|---|---|---|---|---|---|
| 1080 | KConfigGroup cfg(_config, "Look&Feel"); | 1080 | KConfigGroup cfg(_config, "Look&Feel"); | ||
| 1081 | bool rememberSettings = cfg.readEntry("FilterDialogRemembersSettings", _FilterDialogRemembersSettings); | 1081 | bool rememberSettings = cfg.readEntry("FilterDialogRemembersSettings", _FilterDialogRemembersSettings); | ||
| 1082 | bool applyToDirs = rememberSettings ? _properties->filterApplysToDirs : false; | 1082 | bool applyToDirs = rememberSettings ? _properties->filterApplysToDirs : false; | ||
| 1083 | switch (filter) { | 1083 | switch (filter) { | ||
| 1084 | case KrViewProperties::All : | 1084 | case KrViewProperties::All : | ||
| 1085 | break; | 1085 | break; | ||
| 1086 | case KrViewProperties::Custom : | 1086 | case KrViewProperties::Custom : | ||
| 1087 | { | 1087 | { | ||
| 1088 | FilterDialog dialog(_widget, i18n("Filter Files"), QStringList(i18n("Apply filter to folders")), false); | 1088 | QString applyFilterToFolders = i18n("Apply filter to folder&s"); | ||
| 1089 | dialog.checkExtraOption(i18n("Apply filter to folders"), applyToDirs); | 1089 | // Note: It has the same shortcut as "Apply &selection to folders" has | ||
| 1090 | // in a very similar dialog (which is aimed to select files/folders). | ||||
| 1091 | // The "Alt+A" and "Alt+F" shortcuts were already taken | ||||
| 1092 | | ||||
| 1093 | FilterDialog dialog(_widget, i18n("Filter Files"), QStringList(applyFilterToFolders), false); | ||||
| 1094 | dialog.checkExtraOption(applyFilterToFolders, applyToDirs); | ||||
| 1090 | if(rememberSettings) | 1095 | if (rememberSettings) | ||
| 1091 | dialog.applySettings(_properties->filterSettings); | 1096 | dialog.applySettings(_properties->filterSettings); | ||
| 1092 | dialog.exec(); | 1097 | dialog.exec(); | ||
| 1093 | FilterSettings s(dialog.getSettings()); | 1098 | FilterSettings s(dialog.getSettings()); | ||
| 1094 | if(!s.isValid()) // if the user canceled - quit | 1099 | if (!s.isValid()) // if the user canceled -> quit | ||
| 1095 | return; | 1100 | return; | ||
| 1096 | _properties->filterSettings = s; | 1101 | _properties->filterSettings = s; | ||
| 1097 | _properties->filterMask = s.toQuery(); | 1102 | _properties->filterMask = s.toQuery(); | ||
| 1098 | applyToDirs = dialog.isExtraOptionChecked(i18n("Apply filter to folders")); | 1103 | applyToDirs = dialog.isExtraOptionChecked(applyFilterToFolders); | ||
| 1099 | } | 1104 | } | ||
| 1100 | break; | 1105 | break; | ||
| 1101 | default: | 1106 | default: | ||
| 1102 | return; | 1107 | return; | ||
| 1103 | } | 1108 | } | ||
| 1104 | _properties->filterApplysToDirs = applyToDirs; | 1109 | _properties->filterApplysToDirs = applyToDirs; | ||
| 1105 | _properties->filter = filter; | 1110 | _properties->filter = filter; | ||
| 1106 | refresh(); | 1111 | refresh(); | ||
| 1107 | } | 1112 | } | ||
| 1108 | 1113 | | |||
| 1109 | void KrView::customSelection(bool select) | 1114 | void KrView::customSelection(bool select) | ||
| 1110 | { | 1115 | { | ||
| 1111 | KConfigGroup grpSvr(_config, "Look&Feel"); | 1116 | KConfigGroup grpSvr(_config, "Look&Feel"); | ||
| 1112 | bool includeDirs = grpSvr.readEntry("Mark Dirs", _MarkDirs); | 1117 | bool includeDirs = grpSvr.readEntry("Mark Dirs", _MarkDirs); | ||
| 1113 | 1118 | | |||
| 1114 | FilterDialog dialog(nullptr, i18n("Select Files"), QStringList(i18n("Apply selection to folders")), false); | 1119 | QString applySelToFolders = i18n("Apply &selection to folders"); | ||
| 1115 | dialog.checkExtraOption(i18n("Apply selection to folders"), includeDirs); | 1120 | FilterDialog dialog(nullptr, i18n("Select Files"), QStringList(applySelToFolders), false); | ||
| 1121 | dialog.checkExtraOption(applySelToFolders, includeDirs); | ||||
| 1116 | dialog.exec(); | 1122 | dialog.exec(); | ||
| 1117 | KRQuery query = dialog.getQuery(); | 1123 | KRQuery query = dialog.getQuery(); | ||
| 1118 | // if the user canceled - quit | 1124 | // if the user canceled -> quit | ||
| 1119 | if (query.isNull()) | 1125 | if (query.isNull()) | ||
| 1120 | return; | 1126 | return; | ||
| 1121 | includeDirs = dialog.isExtraOptionChecked(i18n("Apply selection to folders")); | 1127 | includeDirs = dialog.isExtraOptionChecked(applySelToFolders); | ||
| 1122 | 1128 | | |||
| 1123 | changeSelection(query, select, includeDirs); | 1129 | changeSelection(query, select, includeDirs); | ||
| 1124 | } | 1130 | } | ||
| 1125 | 1131 | | |||
| 1126 | void KrView::refresh() | 1132 | void KrView::refresh() | ||
| 1127 | { | 1133 | { | ||
| 1128 | const QString currentItem = !nameToMakeCurrent().isEmpty() ? // | 1134 | const QString currentItem = !nameToMakeCurrent().isEmpty() ? // | ||
| 1129 | nameToMakeCurrent() : | 1135 | nameToMakeCurrent() : | ||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||