21 #ifndef PCMANFM_SETTINGS_H 22 #define PCMANFM_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
46 sortOrder_(Qt::AscendingOrder),
47 sortColumn_(Fm::FolderModel::ColumnFileName),
48 viewMode_(Fm::FolderView::IconMode),
50 sortFolderFirst_(
true),
51 sortCaseSensitive_(
true) {
54 bool isCustomized()
const {
58 void setCustomized(
bool value) {
59 isCustomized_ = value;
62 Qt::SortOrder sortOrder()
const {
66 void setSortOrder(Qt::SortOrder value) {
70 Fm::FolderModel::ColumnId sortColumn()
const {
74 void setSortColumn(Fm::FolderModel::ColumnId value) {
78 Fm::FolderView::ViewMode viewMode()
const {
82 void setViewMode(Fm::FolderView::ViewMode value) {
86 bool sortFolderFirst()
const {
87 return sortFolderFirst_;
90 void setSortFolderFirst(
bool value) {
91 sortFolderFirst_ = value;
94 bool showHidden()
const {
98 void setShowHidden(
bool value) {
102 bool sortCaseSensitive()
const {
103 return sortCaseSensitive_;
106 void setSortCaseSensitive(
bool value) {
107 sortCaseSensitive_ = value;
112 Qt::SortOrder sortOrder_;
113 Fm::FolderModel::ColumnId sortColumn_;
114 Fm::FolderView::ViewMode viewMode_;
116 bool sortFolderFirst_;
117 bool sortCaseSensitive_;
134 bool load(QString profile =
"default");
135 bool save(QString profile = QString());
137 bool loadFile(QString filePath);
138 bool saveFile(QString filePath);
140 static QString xdgUserConfigDir();
141 static const QList<int> & iconSizes(IconType type);
143 QString profileDir(QString profile,
bool useFallback =
false);
146 QString profileName()
const {
150 bool supportTrash()
const {
151 return supportTrash_;
154 QString fallbackIconThemeName()
const {
155 return fallbackIconThemeName_;
158 bool useFallbackIconTheme()
const {
159 return useFallbackIconTheme_;
162 void setFallbackIconThemeName(QString iconThemeName) {
163 fallbackIconThemeName_ = iconThemeName;
166 OpenDirTargetType bookmarkOpenMethod() {
167 return bookmarkOpenMethod_;
170 void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
171 bookmarkOpenMethod_ = bookmarkOpenMethod;
174 QString suCommand()
const {
178 void setSuCommand(QString suCommand) {
179 suCommand_ = suCommand;
185 void setTerminal(QString terminalCommand);
187 QString archiver()
const {
191 void setArchiver(QString archiver) {
192 archiver_ = archiver;
193 Fm::Archiver::setDefaultArchiverByName(archiver_.toLocal8Bit().constData());
196 bool mountOnStartup()
const {
197 return mountOnStartup_;
200 void setMountOnStartup(
bool mountOnStartup) {
201 mountOnStartup_ = mountOnStartup;
204 bool mountRemovable() {
205 return mountRemovable_;
208 void setMountRemovable(
bool mountRemovable) {
209 mountRemovable_ = mountRemovable;
212 bool autoRun()
const {
216 void setAutoRun(
bool autoRun) {
220 bool closeOnUnmount()
const {
221 return closeOnUnmount_;
224 void setCloseOnUnmount(
bool value) {
225 closeOnUnmount_ = value;
228 DesktopWindow::WallpaperMode wallpaperMode()
const {
229 return DesktopWindow::WallpaperMode(wallpaperMode_);
232 void setWallpaperMode(
int wallpaperMode) {
233 wallpaperMode_ = wallpaperMode;
236 QString wallpaper()
const {
240 void setWallpaper(QString wallpaper) {
241 wallpaper_ = wallpaper;
244 QString wallpaperDir()
const {
245 return wallpaperDir_;
248 void setLastSlide(QString wallpaper) {
249 lastSlide_ = wallpaper;
252 QString lastSlide()
const {
256 void setWallpaperDir(QString dir) {
260 int slideShowInterval()
const {
261 return slideShowInterval_;
264 void setSlideShowInterval(
int interval) {
265 slideShowInterval_ = interval;
268 bool wallpaperRandomize()
const {
269 return wallpaperRandomize_;
272 void setWallpaperRandomize(
bool randomize) {
273 wallpaperRandomize_ = randomize;
276 const QColor& desktopBgColor()
const {
277 return desktopBgColor_;
280 void setDesktopBgColor(QColor desktopBgColor) {
281 desktopBgColor_ = desktopBgColor;
284 const QColor& desktopFgColor()
const {
285 return desktopFgColor_;
288 void setDesktopFgColor(QColor desktopFgColor) {
289 desktopFgColor_ = desktopFgColor;
292 const QColor& desktopShadowColor()
const {
293 return desktopShadowColor_;
296 void setDesktopShadowColor(QColor desktopShadowColor) {
297 desktopShadowColor_ = desktopShadowColor;
300 QFont desktopFont()
const {
304 void setDesktopFont(QFont font) {
308 int desktopIconSize()
const {
309 return desktopIconSize_;
312 void setDesktopIconSize(
int desktopIconSize) {
313 desktopIconSize_ = desktopIconSize;
316 QStringList desktopShortcuts()
const {
317 return desktopShortcuts_;
320 void setDesktopShortcuts(
const QStringList& list) {
321 desktopShortcuts_ = list;
324 bool showWmMenu()
const {
328 void setShowWmMenu(
bool value) {
332 bool desktopShowHidden()
const {
333 return desktopShowHidden_;
336 void setDesktopShowHidden(
bool desktopShowHidden) {
337 desktopShowHidden_ = desktopShowHidden;
340 bool desktopHideItems()
const {
341 return desktopHideItems_;
344 void setDesktopHideItems(
bool hide) {
345 desktopHideItems_ = hide;
348 Qt::SortOrder desktopSortOrder()
const {
349 return desktopSortOrder_;
352 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
353 desktopSortOrder_ = desktopSortOrder;
356 Fm::FolderModel::ColumnId desktopSortColumn()
const {
357 return desktopSortColumn_;
360 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
361 desktopSortColumn_ = desktopSortColumn;
364 bool desktopSortFolderFirst()
const {
365 return desktopSortFolderFirst_;
368 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
369 desktopSortFolderFirst_ = desktopFolderFirst;
372 bool alwaysShowTabs()
const {
373 return alwaysShowTabs_;
376 void setAlwaysShowTabs(
bool alwaysShowTabs) {
377 alwaysShowTabs_ = alwaysShowTabs;
380 bool showTabClose()
const {
381 return showTabClose_;
384 void setShowTabClose(
bool showTabClose) {
385 showTabClose_ = showTabClose;
388 bool rememberWindowSize()
const {
389 return rememberWindowSize_;
392 void setRememberWindowSize(
bool rememberWindowSize) {
393 rememberWindowSize_ = rememberWindowSize;
396 int windowWidth()
const {
397 if(rememberWindowSize_) {
398 return lastWindowWidth_;
401 return fixedWindowWidth_;
405 int windowHeight()
const {
406 if(rememberWindowSize_) {
407 return lastWindowHeight_;
410 return fixedWindowHeight_;
414 bool windowMaximized()
const {
415 if(rememberWindowSize_) {
416 return lastWindowMaximized_;
423 int fixedWindowWidth()
const {
424 return fixedWindowWidth_;
427 void setFixedWindowWidth(
int fixedWindowWidth) {
428 fixedWindowWidth_ = fixedWindowWidth;
431 int fixedWindowHeight()
const {
432 return fixedWindowHeight_;
435 void setFixedWindowHeight(
int fixedWindowHeight) {
436 fixedWindowHeight_ = fixedWindowHeight;
439 void setLastWindowWidth(
int lastWindowWidth) {
440 lastWindowWidth_ = lastWindowWidth;
443 void setLastWindowHeight(
int lastWindowHeight) {
444 lastWindowHeight_ = lastWindowHeight;
447 void setLastWindowMaximized(
bool lastWindowMaximized) {
448 lastWindowMaximized_ = lastWindowMaximized;
451 int splitterPos()
const {
455 void setSplitterPos(
int splitterPos) {
456 splitterPos_ = splitterPos;
459 Fm::SidePane::Mode sidePaneMode()
const {
460 return sidePaneMode_;
463 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
464 sidePaneMode_ = sidePaneMode;
467 bool showMenuBar()
const {
471 void setShowMenuBar(
bool showMenuBar) {
472 showMenuBar_ = showMenuBar;
475 bool splitView()
const {
479 void setSplitView(
bool split) {
483 Fm::FolderView::ViewMode viewMode()
const {
487 void setViewMode(Fm::FolderView::ViewMode viewMode) {
488 viewMode_ = viewMode;
491 bool showHidden()
const {
495 void setShowHidden(
bool showHidden) {
496 showHidden_ = showHidden;
499 bool sortCaseSensitive()
const {
500 return sortCaseSensitive_;
503 void setSortCaseSensitive(
bool value) {
504 sortCaseSensitive_ = value;
508 bool placesHome()
const {
512 void setPlacesHome(
bool placesHome) {
513 placesHome_ = placesHome;
516 bool placesDesktop()
const {
517 return placesDesktop_;
520 void setPlacesDesktop(
bool placesDesktop) {
521 placesDesktop_ = placesDesktop;
524 bool placesApplications()
const {
525 return placesApplications_;
528 void setPlacesApplications(
bool placesApplications) {
529 placesApplications_ = placesApplications;
532 bool placesTrash()
const {
536 void setPlacesTrash(
bool placesTrash) {
537 placesTrash_ = placesTrash;
540 bool placesRoot()
const {
544 void setPlacesRoot(
bool placesRoot) {
545 placesRoot_ = placesRoot;
548 bool placesComputer()
const {
549 return placesComputer_;
552 void setPlacesComputer(
bool placesComputer) {
553 placesComputer_ = placesComputer;
556 bool placesNetwork()
const {
557 return placesNetwork_;
560 void setPlacesNetwork(
bool placesNetwork) {
561 placesNetwork_ = placesNetwork;
564 QSet<QString> getHiddenPlaces()
const {
565 return hiddenPlaces_;
568 void setHiddenPlace(
const QString& str,
bool hide) {
570 hiddenPlaces_ << str;
573 hiddenPlaces_.remove(str);
578 Qt::SortOrder sortOrder()
const {
582 void setSortOrder(Qt::SortOrder sortOrder) {
583 sortOrder_ = sortOrder;
586 Fm::FolderModel::ColumnId sortColumn()
const {
590 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
591 sortColumn_ = sortColumn;
594 bool sortFolderFirst()
const {
595 return sortFolderFirst_;
598 void setSortFolderFirst(
bool folderFirst) {
599 sortFolderFirst_ = folderFirst;
602 bool showFilter()
const {
606 void setShowFilter(
bool value) {
610 bool pathBarButtons()
const {
611 return pathBarButtons_;
614 void setPathBarButtons(
bool value) {
615 pathBarButtons_ = value;
619 bool singleClick()
const {
623 void setSingleClick(
bool singleClick) {
624 singleClick_ = singleClick;
627 int autoSelectionDelay()
const {
628 return autoSelectionDelay_;
631 void setAutoSelectionDelay(
int value) {
632 autoSelectionDelay_ = value;
635 bool useTrash()
const {
642 void setUseTrash(
bool useTrash) {
643 useTrash_ = useTrash;
646 bool confirmDelete()
const {
647 return confirmDelete_;
650 void setConfirmDelete(
bool confirmDelete) {
651 confirmDelete_ = confirmDelete;
654 bool noUsbTrash()
const {
658 void setNoUsbTrash(
bool noUsbTrash) {
659 noUsbTrash_ = noUsbTrash;
660 fm_config->no_usb_trash = noUsbTrash_;
663 bool confirmTrash()
const {
664 return confirmTrash_;
667 void setConfirmTrash(
bool value) {
668 confirmTrash_ = value;
671 bool quickExec()
const {
675 void setQuickExec(
bool value) {
677 fm_config->quick_exec = quickExec_;
680 bool selectNewFiles()
const {
681 return selectNewFiles_;
684 void setSelectNewFiles(
bool value) {
685 selectNewFiles_ = value;
691 int bigIconSize()
const {
695 void setBigIconSize(
int bigIconSize) {
696 bigIconSize_ = bigIconSize;
699 int smallIconSize()
const {
700 return smallIconSize_;
703 void setSmallIconSize(
int smallIconSize) {
704 smallIconSize_ = smallIconSize;
707 int sidePaneIconSize()
const {
708 return sidePaneIconSize_;
711 void setSidePaneIconSize(
int sidePaneIconSize) {
712 sidePaneIconSize_ = sidePaneIconSize;
715 int thumbnailIconSize()
const {
716 return thumbnailIconSize_;
719 QSize folderViewCellMargins()
const {
720 return folderViewCellMargins_;
723 void setFolderViewCellMargins(QSize size) {
724 folderViewCellMargins_ = size;
727 QSize desktopCellMargins()
const {
728 return desktopCellMargins_;
731 void setDesktopCellMargins(QSize size) {
732 desktopCellMargins_ = size;
736 bool showThumbnails() {
737 return showThumbnails_;
740 void setShowThumbnails(
bool show) {
741 showThumbnails_ = show;
744 void setThumbnailLocalFilesOnly(
bool value) {
745 Fm::ThumbnailJob::setLocalFilesOnly(value);
748 bool thumbnailLocalFilesOnly()
const {
749 return Fm::ThumbnailJob::localFilesOnly();
752 int maxThumbnailFileSize()
const {
753 return Fm::ThumbnailJob::maxThumbnailFileSize();
756 void setMaxThumbnailFileSize(
int size) {
757 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
760 void setThumbnailIconSize(
int thumbnailIconSize) {
761 thumbnailIconSize_ = thumbnailIconSize;
768 void setSiUnit(
bool siUnit) {
771 fm_config->si_unit = (gboolean)siUnit_;
774 bool backupAsHidden()
const {
775 return backupAsHidden_;
778 void setBackupAsHidden(
bool value) {
779 backupAsHidden_ = value;
780 fm_config->backup_as_hidden = backupAsHidden_;
783 bool showFullNames()
const {
784 return showFullNames_;
787 void setShowFullNames(
bool value) {
788 showFullNames_ = value;
791 bool shadowHidden()
const {
792 return shadowHidden_;
795 void setShadowHidden(
bool value) {
796 shadowHidden_ = value;
799 bool onlyUserTemplates()
const {
800 return onlyUserTemplates_;
803 void setOnlyUserTemplates(
bool value) {
804 onlyUserTemplates_ = value;
805 fm_config->only_user_templates = onlyUserTemplates_;
808 bool templateTypeOnce()
const {
809 return templateTypeOnce_;
812 void setTemplateTypeOnce(
bool value) {
813 templateTypeOnce_ = value;
814 fm_config->template_type_once = templateTypeOnce_;
817 bool templateRunApp()
const {
818 return templateRunApp_;
821 void setTemplateRunApp(
bool value) {
822 templateRunApp_ = value;
823 fm_config->template_run_app = templateRunApp_;
827 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
829 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
831 void clearFolderSettings(
const Fm::FilePath& path)
const;
833 bool searchNameCaseInsensitive()
const {
834 return searchNameCaseInsensitive_;
837 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
838 searchNameCaseInsensitive_ = caseInsensitive;
841 bool searchContentCaseInsensitive()
const {
842 return searchContentCaseInsensitive_;
845 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
846 searchContentCaseInsensitive_ = caseInsensitive;
849 bool searchNameRegexp()
const {
850 return searchNameRegexp_;
853 void setSearchNameRegexp(
bool reg) {
854 searchNameRegexp_ = reg;
857 bool searchContentRegexp()
const {
858 return searchContentRegexp_;
861 void setSearchContentRegexp(
bool reg) {
862 searchContentRegexp_ = reg;
865 bool searchRecursive()
const {
866 return searchRecursive_;
869 void setSearchRecursive(
bool rec) {
870 searchRecursive_ = rec;
873 bool searchhHidden()
const {
874 return searchhHidden_;
877 void setSearchhHidden(
bool hidden) {
878 searchhHidden_ = hidden;
882 int toIconSize(
int size, IconType type)
const;
884 QString profileName_;
888 QString fallbackIconThemeName_;
889 bool useFallbackIconTheme_;
891 OpenDirTargetType bookmarkOpenMethod_;
894 bool mountOnStartup_;
895 bool mountRemovable_;
897 bool closeOnUnmount_;
902 QString wallpaperDir_;
903 int slideShowInterval_;
904 bool wallpaperRandomize_;
905 QColor desktopBgColor_;
906 QColor desktopFgColor_;
907 QColor desktopShadowColor_;
909 int desktopIconSize_;
910 QStringList desktopShortcuts_;
913 bool desktopShowHidden_;
914 bool desktopHideItems_;
915 Qt::SortOrder desktopSortOrder_;
916 Fm::FolderModel::ColumnId desktopSortColumn_;
917 bool desktopSortFolderFirst_;
919 bool alwaysShowTabs_;
921 bool rememberWindowSize_;
922 int fixedWindowWidth_;
923 int fixedWindowHeight_;
924 int lastWindowWidth_;
925 int lastWindowHeight_;
926 bool lastWindowMaximized_;
928 Fm::SidePane::Mode sidePaneMode_;
932 Fm::FolderView::ViewMode viewMode_;
934 Qt::SortOrder sortOrder_;
935 Fm::FolderModel::ColumnId sortColumn_;
936 bool sortFolderFirst_;
937 bool sortCaseSensitive_;
939 bool pathBarButtons_;
943 int autoSelectionDelay_;
949 bool selectNewFiles_;
951 bool showThumbnails_;
955 bool backupAsHidden_;
961 bool placesApplications_;
964 bool placesComputer_;
966 QSet<QString> hiddenPlaces_;
970 int sidePaneIconSize_;
971 int thumbnailIconSize_;
973 bool onlyUserTemplates_;
974 bool templateTypeOnce_;
975 bool templateRunApp_;
977 QSize folderViewCellMargins_;
978 QSize desktopCellMargins_;
981 bool searchNameCaseInsensitive_;
982 bool searchContentCaseInsensitive_;
983 bool searchNameRegexp_;
984 bool searchContentRegexp_;
985 bool searchRecursive_;
991 #endif // PCMANFM_SETTINGS_H Definition: settings.h:122
Definition: settings.h:42