21 #ifndef NDEFILEMAN_SETTINGS_H 22 #define NDEFILEMAN_SETTINGS_H 25 #include <libfm-qt/folderview.h> 26 #include <libfm-qt/foldermodel.h> 27 #include "desktopwindow.h" 28 #include <libfm-qt/sidepane.h> 29 #include <libfm-qt/core/thumbnailjob.h> 30 #include <libfm-qt/core/archiver.h> 31 #include <libfm-qt/core/legacy/fm-config.h> 35 enum OpenDirTargetType {
39 OpenInLastActiveWindow
64 QList<data> loadData(dataType type);
66 bool save(dataType type);
67 bool saveData(QList<data> list,dataType type);
69 bool addData(
data info,dataType type);
70 void deleteData(
int index, dataType type);
72 void changeFavoriteName(
int index, QString text);
75 QStringList connectFavorites()
const {
76 return connectFavorites_;
79 void setConnectFavorites(
const QStringList& list) {
80 connectFavorites_ = list;
84 QStringList connectFavorites_;
85 QStringList connectHistorys_;
86 QString configFilePath;
94 sortOrder_(Qt::AscendingOrder),
95 sortColumn_(Fm::FolderModel::ColumnFileName),
96 viewMode_(Fm::FolderView::DetailedListMode),
98 sortFolderFirst_(
true),
99 sortCaseSensitive_(
true) {
102 bool isCustomized()
const {
103 return isCustomized_;
106 void setCustomized(
bool value) {
107 isCustomized_ = value;
110 Qt::SortOrder sortOrder()
const {
114 void setSortOrder(Qt::SortOrder value) {
118 Fm::FolderModel::ColumnId sortColumn()
const {
122 void setSortColumn(Fm::FolderModel::ColumnId value) {
126 Fm::FolderView::ViewMode viewMode()
const {
130 void setViewMode(Fm::FolderView::ViewMode value) {
134 bool sortFolderFirst()
const {
135 return sortFolderFirst_;
138 void setSortFolderFirst(
bool value) {
139 sortFolderFirst_ = value;
142 bool showHidden()
const {
146 void setShowHidden(
bool value) {
150 bool sortCaseSensitive()
const {
151 return sortCaseSensitive_;
154 void setSortCaseSensitive(
bool value) {
155 sortCaseSensitive_ = value;
160 Qt::SortOrder sortOrder_;
161 Fm::FolderModel::ColumnId sortColumn_;
162 Fm::FolderView::ViewMode viewMode_;
164 bool sortFolderFirst_;
165 bool sortCaseSensitive_;
182 bool load(QString profile =
"default");
183 bool save(QString profile = QString());
185 bool loadFile(QString filePath);
186 bool saveFile(QString filePath);
188 static QString xdgUserConfigDir();
189 static const QList<int> & iconSizes(IconType type);
191 QString profileDir(QString profile,
bool useFallback =
false);
194 QString profileName()
const {
198 bool supportTrash()
const {
199 return supportTrash_;
202 QString fallbackIconThemeName()
const {
203 return fallbackIconThemeName_;
206 bool useFallbackIconTheme()
const {
207 return useFallbackIconTheme_;
210 void setFallbackIconThemeName(QString iconThemeName) {
211 fallbackIconThemeName_ = iconThemeName;
214 OpenDirTargetType bookmarkOpenMethod() {
215 return bookmarkOpenMethod_;
218 void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
219 bookmarkOpenMethod_ = bookmarkOpenMethod;
222 QString suCommand()
const {
226 void setSuCommand(QString suCommand) {
227 suCommand_ = suCommand;
233 void setTerminal(QString terminalCommand);
235 QString archiver()
const {
239 void setArchiver(QString archiver) {
240 archiver_ = archiver;
241 Fm::Archiver::setDefaultArchiverByName(archiver_.toLocal8Bit().constData());
244 bool mountOnStartup()
const {
245 return mountOnStartup_;
248 void setMountOnStartup(
bool mountOnStartup) {
249 mountOnStartup_ = mountOnStartup;
252 bool mountRemovable() {
253 return mountRemovable_;
256 void setMountRemovable(
bool mountRemovable) {
257 mountRemovable_ = mountRemovable;
260 bool autoRun()
const {
264 void setAutoRun(
bool autoRun) {
268 bool closeOnUnmount()
const {
269 return closeOnUnmount_;
272 void setCloseOnUnmount(
bool value) {
273 closeOnUnmount_ = value;
276 DesktopWindow::WallpaperMode wallpaperMode()
const {
277 return DesktopWindow::WallpaperMode(wallpaperMode_);
280 void setWallpaperMode(
int wallpaperMode) {
281 wallpaperMode_ = wallpaperMode;
284 QString wallpaper()
const {
288 QString userWallpaperPath()
const {
289 return userWallpaperPath_;
292 int wallpaperInterval()
const {
293 return wallpaperInterval_;
296 void setWallpaper(QString wallpaper) {
297 wallpaper_ = wallpaper;
300 void setUserWallpaperPath(QString path) {
301 userWallpaperPath_ = path;
304 void setWallpaperInterval(
int interval) {
305 wallpaperInterval_ = interval;
308 void setWallpaperPattern(
int pattern) {
309 wallpaperPattern_ = pattern;
312 QString wallpaperDir()
const {
313 return wallpaperDir_;
316 void setLastSlide(QString wallpaper) {
317 lastSlide_ = wallpaper;
320 QString lastSlide()
const {
324 void setWallpaperDir(QString dir) {
328 int slideShowInterval()
const {
329 return slideShowInterval_;
332 void setSlideShowInterval(
int interval) {
333 slideShowInterval_ = interval;
336 bool wallpaperRandomize()
const {
337 return wallpaperRandomize_;
340 void setWallpaperRandomize(
bool randomize) {
341 wallpaperRandomize_ = randomize;
344 const QColor& desktopBgColor()
const {
345 return desktopBgColor_;
348 void setDesktopBgColor(QColor desktopBgColor) {
349 desktopBgColor_ = desktopBgColor;
352 const QColor& desktopFgColor()
const {
353 return desktopFgColor_;
356 void setDesktopFgColor(QColor desktopFgColor) {
357 desktopFgColor_ = desktopFgColor;
360 const QColor& desktopShadowColor()
const {
361 return desktopShadowColor_;
364 void setDesktopShadowColor(QColor desktopShadowColor) {
365 desktopShadowColor_ = desktopShadowColor;
368 QFont desktopFont()
const {
372 void setDesktopFont(QFont font) {
376 int desktopIconSize()
const {
377 return desktopIconSize_;
380 void setDesktopIconSize(
int desktopIconSize) {
381 desktopIconSize_ = desktopIconSize;
384 QStringList desktopShortcuts()
const {
385 return desktopShortcuts_;
388 void setDesktopShortcuts(
const QStringList& list) {
389 desktopShortcuts_ = list;
392 bool showWmMenu()
const {
396 void setShowWmMenu(
bool value) {
400 bool desktopShowHidden()
const {
401 return desktopShowHidden_;
404 void setDesktopShowHidden(
bool desktopShowHidden) {
405 desktopShowHidden_ = desktopShowHidden;
416 bool desktopAutoSort()
const {
417 return desktopAutoSort_;
420 void setDesktopAutoSort(
bool type) {
421 desktopAutoSort_ = type;
424 Qt::SortOrder desktopSortOrder()
const {
425 return desktopSortOrder_;
428 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
429 desktopSortOrder_ = desktopSortOrder;
432 Fm::FolderModel::ColumnId desktopSortColumn()
const {
433 return desktopSortColumn_;
436 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
437 desktopSortColumn_ = desktopSortColumn;
440 bool desktopSortFolderFirst()
const {
441 return desktopSortFolderFirst_;
444 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
445 desktopSortFolderFirst_ = desktopFolderFirst;
448 bool alwaysShowTabs()
const {
449 return alwaysShowTabs_;
452 void setAlwaysShowTabs(
bool alwaysShowTabs) {
453 alwaysShowTabs_ = alwaysShowTabs;
456 bool showTabClose()
const {
457 return showTabClose_;
460 void setShowTabClose(
bool showTabClose) {
461 showTabClose_ = showTabClose;
464 bool rememberWindowSize()
const {
465 return rememberWindowSize_;
468 void setRememberWindowSize(
bool rememberWindowSize) {
469 rememberWindowSize_ = rememberWindowSize;
472 int windowWidth()
const {
473 if(rememberWindowSize_) {
474 return lastWindowWidth_;
477 return fixedWindowWidth_;
481 int windowHeight()
const {
482 if(rememberWindowSize_) {
483 return lastWindowHeight_;
486 return fixedWindowHeight_;
490 bool windowMaximized()
const {
491 if(rememberWindowSize_) {
492 return lastWindowMaximized_;
499 int fixedWindowWidth()
const {
500 return fixedWindowWidth_;
503 void setFixedWindowWidth(
int fixedWindowWidth) {
504 fixedWindowWidth_ = fixedWindowWidth;
507 int fixedWindowHeight()
const {
508 return fixedWindowHeight_;
511 void setFixedWindowHeight(
int fixedWindowHeight) {
512 fixedWindowHeight_ = fixedWindowHeight;
515 void setLastWindowWidth(
int lastWindowWidth) {
516 lastWindowWidth_ = lastWindowWidth;
519 void setLastWindowHeight(
int lastWindowHeight) {
520 lastWindowHeight_ = lastWindowHeight;
523 void setLastWindowMaximized(
bool lastWindowMaximized) {
524 lastWindowMaximized_ = lastWindowMaximized;
527 int splitterPos()
const {
531 void setSplitterPos(
int splitterPos) {
532 splitterPos_ = splitterPos;
535 Fm::SidePane::Mode sidePaneMode()
const {
536 return sidePaneMode_;
539 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
540 sidePaneMode_ = sidePaneMode;
543 bool showMenuBar()
const {
547 void setShowMenuBar(
bool showMenuBar) {
548 showMenuBar_ = showMenuBar;
551 bool splitView()
const {
555 void setSplitView(
bool split) {
559 Fm::FolderView::ViewMode viewMode()
const {
563 void setViewMode(Fm::FolderView::ViewMode viewMode) {
564 viewMode_ = viewMode;
567 bool showHidden()
const {
571 void setShowHidden(
bool showHidden) {
572 showHidden_ = showHidden;
575 bool sortCaseSensitive()
const {
576 return sortCaseSensitive_;
579 void setSortCaseSensitive(
bool value) {
580 sortCaseSensitive_ = value;
584 bool placesHome()
const {
588 void setPlacesHome(
bool placesHome) {
589 placesHome_ = placesHome;
592 bool placesDesktop()
const {
593 return placesDesktop_;
596 void setPlacesDesktop(
bool placesDesktop) {
597 placesDesktop_ = placesDesktop;
600 bool placesApplications()
const {
601 return placesApplications_;
604 void setPlacesApplications(
bool placesApplications) {
605 placesApplications_ = placesApplications;
608 bool placesTrash()
const {
612 void setPlacesTrash(
bool placesTrash) {
613 placesTrash_ = placesTrash;
616 bool placesRoot()
const {
620 void setPlacesRoot(
bool placesRoot) {
621 placesRoot_ = placesRoot;
624 bool placesComputer()
const {
625 return placesComputer_;
628 void setPlacesComputer(
bool placesComputer) {
629 placesComputer_ = placesComputer;
632 bool placesNetwork()
const {
633 return placesNetwork_;
636 void setPlacesNetwork(
bool placesNetwork) {
637 placesNetwork_ = placesNetwork;
640 QSet<QString> getHiddenPlaces()
const {
641 return hiddenPlaces_;
644 void setHiddenPlace(
const QString& str,
bool hide) {
646 hiddenPlaces_ << str;
649 hiddenPlaces_.remove(str);
654 Qt::SortOrder sortOrder()
const {
658 void setSortOrder(Qt::SortOrder sortOrder) {
659 sortOrder_ = sortOrder;
662 Fm::FolderModel::ColumnId sortColumn()
const {
666 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
667 sortColumn_ = sortColumn;
670 bool sortFolderFirst()
const {
671 return sortFolderFirst_;
674 void setSortFolderFirst(
bool folderFirst) {
675 sortFolderFirst_ = folderFirst;
678 bool showFilter()
const {
682 void setShowFilter(
bool value) {
686 bool pathBarButtons()
const {
687 return pathBarButtons_;
690 void setPathBarButtons(
bool value) {
691 pathBarButtons_ = value;
695 bool singleClick()
const {
699 void setSingleClick(
bool singleClick) {
700 singleClick_ = singleClick;
703 int autoSelectionDelay()
const {
704 return autoSelectionDelay_;
707 void setAutoSelectionDelay(
int value) {
708 autoSelectionDelay_ = value;
711 bool useTrash()
const {
718 void setUseTrash(
bool useTrash) {
719 useTrash_ = useTrash;
722 bool confirmDelete()
const {
723 return confirmDelete_;
726 void setConfirmDelete(
bool confirmDelete) {
727 confirmDelete_ = confirmDelete;
730 bool noUsbTrash()
const {
734 void setNoUsbTrash(
bool noUsbTrash) {
735 noUsbTrash_ = noUsbTrash;
736 fm_config->no_usb_trash = noUsbTrash_;
739 bool confirmTrash()
const {
740 return confirmTrash_;
743 void setConfirmTrash(
bool value) {
744 confirmTrash_ = value;
747 bool quickExec()
const {
751 void setQuickExec(
bool value) {
753 fm_config->quick_exec = quickExec_;
756 bool selectNewFiles()
const {
757 return selectNewFiles_;
760 void setSelectNewFiles(
bool value) {
761 selectNewFiles_ = value;
767 int bigIconSize()
const {
771 void setBigIconSize(
int bigIconSize) {
772 bigIconSize_ = bigIconSize;
775 int smallIconSize()
const {
776 return smallIconSize_;
779 void setSmallIconSize(
int smallIconSize) {
780 smallIconSize_ = smallIconSize;
783 int sidePaneIconSize()
const {
784 return sidePaneIconSize_;
787 void setSidePaneIconSize(
int sidePaneIconSize) {
788 sidePaneIconSize_ = sidePaneIconSize;
791 int thumbnailIconSize()
const {
792 return thumbnailIconSize_;
795 QSize folderViewCellMargins()
const {
796 return folderViewCellMargins_;
799 void setFolderViewCellMargins(QSize size) {
800 folderViewCellMargins_ = size;
803 QSize desktopCellMargins()
const {
804 return desktopCellMargins_;
807 void setDesktopCellMargins(QSize size) {
808 desktopCellMargins_ = size;
812 bool showThumbnails() {
813 return showThumbnails_;
816 void setShowThumbnails(
bool show) {
817 showThumbnails_ = show;
820 void setThumbnailLocalFilesOnly(
bool value) {
821 Fm::ThumbnailJob::setLocalFilesOnly(value);
824 bool thumbnailLocalFilesOnly()
const {
825 return Fm::ThumbnailJob::localFilesOnly();
828 int maxThumbnailFileSize()
const {
829 return Fm::ThumbnailJob::maxThumbnailFileSize();
832 void setMaxThumbnailFileSize(
int size) {
833 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
836 void setThumbnailIconSize(
int thumbnailIconSize) {
837 thumbnailIconSize_ = thumbnailIconSize;
844 void setSiUnit(
bool siUnit) {
847 fm_config->si_unit = (gboolean)siUnit_;
850 bool backupAsHidden()
const {
851 return backupAsHidden_;
854 void setBackupAsHidden(
bool value) {
855 backupAsHidden_ = value;
856 fm_config->backup_as_hidden = backupAsHidden_;
859 bool showFullNames()
const {
860 return showFullNames_;
863 void setShowFullNames(
bool value) {
864 showFullNames_ = value;
867 bool shadowHidden()
const {
868 return shadowHidden_;
871 void setShadowHidden(
bool value) {
872 shadowHidden_ = value;
875 bool onlyUserTemplates()
const {
876 return onlyUserTemplates_;
879 void setOnlyUserTemplates(
bool value) {
880 onlyUserTemplates_ = value;
881 fm_config->only_user_templates = onlyUserTemplates_;
884 bool templateTypeOnce()
const {
885 return templateTypeOnce_;
888 void setTemplateTypeOnce(
bool value) {
889 templateTypeOnce_ = value;
890 fm_config->template_type_once = templateTypeOnce_;
893 bool templateRunApp()
const {
894 return templateRunApp_;
897 void setTemplateRunApp(
bool value) {
898 templateRunApp_ = value;
899 fm_config->template_run_app = templateRunApp_;
903 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
905 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
907 void clearFolderSettings(
const Fm::FilePath& path)
const;
909 bool searchNameCaseInsensitive()
const {
910 return searchNameCaseInsensitive_;
913 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
914 searchNameCaseInsensitive_ = caseInsensitive;
917 bool searchContentCaseInsensitive()
const {
918 return searchContentCaseInsensitive_;
921 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
922 searchContentCaseInsensitive_ = caseInsensitive;
925 bool searchNameRegexp()
const {
926 return searchNameRegexp_;
929 void setSearchNameRegexp(
bool reg) {
930 searchNameRegexp_ = reg;
933 bool searchContentRegexp()
const {
934 return searchContentRegexp_;
937 void setSearchContentRegexp(
bool reg) {
938 searchContentRegexp_ = reg;
941 bool searchRecursive()
const {
942 return searchRecursive_;
945 void setSearchRecursive(
bool rec) {
946 searchRecursive_ = rec;
949 bool searchhHidden()
const {
950 return searchhHidden_;
953 void setSearchhHidden(
bool hidden) {
954 searchhHidden_ = hidden;
957 QList<int> getCustomColumnWidths()
const {
959 for(
auto width : qAsConst(customColumnWidths_)) {
965 void setCustomColumnWidths(
const QList<int> &widths) {
966 customColumnWidths_.clear();
967 for(
auto width : widths) {
968 customColumnWidths_ << QVariant(width);
972 QList<int> getHiddenColumns()
const {
974 for(
auto width : qAsConst(hiddenColumns_)) {
980 void setHiddenColumns(
const QList<int> &columns) {
981 hiddenColumns_.clear();
982 for(
auto column : columns) {
983 hiddenColumns_ << QVariant(column);
988 int toIconSize(
int size, IconType type)
const;
990 QString profileName_;
994 QString fallbackIconThemeName_;
995 bool useFallbackIconTheme_;
997 OpenDirTargetType bookmarkOpenMethod_;
1000 bool mountOnStartup_;
1001 bool mountRemovable_;
1003 bool closeOnUnmount_;
1007 QString userWallpaperPath_;
1008 int wallpaperInterval_;
1009 int wallpaperPattern_;
1011 QString wallpaperDir_;
1012 int slideShowInterval_;
1013 bool wallpaperRandomize_;
1014 QColor desktopBgColor_;
1015 QColor desktopFgColor_;
1016 QColor desktopShadowColor_;
1018 int desktopIconSize_;
1019 QStringList desktopShortcuts_;
1022 bool desktopShowHidden_;
1024 bool desktopAutoSort_;
1025 Qt::SortOrder desktopSortOrder_;
1026 Fm::FolderModel::ColumnId desktopSortColumn_;
1027 bool desktopSortFolderFirst_;
1029 bool alwaysShowTabs_;
1031 bool rememberWindowSize_;
1032 int fixedWindowWidth_;
1033 int fixedWindowHeight_;
1034 int lastWindowWidth_;
1035 int lastWindowHeight_;
1036 bool lastWindowMaximized_;
1038 Fm::SidePane::Mode sidePaneMode_;
1042 Fm::FolderView::ViewMode viewMode_;
1044 Qt::SortOrder sortOrder_;
1045 Fm::FolderModel::ColumnId sortColumn_;
1046 bool sortFolderFirst_;
1047 bool sortCaseSensitive_;
1049 bool pathBarButtons_;
1053 int autoSelectionDelay_;
1055 bool confirmDelete_;
1059 bool selectNewFiles_;
1061 bool showThumbnails_;
1065 bool backupAsHidden_;
1066 bool showFullNames_;
1070 bool placesDesktop_;
1071 bool placesApplications_;
1074 bool placesComputer_;
1075 bool placesNetwork_;
1076 QSet<QString> hiddenPlaces_;
1080 int sidePaneIconSize_;
1081 int thumbnailIconSize_;
1083 bool onlyUserTemplates_;
1084 bool templateTypeOnce_;
1085 bool templateRunApp_;
1087 QSize folderViewCellMargins_;
1088 QSize desktopCellMargins_;
1091 bool searchNameCaseInsensitive_;
1092 bool searchContentCaseInsensitive_;
1093 bool searchNameRegexp_;
1094 bool searchContentRegexp_;
1095 bool searchRecursive_;
1096 bool searchhHidden_;
1099 QList<QVariant> customColumnWidths_;
1100 QList<QVariant> hiddenColumns_;
1105 #endif // NDEFILEMAN_SETTINGS_H Definition: settings.h:42
Definition: settings.h:90
Definition: settings.h:49
Definition: settings.h:170
Definition: application.cpp:67