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> 31 #include <libfm-qt/core/archiver.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 bool showWmMenu()
const {
320 void setShowWmMenu(
bool value) {
324 bool desktopShowHidden()
const {
325 return desktopShowHidden_;
328 void setDesktopShowHidden(
bool desktopShowHidden) {
329 desktopShowHidden_ = desktopShowHidden;
332 bool desktopHideItems()
const {
333 return desktopHideItems_;
336 void setDesktopHideItems(
bool hide) {
337 desktopHideItems_ = hide;
340 Qt::SortOrder desktopSortOrder()
const {
341 return desktopSortOrder_;
344 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
345 desktopSortOrder_ = desktopSortOrder;
348 Fm::FolderModel::ColumnId desktopSortColumn()
const {
349 return desktopSortColumn_;
352 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
353 desktopSortColumn_ = desktopSortColumn;
356 bool desktopSortFolderFirst()
const {
357 return desktopSortFolderFirst_;
360 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
361 desktopSortFolderFirst_ = desktopFolderFirst;
364 bool alwaysShowTabs()
const {
365 return alwaysShowTabs_;
368 void setAlwaysShowTabs(
bool alwaysShowTabs) {
369 alwaysShowTabs_ = alwaysShowTabs;
372 bool showTabClose()
const {
373 return showTabClose_;
376 void setShowTabClose(
bool showTabClose) {
377 showTabClose_ = showTabClose;
380 bool rememberWindowSize()
const {
381 return rememberWindowSize_;
384 void setRememberWindowSize(
bool rememberWindowSize) {
385 rememberWindowSize_ = rememberWindowSize;
388 int windowWidth()
const {
389 if(rememberWindowSize_) {
390 return lastWindowWidth_;
393 return fixedWindowWidth_;
397 int windowHeight()
const {
398 if(rememberWindowSize_) {
399 return lastWindowHeight_;
402 return fixedWindowHeight_;
406 bool windowMaximized()
const {
407 if(rememberWindowSize_) {
408 return lastWindowMaximized_;
415 int fixedWindowWidth()
const {
416 return fixedWindowWidth_;
419 void setFixedWindowWidth(
int fixedWindowWidth) {
420 fixedWindowWidth_ = fixedWindowWidth;
423 int fixedWindowHeight()
const {
424 return fixedWindowHeight_;
427 void setFixedWindowHeight(
int fixedWindowHeight) {
428 fixedWindowHeight_ = fixedWindowHeight;
431 void setLastWindowWidth(
int lastWindowWidth) {
432 lastWindowWidth_ = lastWindowWidth;
435 void setLastWindowHeight(
int lastWindowHeight) {
436 lastWindowHeight_ = lastWindowHeight;
439 void setLastWindowMaximized(
bool lastWindowMaximized) {
440 lastWindowMaximized_ = lastWindowMaximized;
443 int splitterPos()
const {
447 void setSplitterPos(
int splitterPos) {
448 splitterPos_ = splitterPos;
451 Fm::SidePane::Mode sidePaneMode()
const {
452 return sidePaneMode_;
455 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
456 sidePaneMode_ = sidePaneMode;
459 bool showMenuBar()
const {
463 void setShowMenuBar(
bool showMenuBar) {
464 showMenuBar_ = showMenuBar;
467 bool fullWidthTabBar()
const {
468 return fullWidthTabBar_;
471 void setFullWidthTabBar(
bool fullWith) {
472 fullWidthTabBar_ = fullWith;
475 Fm::FolderView::ViewMode viewMode()
const {
479 void setViewMode(Fm::FolderView::ViewMode viewMode) {
480 viewMode_ = viewMode;
483 bool showHidden()
const {
487 void setShowHidden(
bool showHidden) {
488 showHidden_ = showHidden;
491 bool sortCaseSensitive()
const {
492 return sortCaseSensitive_;
495 void setSortCaseSensitive(
bool value) {
496 sortCaseSensitive_ = value;
500 bool placesHome()
const {
504 void setPlacesHome(
bool placesHome) {
505 placesHome_ = placesHome;
508 bool placesDesktop()
const {
509 return placesDesktop_;
512 void setPlacesDesktop(
bool placesDesktop) {
513 placesDesktop_ = placesDesktop;
516 bool placesApplications()
const {
517 return placesApplications_;
520 void setPlacesApplications(
bool placesApplications) {
521 placesApplications_ = placesApplications;
524 bool placesTrash()
const {
528 void setPlacesTrash(
bool placesTrash) {
529 placesTrash_ = placesTrash;
532 bool placesRoot()
const {
536 void setPlacesRoot(
bool placesRoot) {
537 placesRoot_ = placesRoot;
540 bool placesComputer()
const {
541 return placesComputer_;
544 void setPlacesComputer(
bool placesComputer) {
545 placesComputer_ = placesComputer;
548 bool placesNetwork()
const {
549 return placesNetwork_;
552 void setPlacesNetwork(
bool placesNetwork) {
553 placesNetwork_ = placesNetwork;
556 QSet<QString> getHiddenPlaces()
const {
557 return hiddenPlaces_;
560 void setHiddenPlace(
const QString& str,
bool hide) {
562 hiddenPlaces_ << str;
565 hiddenPlaces_.remove(str);
570 Qt::SortOrder sortOrder()
const {
574 void setSortOrder(Qt::SortOrder sortOrder) {
575 sortOrder_ = sortOrder;
578 Fm::FolderModel::ColumnId sortColumn()
const {
582 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
583 sortColumn_ = sortColumn;
586 bool sortFolderFirst()
const {
587 return sortFolderFirst_;
590 void setSortFolderFirst(
bool folderFirst) {
591 sortFolderFirst_ = folderFirst;
594 bool showFilter()
const {
598 void setShowFilter(
bool value) {
602 bool pathBarButtons()
const {
603 return pathBarButtons_;
606 void setPathBarButtons(
bool value) {
607 pathBarButtons_ = value;
611 bool singleClick()
const {
615 void setSingleClick(
bool singleClick) {
616 singleClick_ = singleClick;
619 int autoSelectionDelay()
const {
620 return autoSelectionDelay_;
623 void setAutoSelectionDelay(
int value) {
624 autoSelectionDelay_ = value;
627 bool useTrash()
const {
634 void setUseTrash(
bool useTrash) {
635 useTrash_ = useTrash;
638 bool confirmDelete()
const {
639 return confirmDelete_;
642 void setConfirmDelete(
bool confirmDelete) {
643 confirmDelete_ = confirmDelete;
646 bool noUsbTrash()
const {
650 void setNoUsbTrash(
bool noUsbTrash) {
651 noUsbTrash_ = noUsbTrash;
652 fm_config->no_usb_trash = noUsbTrash_;
655 bool confirmTrash()
const {
656 return confirmTrash_;
659 void setConfirmTrash(
bool value) {
660 confirmTrash_ = value;
663 bool quickExec()
const {
667 void setQuickExec(
bool value) {
669 fm_config->quick_exec = quickExec_;
672 bool selectNewFiles()
const {
673 return selectNewFiles_;
676 void setSelectNewFiles(
bool value) {
677 selectNewFiles_ = value;
683 int bigIconSize()
const {
687 void setBigIconSize(
int bigIconSize) {
688 bigIconSize_ = bigIconSize;
691 int smallIconSize()
const {
692 return smallIconSize_;
695 void setSmallIconSize(
int smallIconSize) {
696 smallIconSize_ = smallIconSize;
699 int sidePaneIconSize()
const {
700 return sidePaneIconSize_;
703 void setSidePaneIconSize(
int sidePaneIconSize) {
704 sidePaneIconSize_ = sidePaneIconSize;
707 int thumbnailIconSize()
const {
708 return thumbnailIconSize_;
711 QSize folderViewCellMargins()
const {
712 return folderViewCellMargins_;
715 void setFolderViewCellMargins(QSize size) {
716 folderViewCellMargins_ = size;
719 QSize desktopCellMargins()
const {
720 return desktopCellMargins_;
723 void setDesktopCellMargins(QSize size) {
724 desktopCellMargins_ = size;
728 bool showThumbnails() {
729 return showThumbnails_;
732 void setShowThumbnails(
bool show) {
733 showThumbnails_ = show;
736 void setThumbnailLocalFilesOnly(
bool value) {
737 Fm::ThumbnailJob::setLocalFilesOnly(value);
740 bool thumbnailLocalFilesOnly()
const {
741 return Fm::ThumbnailJob::localFilesOnly();
744 int maxThumbnailFileSize()
const {
745 return Fm::ThumbnailJob::maxThumbnailFileSize();
748 void setMaxThumbnailFileSize(
int size) {
749 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
752 void setThumbnailIconSize(
int thumbnailIconSize) {
753 thumbnailIconSize_ = thumbnailIconSize;
760 void setSiUnit(
bool siUnit) {
763 fm_config->si_unit = (gboolean)siUnit_;
766 bool backupAsHidden()
const {
767 return backupAsHidden_;
770 void setBackupAsHidden(
bool value) {
771 backupAsHidden_ = value;
772 fm_config->backup_as_hidden = backupAsHidden_;
775 bool showFullNames()
const {
776 return showFullNames_;
779 void setShowFullNames(
bool value) {
780 showFullNames_ = value;
783 bool shadowHidden()
const {
784 return shadowHidden_;
787 void setShadowHidden(
bool value) {
788 shadowHidden_ = value;
791 bool onlyUserTemplates()
const {
792 return onlyUserTemplates_;
795 void setOnlyUserTemplates(
bool value) {
796 onlyUserTemplates_ = value;
797 fm_config->only_user_templates = onlyUserTemplates_;
800 bool templateTypeOnce()
const {
801 return templateTypeOnce_;
804 void setTemplateTypeOnce(
bool value) {
805 templateTypeOnce_ = value;
806 fm_config->template_type_once = templateTypeOnce_;
809 bool templateRunApp()
const {
810 return templateRunApp_;
813 void setTemplateRunApp(
bool value) {
814 templateRunApp_ = value;
815 fm_config->template_run_app = templateRunApp_;
819 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
821 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
823 void clearFolderSettings(
const Fm::FilePath& path)
const;
825 bool searchNameCaseInsensitive()
const {
826 return searchNameCaseInsensitive_;
829 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
830 searchNameCaseInsensitive_ = caseInsensitive;
833 bool searchContentCaseInsensitive()
const {
834 return searchContentCaseInsensitive_;
837 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
838 searchContentCaseInsensitive_ = caseInsensitive;
841 bool searchNameRegexp()
const {
842 return searchNameRegexp_;
845 void setSearchNameRegexp(
bool reg) {
846 searchNameRegexp_ = reg;
849 bool searchContentRegexp()
const {
850 return searchContentRegexp_;
853 void setSearchContentRegexp(
bool reg) {
854 searchContentRegexp_ = reg;
857 bool searchRecursive()
const {
858 return searchRecursive_;
861 void setSearchRecursive(
bool rec) {
862 searchRecursive_ = rec;
865 bool searchhHidden()
const {
866 return searchhHidden_;
869 void setSearchhHidden(
bool hidden) {
870 searchhHidden_ = hidden;
874 int toIconSize(
int size, IconType type)
const;
876 QString profileName_;
880 QString fallbackIconThemeName_;
881 bool useFallbackIconTheme_;
883 OpenDirTargetType bookmarkOpenMethod_;
886 bool mountOnStartup_;
887 bool mountRemovable_;
889 bool closeOnUnmount_;
894 QString wallpaperDir_;
895 int slideShowInterval_;
896 bool wallpaperRandomize_;
897 QColor desktopBgColor_;
898 QColor desktopFgColor_;
899 QColor desktopShadowColor_;
901 int desktopIconSize_;
904 bool desktopShowHidden_;
905 bool desktopHideItems_;
906 Qt::SortOrder desktopSortOrder_;
907 Fm::FolderModel::ColumnId desktopSortColumn_;
908 bool desktopSortFolderFirst_;
910 bool alwaysShowTabs_;
912 bool rememberWindowSize_;
913 int fixedWindowWidth_;
914 int fixedWindowHeight_;
915 int lastWindowWidth_;
916 int lastWindowHeight_;
917 bool lastWindowMaximized_;
919 Fm::SidePane::Mode sidePaneMode_;
921 bool fullWidthTabBar_;
923 Fm::FolderView::ViewMode viewMode_;
925 Qt::SortOrder sortOrder_;
926 Fm::FolderModel::ColumnId sortColumn_;
927 bool sortFolderFirst_;
928 bool sortCaseSensitive_;
930 bool pathBarButtons_;
934 int autoSelectionDelay_;
940 bool selectNewFiles_;
942 bool showThumbnails_;
946 bool backupAsHidden_;
952 bool placesApplications_;
955 bool placesComputer_;
957 QSet<QString> hiddenPlaces_;
961 int sidePaneIconSize_;
962 int thumbnailIconSize_;
964 bool onlyUserTemplates_;
965 bool templateTypeOnce_;
966 bool templateRunApp_;
968 QSize folderViewCellMargins_;
969 QSize desktopCellMargins_;
972 bool searchNameCaseInsensitive_;
973 bool searchContentCaseInsensitive_;
974 bool searchNameRegexp_;
975 bool searchContentRegexp_;
976 bool searchRecursive_;
982 #endif // PCMANFM_SETTINGS_H Definition: settings.h:122
Definition: application.cpp:58
Definition: settings.h:42