PCManFM-Qt
settings.h
1 /*
2 
3  Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 
21 #ifndef PCMANFM_SETTINGS_H
22 #define PCMANFM_SETTINGS_H
23 
24 #include <QObject>
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>
32 
33 namespace PCManFM {
34 
35 enum OpenDirTargetType {
36  OpenInCurrentTab,
37  OpenInNewTab,
38  OpenInNewWindow,
39  OpenInLastActiveWindow
40 };
41 
43 public:
45  isCustomized_(false),
46  // NOTE: The default values of the following variables should be
47  // the same as those of their corresponding variables in Settings:
48  sortOrder_(Qt::AscendingOrder),
49  sortColumn_(Fm::FolderModel::ColumnFileName),
50  viewMode_(Fm::FolderView::IconMode),
51  showHidden_(false),
52  sortFolderFirst_(true),
53  sortHiddenLast_(false),
54  sortCaseSensitive_(true) {
55  }
56 
57  bool isCustomized() const {
58  return isCustomized_;
59  }
60 
61  void setCustomized(bool value) {
62  isCustomized_ = value;
63  }
64 
65  Qt::SortOrder sortOrder() const {
66  return sortOrder_;
67  }
68 
69  void setSortOrder(Qt::SortOrder value) {
70  sortOrder_ = value;
71  }
72 
73  Fm::FolderModel::ColumnId sortColumn() const {
74  return sortColumn_;
75  }
76 
77  void setSortColumn(Fm::FolderModel::ColumnId value) {
78  sortColumn_ = value;
79  }
80 
81  Fm::FolderView::ViewMode viewMode() const {
82  return viewMode_;
83  }
84 
85  void setViewMode(Fm::FolderView::ViewMode value) {
86  viewMode_ = value;
87  }
88 
89  bool sortFolderFirst() const {
90  return sortFolderFirst_;
91  }
92 
93  void setSortFolderFirst(bool value) {
94  sortFolderFirst_ = value;
95  }
96 
97  bool sortHiddenLast() const {
98  return sortHiddenLast_;
99  }
100 
101  void setSortHiddenLast(bool value) {
102  sortHiddenLast_ = value;
103  }
104 
105  bool showHidden() const {
106  return showHidden_;
107  }
108 
109  void setShowHidden(bool value) {
110  showHidden_ = value;
111  }
112 
113  bool sortCaseSensitive() const {
114  return sortCaseSensitive_;
115  }
116 
117  void setSortCaseSensitive(bool value) {
118  sortCaseSensitive_ = value;
119  }
120 
121 private:
122  bool isCustomized_;
123  Qt::SortOrder sortOrder_;
124  Fm::FolderModel::ColumnId sortColumn_;
125  Fm::FolderView::ViewMode viewMode_;
126  bool showHidden_;
127  bool sortFolderFirst_;
128  bool sortHiddenLast_;
129  bool sortCaseSensitive_;
130  // columns?
131 };
132 
133 
134 class Settings : public QObject {
135  Q_OBJECT
136 public:
137  enum IconType {
138  Small,
139  Big,
140  Thumbnail
141  };
142 
143  Settings();
144  virtual ~Settings();
145 
146  bool load(QString profile = QStringLiteral("default"));
147  bool save(QString profile = QString());
148 
149  bool loadFile(QString filePath);
150  bool saveFile(QString filePath);
151 
152  static QString xdgUserConfigDir();
153  static const QList<int> & iconSizes(IconType type);
154 
155  QString profileDir(QString profile, bool useFallback = false);
156 
157  // setter/getter functions
158  QString profileName() const {
159  return profileName_;
160  }
161 
162  bool supportTrash() const {
163  return supportTrash_;
164  }
165 
166  QString fallbackIconThemeName() const {
167  return fallbackIconThemeName_;
168  }
169 
170  bool useFallbackIconTheme() const {
171  return useFallbackIconTheme_;
172  }
173 
174  void setFallbackIconThemeName(QString iconThemeName) {
175  fallbackIconThemeName_ = iconThemeName;
176  }
177 
178  bool singleWindowMode() const {
179  return singleWindowMode_;
180  }
181 
182  void setSingleWindowMode(bool singleWindowMode) {
183  singleWindowMode_ = singleWindowMode;
184  }
185 
186  OpenDirTargetType bookmarkOpenMethod() {
187  return bookmarkOpenMethod_;
188  }
189 
190  void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
191  bookmarkOpenMethod_ = bookmarkOpenMethod;
192  }
193 
194  QString suCommand() const {
195  return suCommand_;
196  }
197 
198  void setSuCommand(QString suCommand) {
199  suCommand_ = suCommand;
200  }
201 
202  QString terminal() {
203  return terminal_;
204  }
205  void setTerminal(QString terminalCommand);
206 
207  QString archiver() const {
208  return archiver_;
209  }
210 
211  void setArchiver(QString archiver) {
212  archiver_ = archiver;
213  Fm::Archiver::setDefaultArchiverByName(archiver_.toLocal8Bit().constData());
214  }
215 
216  bool mountOnStartup() const {
217  return mountOnStartup_;
218  }
219 
220  void setMountOnStartup(bool mountOnStartup) {
221  mountOnStartup_ = mountOnStartup;
222  }
223 
224  bool mountRemovable() {
225  return mountRemovable_;
226  }
227 
228  void setMountRemovable(bool mountRemovable) {
229  mountRemovable_ = mountRemovable;
230  }
231 
232  bool autoRun() const {
233  return autoRun_;
234  }
235 
236  void setAutoRun(bool autoRun) {
237  autoRun_ = autoRun;
238  }
239 
240  bool closeOnUnmount() const {
241  return closeOnUnmount_;
242  }
243 
244  void setCloseOnUnmount(bool value) {
245  closeOnUnmount_ = value;
246  }
247 
248  DesktopWindow::WallpaperMode wallpaperMode() const {
249  return DesktopWindow::WallpaperMode(wallpaperMode_);
250  }
251 
252  void setWallpaperMode(int wallpaperMode) {
253  wallpaperMode_ = wallpaperMode;
254  }
255 
256  QString wallpaper() const {
257  return wallpaper_;
258  }
259 
260  void setWallpaper(QString wallpaper) {
261  wallpaper_ = wallpaper;
262  }
263 
264  QSize wallpaperDialogSize() const {
265  return wallpaperDialogSize_;
266  }
267 
268  void setWallpaperDialogSize(const QSize& size) {
269  wallpaperDialogSize_ = size;
270  }
271 
272  int wallpaperDialogSplitterPos() const {
273  return wallpaperDialogSplitterPos_;
274  }
275 
276  void setWallpaperDialogSplitterPos(int pos) {
277  wallpaperDialogSplitterPos_ = pos;
278  }
279 
280  QString wallpaperDir() const {
281  return wallpaperDir_;
282  }
283 
284  void setLastSlide(QString wallpaper) {
285  lastSlide_ = wallpaper;
286  }
287 
288  QString lastSlide() const {
289  return lastSlide_;
290  }
291 
292  void setWallpaperDir(QString dir) {
293  wallpaperDir_ = dir;
294  }
295 
296  int slideShowInterval() const {
297  return slideShowInterval_;
298  }
299 
300  void setSlideShowInterval(int interval) {
301  slideShowInterval_ = interval;
302  }
303 
304  bool wallpaperRandomize() const {
305  return wallpaperRandomize_;
306  }
307 
308  void setWallpaperRandomize(bool randomize) {
309  wallpaperRandomize_ = randomize;
310  }
311 
312  bool transformWallpaper() const {
313  return transformWallpaper_;
314  }
315 
316  void setTransformWallpaper(bool tr) {
317  transformWallpaper_ = tr;
318  }
319 
320  bool perScreenWallpaper() const {
321  return perScreenWallpaper_;
322  }
323 
324  void setPerScreenWallpaper(bool tr) {
325  perScreenWallpaper_ = tr;
326  }
327 
328  const QColor& desktopBgColor() const {
329  return desktopBgColor_;
330  }
331 
332  void setDesktopBgColor(QColor desktopBgColor) {
333  desktopBgColor_ = desktopBgColor;
334  }
335 
336  const QColor& desktopFgColor() const {
337  return desktopFgColor_;
338  }
339 
340  void setDesktopFgColor(QColor desktopFgColor) {
341  desktopFgColor_ = desktopFgColor;
342  }
343 
344  const QColor& desktopShadowColor() const {
345  return desktopShadowColor_;
346  }
347 
348  void setDesktopShadowColor(QColor desktopShadowColor) {
349  desktopShadowColor_ = desktopShadowColor;
350  }
351 
352  QFont desktopFont() const {
353  return desktopFont_;
354  }
355 
356  void setDesktopFont(QFont font) {
357  desktopFont_ = font;
358  }
359 
360  int desktopIconSize() const {
361  return desktopIconSize_;
362  }
363 
364  void setDesktopIconSize(int desktopIconSize) {
365  desktopIconSize_ = desktopIconSize;
366  }
367 
368  QStringList desktopShortcuts() const {
369  return desktopShortcuts_;
370  }
371 
372  void setDesktopShortcuts(const QStringList& list) {
373  desktopShortcuts_ = list;
374  }
375 
376  bool desktopShowHidden() const {
377  return desktopShowHidden_;
378  }
379 
380  void setDesktopShowHidden(bool desktopShowHidden) {
381  desktopShowHidden_ = desktopShowHidden;
382  }
383 
384  bool desktopHideItems() const {
385  return desktopHideItems_;
386  }
387 
388  void setDesktopHideItems(bool hide) {
389  desktopHideItems_ = hide;
390  }
391 
392  Qt::SortOrder desktopSortOrder() const {
393  return desktopSortOrder_;
394  }
395 
396  void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
397  desktopSortOrder_ = desktopSortOrder;
398  }
399 
400  Fm::FolderModel::ColumnId desktopSortColumn() const {
401  return desktopSortColumn_;
402  }
403 
404  void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
405  desktopSortColumn_ = desktopSortColumn;
406  }
407 
408  bool desktopSortFolderFirst() const {
409  return desktopSortFolderFirst_;
410  }
411 
412  void setDesktopSortFolderFirst(bool desktopFolderFirst) {
413  desktopSortFolderFirst_ = desktopFolderFirst;
414  }
415 
416  bool desktopSortHiddenLast() const {
417  return desktopSortHiddenLast_;
418  }
419 
420  void setDesktopSortHiddenLast(bool desktopHiddenLast) {
421  desktopSortHiddenLast_ = desktopHiddenLast;
422  }
423 
424  bool alwaysShowTabs() const {
425  return alwaysShowTabs_;
426  }
427 
428  void setAlwaysShowTabs(bool alwaysShowTabs) {
429  alwaysShowTabs_ = alwaysShowTabs;
430  }
431 
432  bool showTabClose() const {
433  return showTabClose_;
434  }
435 
436  void setShowTabClose(bool showTabClose) {
437  showTabClose_ = showTabClose;
438  }
439 
440  bool switchToNewTab() const {
441  return switchToNewTab_;
442  }
443 
444  void setSwitchToNewTab(bool showTabClose) {
445  switchToNewTab_ = showTabClose;
446  }
447 
448  bool reopenLastTabs() const {
449  return reopenLastTabs_;
450  }
451 
452  void setReopenLastTabs(bool reopenLastTabs) {
453  reopenLastTabs_ = reopenLastTabs;
454  }
455 
456  QStringList tabPaths() const {
457  return tabPaths_;
458  }
459 
460  void setTabPaths(const QStringList& tabPaths) {
461  tabPaths_ = tabPaths;
462  }
463 
464  bool rememberWindowSize() const {
465  return rememberWindowSize_;
466  }
467 
468  void setRememberWindowSize(bool rememberWindowSize) {
469  rememberWindowSize_ = rememberWindowSize;
470  }
471 
472  int windowWidth() const {
473  if(rememberWindowSize_) {
474  return lastWindowWidth_;
475  }
476  else {
477  return fixedWindowWidth_;
478  }
479  }
480 
481  int windowHeight() const {
482  if(rememberWindowSize_) {
483  return lastWindowHeight_;
484  }
485  else {
486  return fixedWindowHeight_;
487  }
488  }
489 
490  bool windowMaximized() const {
491  if(rememberWindowSize_) {
492  return lastWindowMaximized_;
493  }
494  else {
495  return false;
496  }
497  }
498 
499  int fixedWindowWidth() const {
500  return fixedWindowWidth_;
501  }
502 
503  void setFixedWindowWidth(int fixedWindowWidth) {
504  fixedWindowWidth_ = fixedWindowWidth;
505  }
506 
507  int fixedWindowHeight() const {
508  return fixedWindowHeight_;
509  }
510 
511  void setFixedWindowHeight(int fixedWindowHeight) {
512  fixedWindowHeight_ = fixedWindowHeight;
513  }
514 
515  void setLastWindowWidth(int lastWindowWidth) {
516  lastWindowWidth_ = lastWindowWidth;
517  }
518 
519  void setLastWindowHeight(int lastWindowHeight) {
520  lastWindowHeight_ = lastWindowHeight;
521  }
522 
523  void setLastWindowMaximized(bool lastWindowMaximized) {
524  lastWindowMaximized_ = lastWindowMaximized;
525  }
526 
527  int splitterPos() const {
528  return splitterPos_;
529  }
530 
531  void setSplitterPos(int splitterPos) {
532  splitterPos_ = splitterPos;
533  }
534 
535  bool isSidePaneVisible() const {
536  return sidePaneVisible_;
537  }
538 
539  void showSidePane(bool show) {
540  sidePaneVisible_ = show;
541  }
542 
543  Fm::SidePane::Mode sidePaneMode() const {
544  return sidePaneMode_;
545  }
546 
547  void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
548  sidePaneMode_ = sidePaneMode;
549  }
550 
551  bool showMenuBar() const {
552  return showMenuBar_;
553  }
554 
555  void setShowMenuBar(bool showMenuBar) {
556  showMenuBar_ = showMenuBar;
557  }
558 
559  bool splitView() const {
560  return splitView_;
561  }
562 
563  void setSplitView(bool split) {
564  splitView_ = split;
565  }
566 
567  Fm::FolderView::ViewMode viewMode() const {
568  return viewMode_;
569  }
570 
571  void setViewMode(Fm::FolderView::ViewMode viewMode) {
572  viewMode_ = viewMode;
573  }
574 
575  bool showHidden() const {
576  return showHidden_;
577  }
578 
579  void setShowHidden(bool showHidden) {
580  showHidden_ = showHidden;
581  }
582 
583  bool sortCaseSensitive() const {
584  return sortCaseSensitive_;
585  }
586 
587  void setSortCaseSensitive(bool value) {
588  sortCaseSensitive_ = value;
589  }
590 
591  QSet<QString> getHiddenPlaces() const {
592  return hiddenPlaces_;
593  }
594 
595  void setHiddenPlace(const QString& str, bool hide) {
596  if(hide) {
597  hiddenPlaces_ << str;
598  }
599  else {
600  hiddenPlaces_.remove(str);
601  }
602  }
603 
604  Qt::SortOrder sortOrder() const {
605  return sortOrder_;
606  }
607 
608  void setSortOrder(Qt::SortOrder sortOrder) {
609  sortOrder_ = sortOrder;
610  }
611 
612  Fm::FolderModel::ColumnId sortColumn() const {
613  return sortColumn_;
614  }
615 
616  void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
617  sortColumn_ = sortColumn;
618  }
619 
620  bool sortFolderFirst() const {
621  return sortFolderFirst_;
622  }
623 
624  void setSortFolderFirst(bool folderFirst) {
625  sortFolderFirst_ = folderFirst;
626  }
627 
628  bool sortHiddenLast() const {
629  return sortHiddenLast_;
630  }
631 
632  void setSortHiddenLast(bool hiddenLast) {
633  sortHiddenLast_ = hiddenLast;
634  }
635 
636  bool showFilter() const {
637  return showFilter_;
638  }
639 
640  void setShowFilter(bool value) {
641  showFilter_ = value;
642  }
643 
644  bool pathBarButtons() const {
645  return pathBarButtons_;
646  }
647 
648  void setPathBarButtons(bool value) {
649  pathBarButtons_ = value;
650  }
651 
652  // settings for use with libfm
653  bool singleClick() const {
654  return singleClick_;
655  }
656 
657  void setSingleClick(bool singleClick) {
658  singleClick_ = singleClick;
659  }
660 
661  int autoSelectionDelay() const {
662  return autoSelectionDelay_;
663  }
664 
665  void setAutoSelectionDelay(int value) {
666  autoSelectionDelay_ = value;
667  }
668 
669  bool ctrlRightClick() const {
670  return ctrlRightClick_;
671  }
672 
673  void setCtrlRightClick(bool value) {
674  ctrlRightClick_ = value;
675  }
676 
677  bool useTrash() const {
678  if(!supportTrash_) {
679  return false;
680  }
681  return useTrash_;
682  }
683 
684  void setUseTrash(bool useTrash) {
685  useTrash_ = useTrash;
686  }
687 
688  bool confirmDelete() const {
689  return confirmDelete_;
690  }
691 
692  void setConfirmDelete(bool confirmDelete) {
693  confirmDelete_ = confirmDelete;
694  }
695 
696  bool noUsbTrash() const {
697  return noUsbTrash_;
698  }
699 
700  void setNoUsbTrash(bool noUsbTrash) {
701  noUsbTrash_ = noUsbTrash;
702  fm_config->no_usb_trash = noUsbTrash_; // also set this to libfm since FmFileOpsJob reads this config value before trashing files.
703  }
704 
705  bool confirmTrash() const {
706  return confirmTrash_;
707  }
708 
709  void setConfirmTrash(bool value) {
710  confirmTrash_ = value;
711  }
712 
713  bool quickExec() const {
714  return quickExec_;
715  }
716 
717  void setQuickExec(bool value) {
718  quickExec_ = value;
719  fm_config->quick_exec = quickExec_;
720  }
721 
722  bool selectNewFiles() const {
723  return selectNewFiles_;
724  }
725 
726  void setSelectNewFiles(bool value) {
727  selectNewFiles_ = value;
728  }
729 
730  // bool thumbnailLocal_;
731  // bool thumbnailMax;
732 
733  int bigIconSize() const {
734  return bigIconSize_;
735  }
736 
737  void setBigIconSize(int bigIconSize) {
738  bigIconSize_ = bigIconSize;
739  }
740 
741  int smallIconSize() const {
742  return smallIconSize_;
743  }
744 
745  void setSmallIconSize(int smallIconSize) {
746  smallIconSize_ = smallIconSize;
747  }
748 
749  int sidePaneIconSize() const {
750  return sidePaneIconSize_;
751  }
752 
753  void setSidePaneIconSize(int sidePaneIconSize) {
754  sidePaneIconSize_ = sidePaneIconSize;
755  }
756 
757  int thumbnailIconSize() const {
758  return thumbnailIconSize_;
759  }
760 
761  QSize folderViewCellMargins() const {
762  return folderViewCellMargins_;
763  }
764 
765  void setFolderViewCellMargins(QSize size) {
766  folderViewCellMargins_ = size;
767  }
768 
769  QSize desktopCellMargins() const {
770  return desktopCellMargins_;
771  }
772 
773  void setDesktopCellMargins(QSize size) {
774  desktopCellMargins_ = size;
775  }
776 
777  bool openWithDefaultFileManager() const {
778  return openWithDefaultFileManager_;
779  }
780 
781  void setOpenWithDefaultFileManager(bool open) {
782  openWithDefaultFileManager_ = open;
783  }
784 
785  bool showThumbnails() {
786  return showThumbnails_;
787  }
788 
789  void setShowThumbnails(bool show) {
790  showThumbnails_ = show;
791  }
792 
793  void setThumbnailLocalFilesOnly(bool value) {
794  Fm::ThumbnailJob::setLocalFilesOnly(value);
795  }
796 
797  bool thumbnailLocalFilesOnly() const {
798  return Fm::ThumbnailJob::localFilesOnly();
799  }
800 
801  int maxThumbnailFileSize() const {
802  return Fm::ThumbnailJob::maxThumbnailFileSize();
803  }
804 
805  void setMaxThumbnailFileSize(int size) {
806  Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
807  }
808 
809  void setThumbnailIconSize(int thumbnailIconSize) {
810  thumbnailIconSize_ = thumbnailIconSize;
811  }
812 
813  bool siUnit() {
814  return siUnit_;
815  }
816 
817  void setSiUnit(bool siUnit) {
818  siUnit_ = siUnit;
819  // override libfm FmConfig settings. FIXME: should we do this?
820  fm_config->si_unit = (gboolean)siUnit_;
821  }
822 
823  bool backupAsHidden() const {
824  return backupAsHidden_;
825  }
826 
827  void setBackupAsHidden(bool value) {
828  backupAsHidden_ = value;
829  fm_config->backup_as_hidden = backupAsHidden_; // also set this to libfm since fm_file_info_is_hidden() reads this value internally.
830  }
831 
832  bool showFullNames() const {
833  return showFullNames_;
834  }
835 
836  void setShowFullNames(bool value) {
837  showFullNames_ = value;
838  }
839 
840  bool shadowHidden() const {
841  return shadowHidden_;
842  }
843 
844  void setShadowHidden(bool value) {
845  shadowHidden_ = value;
846  }
847 
848  bool noItemTooltip() const {
849  return noItemTooltip_;
850  }
851 
852  void setNoItemTooltip(bool noTooltip) {
853  noItemTooltip_ = noTooltip;
854  }
855 
856  bool onlyUserTemplates() const {
857  return onlyUserTemplates_;
858  }
859 
860  void setOnlyUserTemplates(bool value) {
861  onlyUserTemplates_ = value;
862  fm_config->only_user_templates = onlyUserTemplates_;
863  }
864 
865  bool templateTypeOnce() const {
866  return templateTypeOnce_;
867  }
868 
869  void setTemplateTypeOnce(bool value) {
870  templateTypeOnce_ = value;
871  fm_config->template_type_once = templateTypeOnce_;
872  }
873 
874  bool templateRunApp() const {
875  return templateRunApp_;
876  }
877 
878  void setTemplateRunApp(bool value) {
879  templateRunApp_ = value;
880  fm_config->template_run_app = templateRunApp_;
881  }
882 
883  // per-folder settings
884  FolderSettings loadFolderSettings(const Fm::FilePath& path) const;
885 
886  void saveFolderSettings(const Fm::FilePath& path, const FolderSettings& settings);
887 
888  void clearFolderSettings(const Fm::FilePath& path) const;
889 
890  bool searchNameCaseInsensitive() const {
891  return searchNameCaseInsensitive_;
892  }
893 
894  void setSearchNameCaseInsensitive(bool caseInsensitive) {
895  searchNameCaseInsensitive_ = caseInsensitive;
896  }
897 
898  bool searchContentCaseInsensitive() const {
899  return searchContentCaseInsensitive_;
900  }
901 
902  void setsearchContentCaseInsensitive(bool caseInsensitive) {
903  searchContentCaseInsensitive_ = caseInsensitive;
904  }
905 
906  bool searchNameRegexp() const {
907  return searchNameRegexp_;
908  }
909 
910  void setSearchNameRegexp(bool reg) {
911  searchNameRegexp_ = reg;
912  }
913 
914  bool searchContentRegexp() const {
915  return searchContentRegexp_;
916  }
917 
918  void setSearchContentRegexp(bool reg) {
919  searchContentRegexp_ = reg;
920  }
921 
922  bool searchRecursive() const {
923  return searchRecursive_;
924  }
925 
926  void setSearchRecursive(bool rec) {
927  searchRecursive_ = rec;
928  }
929 
930  bool searchhHidden() const {
931  return searchhHidden_;
932  }
933 
934  void setSearchhHidden(bool hidden) {
935  searchhHidden_ = hidden;
936  }
937 
938  QList<int> getCustomColumnWidths() const {
939  QList<int> l;
940  for(auto width : qAsConst(customColumnWidths_)) {
941  l << width.toInt();
942  }
943  return l;
944  }
945 
946  void setCustomColumnWidths(const QList<int> &widths) {
947  customColumnWidths_.clear();
948  for(auto width : widths) {
949  customColumnWidths_ << QVariant(width);
950  }
951  }
952 
953  QList<int> getHiddenColumns() const {
954  QList<int> l;
955  for(auto width : qAsConst(hiddenColumns_)) {
956  l << width.toInt();
957  }
958  return l;
959  }
960 
961  void setHiddenColumns(const QList<int> &columns) {
962  hiddenColumns_.clear();
963  for(auto column : columns) {
964  hiddenColumns_ << QVariant(column);
965  }
966  }
967 
968 private:
969  int toIconSize(int size, IconType type) const;
970 
971  QString profileName_;
972  bool supportTrash_;
973 
974  // PCManFM specific
975  QString fallbackIconThemeName_;
976  bool useFallbackIconTheme_;
977 
978  bool singleWindowMode_;
979  OpenDirTargetType bookmarkOpenMethod_;
980  QString suCommand_;
981  QString terminal_;
982  bool mountOnStartup_;
983  bool mountRemovable_;
984  bool autoRun_;
985  bool closeOnUnmount_;
986 
987  int wallpaperMode_;
988  QString wallpaper_;
989  QSize wallpaperDialogSize_;
990  int wallpaperDialogSplitterPos_;
991  QString lastSlide_;
992  QString wallpaperDir_;
993  int slideShowInterval_;
994  bool wallpaperRandomize_;
995  bool transformWallpaper_;
996  bool perScreenWallpaper_;
997  QColor desktopBgColor_;
998  QColor desktopFgColor_;
999  QColor desktopShadowColor_;
1000  QFont desktopFont_;
1001  int desktopIconSize_;
1002  QStringList desktopShortcuts_;
1003 
1004  bool desktopShowHidden_;
1005  bool desktopHideItems_;
1006  Qt::SortOrder desktopSortOrder_;
1007  Fm::FolderModel::ColumnId desktopSortColumn_;
1008  bool desktopSortFolderFirst_;
1009  bool desktopSortHiddenLast_;
1010 
1011  bool alwaysShowTabs_;
1012  bool showTabClose_;
1013  bool switchToNewTab_;
1014  bool reopenLastTabs_;
1015  QStringList tabPaths_;
1016  bool rememberWindowSize_;
1017  int fixedWindowWidth_;
1018  int fixedWindowHeight_;
1019  int lastWindowWidth_;
1020  int lastWindowHeight_;
1021  bool lastWindowMaximized_;
1022  int splitterPos_;
1023  bool sidePaneVisible_;
1024  Fm::SidePane::Mode sidePaneMode_;
1025  bool showMenuBar_;
1026  bool splitView_;
1027 
1028  Fm::FolderView::ViewMode viewMode_;
1029  bool showHidden_;
1030  Qt::SortOrder sortOrder_;
1031  Fm::FolderModel::ColumnId sortColumn_;
1032  bool sortFolderFirst_;
1033  bool sortHiddenLast_;
1034  bool sortCaseSensitive_;
1035  bool showFilter_;
1036  bool pathBarButtons_;
1037 
1038  // settings for use with libfm
1039  bool singleClick_;
1040  int autoSelectionDelay_;
1041  bool ctrlRightClick_;
1042  bool useTrash_;
1043  bool confirmDelete_;
1044  bool noUsbTrash_; // do not trash files on usb removable devices
1045  bool confirmTrash_; // Confirm before moving files into "trash can"
1046  bool quickExec_; // Don't ask options on launch executable file
1047  bool selectNewFiles_;
1048 
1049  bool showThumbnails_;
1050 
1051  QString archiver_;
1052  bool siUnit_;
1053  bool backupAsHidden_;
1054  bool showFullNames_;
1055  bool shadowHidden_;
1056  bool noItemTooltip_;
1057 
1058  QSet<QString> hiddenPlaces_;
1059 
1060  int bigIconSize_;
1061  int smallIconSize_;
1062  int sidePaneIconSize_;
1063  int thumbnailIconSize_;
1064 
1065  bool onlyUserTemplates_;
1066  bool templateTypeOnce_;
1067  bool templateRunApp_;
1068 
1069  QSize folderViewCellMargins_;
1070  QSize desktopCellMargins_;
1071 
1072  bool openWithDefaultFileManager_;
1073 
1074  // search settings
1075  bool searchNameCaseInsensitive_;
1076  bool searchContentCaseInsensitive_;
1077  bool searchNameRegexp_;
1078  bool searchContentRegexp_;
1079  bool searchRecursive_;
1080  bool searchhHidden_;
1081 
1082  // detailed list columns
1083  QList<QVariant> customColumnWidths_;
1084  QList<QVariant> hiddenColumns_;
1085 };
1086 
1087 }
1088 
1089 #endif // PCMANFM_SETTINGS_H
Definition: settings.h:42
Definition: settings.h:134