21 #ifndef PCMANFM_SETTINGS_H 22 #define PCMANFM_SETTINGS_H 26 #include <libfm-qt/folderview.h> 27 #include <libfm-qt/foldermodel.h> 28 #include "desktopwindow.h" 29 #include <libfm-qt/sidepane.h> 30 #include <libfm-qt/core/thumbnailjob.h> 34 enum OpenDirTargetType {
38 OpenInLastActiveWindow
45 sortOrder_(Qt::AscendingOrder),
46 sortColumn_(Fm::FolderModel::ColumnFileName),
47 viewMode_(Fm::FolderView::IconMode),
49 sortFolderFirst_(
true),
50 sortCaseSensitive_(
true) {
53 bool isCustomized()
const {
57 void setCustomized(
bool value) {
58 isCustomized_ = value;
61 Qt::SortOrder sortOrder()
const {
65 void setSortOrder(Qt::SortOrder value) {
69 Fm::FolderModel::ColumnId sortColumn()
const {
73 void setSortColumn(Fm::FolderModel::ColumnId value) {
77 Fm::FolderView::ViewMode viewMode()
const {
81 void setViewMode(Fm::FolderView::ViewMode value) {
85 bool sortFolderFirst()
const {
86 return sortFolderFirst_;
89 void setSortFolderFirst(
bool value) {
90 sortFolderFirst_ = value;
93 bool showHidden()
const {
97 void setShowHidden(
bool value) {
101 bool sortCaseSensitive()
const {
102 return sortCaseSensitive_;
105 void setSortCaseSensitive(
bool value) {
106 sortCaseSensitive_ = value;
111 Qt::SortOrder sortOrder_;
112 Fm::FolderModel::ColumnId sortColumn_;
113 Fm::FolderView::ViewMode viewMode_;
115 bool sortFolderFirst_;
116 bool sortCaseSensitive_;
133 bool load(QString profile =
"default");
134 bool save(QString profile = QString());
136 bool loadFile(QString filePath);
137 bool saveFile(QString filePath);
139 static QString xdgUserConfigDir();
140 static const QList<int> & iconSizes(IconType type);
142 QString profileDir(QString profile,
bool useFallback =
false);
145 QString profileName()
const {
149 bool supportTrash()
const {
150 return supportTrash_;
153 QString fallbackIconThemeName()
const {
154 return fallbackIconThemeName_;
157 bool useFallbackIconTheme()
const {
158 return useFallbackIconTheme_;
161 void setFallbackIconThemeName(QString iconThemeName) {
162 fallbackIconThemeName_ = iconThemeName;
165 OpenDirTargetType bookmarkOpenMethod() {
166 return bookmarkOpenMethod_;
169 void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
170 bookmarkOpenMethod_ = bookmarkOpenMethod;
173 QString suCommand()
const {
177 void setSuCommand(QString suCommand) {
178 suCommand_ = suCommand;
184 void setTerminal(QString terminalCommand);
186 QString archiver()
const {
190 void setArchiver(QString archiver) {
191 archiver_ = archiver;
193 g_free(fm_config->archiver);
194 fm_config->archiver = g_strdup(archiver_.toLocal8Bit().constData());
197 bool mountOnStartup()
const {
198 return mountOnStartup_;
201 void setMountOnStartup(
bool mountOnStartup) {
202 mountOnStartup_ = mountOnStartup;
205 bool mountRemovable() {
206 return mountRemovable_;
209 void setMountRemovable(
bool mountRemovable) {
210 mountRemovable_ = mountRemovable;
213 bool autoRun()
const {
217 void setAutoRun(
bool autoRun) {
221 bool closeOnUnmount()
const {
222 return closeOnUnmount_;
225 void setCloseOnUnmount(
bool value) {
226 closeOnUnmount_ = value;
229 DesktopWindow::WallpaperMode wallpaperMode()
const {
230 return DesktopWindow::WallpaperMode(wallpaperMode_);
233 void setWallpaperMode(
int wallpaperMode) {
234 wallpaperMode_ = wallpaperMode;
237 QString wallpaper()
const {
241 void setWallpaper(QString wallpaper) {
242 wallpaper_ = wallpaper;
245 QString wallpaperDir()
const {
246 return wallpaperDir_;
249 void setLastSlide(QString wallpaper) {
250 lastSlide_ = wallpaper;
253 QString lastSlide()
const {
257 void setWallpaperDir(QString dir) {
261 int slideShowInterval()
const {
262 return slideShowInterval_;
265 void setSlideShowInterval(
int interval) {
266 slideShowInterval_ = interval;
269 bool wallpaperRandomize()
const {
270 return wallpaperRandomize_;
273 void setWallpaperRandomize(
bool randomize) {
274 wallpaperRandomize_ = randomize;
277 const QColor& desktopBgColor()
const {
278 return desktopBgColor_;
281 void setDesktopBgColor(QColor desktopBgColor) {
282 desktopBgColor_ = desktopBgColor;
285 const QColor& desktopFgColor()
const {
286 return desktopFgColor_;
289 void setDesktopFgColor(QColor desktopFgColor) {
290 desktopFgColor_ = desktopFgColor;
293 const QColor& desktopShadowColor()
const {
294 return desktopShadowColor_;
297 void setDesktopShadowColor(QColor desktopShadowColor) {
298 desktopShadowColor_ = desktopShadowColor;
301 QFont desktopFont()
const {
305 void setDesktopFont(QFont font) {
309 int desktopIconSize()
const {
310 return desktopIconSize_;
313 void setDesktopIconSize(
int desktopIconSize) {
314 desktopIconSize_ = desktopIconSize;
317 bool showWmMenu()
const {
321 void setShowWmMenu(
bool value) {
325 bool desktopShowHidden()
const {
326 return desktopShowHidden_;
329 void setDesktopShowHidden(
bool desktopShowHidden) {
330 desktopShowHidden_ = desktopShowHidden;
333 Qt::SortOrder desktopSortOrder()
const {
334 return desktopSortOrder_;
337 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
338 desktopSortOrder_ = desktopSortOrder;
341 Fm::FolderModel::ColumnId desktopSortColumn()
const {
342 return desktopSortColumn_;
345 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
346 desktopSortColumn_ = desktopSortColumn;
349 bool desktopSortFolderFirst()
const {
350 return desktopSortFolderFirst_;
353 void setSesktopSortFolderFirst(
bool desktopFolderFirst) {
354 desktopSortFolderFirst_ = desktopFolderFirst;
357 bool alwaysShowTabs()
const {
358 return alwaysShowTabs_;
361 void setAlwaysShowTabs(
bool alwaysShowTabs) {
362 alwaysShowTabs_ = alwaysShowTabs;
365 bool showTabClose()
const {
366 return showTabClose_;
369 void setShowTabClose(
bool showTabClose) {
370 showTabClose_ = showTabClose;
373 bool rememberWindowSize()
const {
374 return rememberWindowSize_;
377 void setRememberWindowSize(
bool rememberWindowSize) {
378 rememberWindowSize_ = rememberWindowSize;
381 int windowWidth()
const {
382 if(rememberWindowSize_) {
383 return lastWindowWidth_;
386 return fixedWindowWidth_;
390 int windowHeight()
const {
391 if(rememberWindowSize_) {
392 return lastWindowHeight_;
395 return fixedWindowHeight_;
399 bool windowMaximized()
const {
400 if(rememberWindowSize_) {
401 return lastWindowMaximized_;
408 int fixedWindowWidth()
const {
409 return fixedWindowWidth_;
412 void setFixedWindowWidth(
int fixedWindowWidth) {
413 fixedWindowWidth_ = fixedWindowWidth;
416 int fixedWindowHeight()
const {
417 return fixedWindowHeight_;
420 void setFixedWindowHeight(
int fixedWindowHeight) {
421 fixedWindowHeight_ = fixedWindowHeight;
424 void setLastWindowWidth(
int lastWindowWidth) {
425 lastWindowWidth_ = lastWindowWidth;
428 void setLastWindowHeight(
int lastWindowHeight) {
429 lastWindowHeight_ = lastWindowHeight;
432 void setLastWindowMaximized(
bool lastWindowMaximized) {
433 lastWindowMaximized_ = lastWindowMaximized;
436 int splitterPos()
const {
440 void setSplitterPos(
int splitterPos) {
441 splitterPos_ = splitterPos;
444 Fm::SidePane::Mode sidePaneMode()
const {
445 return sidePaneMode_;
448 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
449 sidePaneMode_ = sidePaneMode;
452 bool showMenuBar()
const {
456 void setShowMenuBar(
bool showMenuBar) {
457 showMenuBar_ = showMenuBar;
460 bool fullWidthTabBar()
const {
461 return fullWidthTabBar_;
464 void setFullWidthTabBar(
bool fullWith) {
465 fullWidthTabBar_ = fullWith;
468 Fm::FolderView::ViewMode viewMode()
const {
472 void setViewMode(Fm::FolderView::ViewMode viewMode) {
473 viewMode_ = viewMode;
476 bool showHidden()
const {
480 void setShowHidden(
bool showHidden) {
481 showHidden_ = showHidden;
484 bool sortCaseSensitive()
const {
485 return sortCaseSensitive_;
488 void setSortCaseSensitive(
bool value) {
489 sortCaseSensitive_ = value;
493 bool placesHome()
const {
497 void setPlacesHome(
bool placesHome) {
498 placesHome_ = placesHome;
501 bool placesDesktop()
const {
502 return placesDesktop_;
505 void setPlacesDesktop(
bool placesDesktop) {
506 placesDesktop_ = placesDesktop;
509 bool placesApplications()
const {
510 return placesApplications_;
513 void setPlacesApplications(
bool placesApplications) {
514 placesApplications_ = placesApplications;
517 bool placesTrash()
const {
521 void setPlacesTrash(
bool placesTrash) {
522 placesTrash_ = placesTrash;
525 bool placesRoot()
const {
529 void setPlacesRoot(
bool placesRoot) {
530 placesRoot_ = placesRoot;
533 bool placesComputer()
const {
534 return placesComputer_;
537 void setPlacesComputer(
bool placesComputer) {
538 placesComputer_ = placesComputer;
541 bool placesNetwork()
const {
542 return placesNetwork_;
545 void setPlacesNetwork(
bool placesNetwork) {
546 placesNetwork_ = placesNetwork;
550 Qt::SortOrder sortOrder()
const {
554 void setSortOrder(Qt::SortOrder sortOrder) {
555 sortOrder_ = sortOrder;
558 Fm::FolderModel::ColumnId sortColumn()
const {
562 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
563 sortColumn_ = sortColumn;
566 bool sortFolderFirst()
const {
567 return sortFolderFirst_;
570 void setSortFolderFirst(
bool folderFirst) {
571 sortFolderFirst_ = folderFirst;
574 bool showFilter()
const {
578 void setShowFilter(
bool value) {
582 bool pathBarButtons()
const {
583 return pathBarButtons_;
586 void setPathBarButtons(
bool value) {
587 pathBarButtons_ = value;
591 bool singleClick()
const {
595 void setSingleClick(
bool singleClick) {
596 singleClick_ = singleClick;
599 int autoSelectionDelay()
const {
600 return autoSelectionDelay_;
603 void setAutoSelectionDelay(
int value) {
604 autoSelectionDelay_ = value;
607 bool useTrash()
const {
614 void setUseTrash(
bool useTrash) {
615 useTrash_ = useTrash;
618 bool confirmDelete()
const {
619 return confirmDelete_;
622 void setConfirmDelete(
bool confirmDelete) {
623 confirmDelete_ = confirmDelete;
626 bool noUsbTrash()
const {
630 void setNoUsbTrash(
bool noUsbTrash) {
631 noUsbTrash_ = noUsbTrash;
632 fm_config->no_usb_trash = noUsbTrash_;
635 bool confirmTrash()
const {
636 return confirmTrash_;
639 void setConfirmTrash(
bool value) {
640 confirmTrash_ = value;
643 bool quickExec()
const {
647 void setQuickExec(
bool value) {
649 fm_config->quick_exec = quickExec_;
655 int bigIconSize()
const {
659 void setBigIconSize(
int bigIconSize) {
660 bigIconSize_ = bigIconSize;
663 int smallIconSize()
const {
664 return smallIconSize_;
667 void setSmallIconSize(
int smallIconSize) {
668 smallIconSize_ = smallIconSize;
671 int sidePaneIconSize()
const {
672 return sidePaneIconSize_;
675 void setSidePaneIconSize(
int sidePaneIconSize) {
676 sidePaneIconSize_ = sidePaneIconSize;
679 int thumbnailIconSize()
const {
680 return thumbnailIconSize_;
683 QSize folderViewCellMargins()
const {
684 return folderViewCellMargins_;
687 void setFolderViewCellMargins(QSize size) {
688 folderViewCellMargins_ = size;
691 QSize desktopCellMargins()
const {
692 return desktopCellMargins_;
695 void setDesktopCellMargins(QSize size) {
696 desktopCellMargins_ = size;
700 bool showThumbnails() {
701 return showThumbnails_;
704 void setShowThumbnails(
bool show) {
705 showThumbnails_ = show;
708 void setThumbnailLocalFilesOnly(
bool value) {
709 Fm::ThumbnailJob::setLocalFilesOnly(value);
712 bool thumbnailLocalFilesOnly()
const {
713 return Fm::ThumbnailJob::localFilesOnly();
716 int maxThumbnailFileSize()
const {
717 return Fm::ThumbnailJob::maxThumbnailFileSize();
720 void setMaxThumbnailFileSize(
int size) {
721 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
724 void setThumbnailIconSize(
int thumbnailIconSize) {
725 thumbnailIconSize_ = thumbnailIconSize;
732 void setSiUnit(
bool siUnit) {
735 fm_config->si_unit = (gboolean)siUnit_;
738 bool backupAsHidden()
const {
739 return backupAsHidden_;
742 void setBackupAsHidden(
bool value) {
743 backupAsHidden_ = value;
744 fm_config->backup_as_hidden = backupAsHidden_;
747 bool showFullNames()
const {
748 return showFullNames_;
751 void setShowFullNames(
bool value) {
752 showFullNames_ = value;
755 bool shadowHidden()
const {
756 return shadowHidden_;
759 void setShadowHidden(
bool value) {
760 shadowHidden_ = value;
763 bool onlyUserTemplates()
const {
764 return onlyUserTemplates_;
767 void setOnlyUserTemplates(
bool value) {
768 onlyUserTemplates_ = value;
769 fm_config->only_user_templates = onlyUserTemplates_;
772 bool templateTypeOnce()
const {
773 return templateTypeOnce_;
776 void setTemplateTypeOnce(
bool value) {
777 templateTypeOnce_ = value;
778 fm_config->template_type_once = templateTypeOnce_;
781 bool templateRunApp()
const {
782 return templateRunApp_;
785 void setTemplateRunApp(
bool value) {
786 templateRunApp_ = value;
787 fm_config->template_run_app = templateRunApp_;
791 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
793 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
795 void clearFolderSettings(
const Fm::FilePath& path)
const;
797 bool searchNameCaseInsensitive()
const {
798 return searchNameCaseInsensitive_;
801 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
802 searchNameCaseInsensitive_ = caseInsensitive;
805 bool searchContentCaseInsensitive()
const {
806 return searchContentCaseInsensitive_;
809 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
810 searchContentCaseInsensitive_ = caseInsensitive;
813 bool searchNameRegexp()
const {
814 return searchNameRegexp_;
817 void setSearchNameRegexp(
bool reg) {
818 searchNameRegexp_ = reg;
821 bool searchContentRegexp()
const {
822 return searchContentRegexp_;
825 void setSearchContentRegexp(
bool reg) {
826 searchContentRegexp_ = reg;
829 bool searchRecursive()
const {
830 return searchRecursive_;
833 void setSearchRecursive(
bool rec) {
834 searchRecursive_ = rec;
837 bool searchhHidden()
const {
838 return searchhHidden_;
841 void setSearchhHidden(
bool hidden) {
842 searchhHidden_ = hidden;
846 int toIconSize(
int size, IconType type)
const;
848 QString profileName_;
852 QString fallbackIconThemeName_;
853 bool useFallbackIconTheme_;
855 OpenDirTargetType bookmarkOpenMethod_;
858 bool mountOnStartup_;
859 bool mountRemovable_;
861 bool closeOnUnmount_;
866 QString wallpaperDir_;
867 int slideShowInterval_;
868 bool wallpaperRandomize_;
869 QColor desktopBgColor_;
870 QColor desktopFgColor_;
871 QColor desktopShadowColor_;
873 int desktopIconSize_;
876 bool desktopShowHidden_;
877 Qt::SortOrder desktopSortOrder_;
878 Fm::FolderModel::ColumnId desktopSortColumn_;
879 bool desktopSortFolderFirst_;
881 bool alwaysShowTabs_;
883 bool rememberWindowSize_;
884 int fixedWindowWidth_;
885 int fixedWindowHeight_;
886 int lastWindowWidth_;
887 int lastWindowHeight_;
888 bool lastWindowMaximized_;
890 Fm::SidePane::Mode sidePaneMode_;
892 bool fullWidthTabBar_;
894 Fm::FolderView::ViewMode viewMode_;
896 Qt::SortOrder sortOrder_;
897 Fm::FolderModel::ColumnId sortColumn_;
898 bool sortFolderFirst_;
899 bool sortCaseSensitive_;
901 bool pathBarButtons_;
905 int autoSelectionDelay_;
912 bool showThumbnails_;
916 bool backupAsHidden_;
922 bool placesApplications_;
925 bool placesComputer_;
930 int sidePaneIconSize_;
931 int thumbnailIconSize_;
933 bool onlyUserTemplates_;
934 bool templateTypeOnce_;
935 bool templateRunApp_;
937 QSize folderViewCellMargins_;
938 QSize desktopCellMargins_;
941 bool searchNameCaseInsensitive_;
942 bool searchContentCaseInsensitive_;
943 bool searchNameRegexp_;
944 bool searchContentRegexp_;
945 bool searchRecursive_;
951 #endif // PCMANFM_SETTINGS_H Definition: settings.h:121
Definition: application.cpp:59
Definition: settings.h:41