NDE-FileMAN
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 NDEFILEMAN_SETTINGS_H
22 #define NDEFILEMAN_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 NDEFileMAN {
34 
35 enum OpenDirTargetType {
36  OpenInCurrentTab,
37  OpenInNewTab,
38  OpenInNewWindow,
39  OpenInLastActiveWindow
40 };
41 
43 public:
44  enum dataType {
45  Favorites,
46  Historys
47  };
48 
49  struct data {
50  QString host;
51  QString scheme;
52  QString port;
53  QString path;
54  QString canAnonymous;
55  QString userName;
56  QString passWord;
57  QString favoriveName;
58  };
59 
61  virtual ~connectFavHisData();
62 
63  bool load();
64  QList<data> loadData(dataType type);
65 
66  bool save(dataType type);
67  bool saveData(QList<data> list,dataType type);
68 
69  bool addData(data info,dataType type);
70  void deleteData(int index, dataType type);
71 
72  void changeFavoriteName(int index, QString text);
73  void clearHistory();
74 
75  QStringList connectFavorites() const {
76  return connectFavorites_;
77  }
78 
79  void setConnectFavorites(const QStringList& list) {
80  connectFavorites_ = list;
81  }
82 
83 private:
84  QStringList connectFavorites_;
85  QStringList connectHistorys_;
86  QString configFilePath;
87 };
88 
89 
91 public:
93  isCustomized_(false),
94  sortOrder_(Qt::AscendingOrder),
95  sortColumn_(Fm::FolderModel::ColumnFileName),
96  viewMode_(Fm::FolderView::DetailedListMode),
97  showHidden_(false),
98  sortFolderFirst_(true),
99  sortCaseSensitive_(true) {
100  }
101 
102  bool isCustomized() const {
103  return isCustomized_;
104  }
105 
106  void setCustomized(bool value) {
107  isCustomized_ = value;
108  }
109 
110  Qt::SortOrder sortOrder() const {
111  return sortOrder_;
112  }
113 
114  void setSortOrder(Qt::SortOrder value) {
115  sortOrder_ = value;
116  }
117 
118  Fm::FolderModel::ColumnId sortColumn() const {
119  return sortColumn_;
120  }
121 
122  void setSortColumn(Fm::FolderModel::ColumnId value) {
123  sortColumn_ = value;
124  }
125 
126  Fm::FolderView::ViewMode viewMode() const {
127  return viewMode_;
128  }
129 
130  void setViewMode(Fm::FolderView::ViewMode value) {
131  viewMode_ = value;
132  }
133 
134  bool sortFolderFirst() const {
135  return sortFolderFirst_;
136  }
137 
138  void setSortFolderFirst(bool value) {
139  sortFolderFirst_ = value;
140  }
141 
142  bool showHidden() const {
143  return showHidden_;
144  }
145 
146  void setShowHidden(bool value) {
147  showHidden_ = value;
148  }
149 
150  bool sortCaseSensitive() const {
151  return sortCaseSensitive_;
152  }
153 
154  void setSortCaseSensitive(bool value) {
155  sortCaseSensitive_ = value;
156  }
157 
158 private:
159  bool isCustomized_;
160  Qt::SortOrder sortOrder_;
161  Fm::FolderModel::ColumnId sortColumn_;
162  Fm::FolderView::ViewMode viewMode_;
163  bool showHidden_;
164  bool sortFolderFirst_;
165  bool sortCaseSensitive_;
166  // columns?
167 };
168 
169 
170 class Settings : public QObject {
171  Q_OBJECT
172 public:
173  enum IconType {
174  Small,
175  Big,
176  Thumbnail
177  };
178 
179  Settings();
180  virtual ~Settings();
181 
182  bool load(QString profile = "default");
183  bool save(QString profile = QString());
184 
185  bool loadFile(QString filePath);
186  bool saveFile(QString filePath);
187 
188  static QString xdgUserConfigDir();
189  static const QList<int> & iconSizes(IconType type);
190 
191  QString profileDir(QString profile, bool useFallback = false);
192 
193  // setter/getter functions
194  QString profileName() const {
195  return profileName_;
196  }
197 
198  bool supportTrash() const {
199  return supportTrash_;
200  }
201 
202  QString fallbackIconThemeName() const {
203  return fallbackIconThemeName_;
204  }
205 
206  bool useFallbackIconTheme() const {
207  return useFallbackIconTheme_;
208  }
209 
210  void setFallbackIconThemeName(QString iconThemeName) {
211  fallbackIconThemeName_ = iconThemeName;
212  }
213 
214  OpenDirTargetType bookmarkOpenMethod() {
215  return bookmarkOpenMethod_;
216  }
217 
218  void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
219  bookmarkOpenMethod_ = bookmarkOpenMethod;
220  }
221 
222  QString suCommand() const {
223  return suCommand_;
224  }
225 
226  void setSuCommand(QString suCommand) {
227  suCommand_ = suCommand;
228  }
229 
230  QString terminal() {
231  return terminal_;
232  }
233  void setTerminal(QString terminalCommand);
234 
235  QString archiver() const {
236  return archiver_;
237  }
238 
239  void setArchiver(QString archiver) {
240  archiver_ = archiver;
241  Fm::Archiver::setDefaultArchiverByName(archiver_.toLocal8Bit().constData());
242  }
243 
244  bool mountOnStartup() const {
245  return mountOnStartup_;
246  }
247 
248  void setMountOnStartup(bool mountOnStartup) {
249  mountOnStartup_ = mountOnStartup;
250  }
251 
252  bool mountRemovable() {
253  return mountRemovable_;
254  }
255 
256  void setMountRemovable(bool mountRemovable) {
257  mountRemovable_ = mountRemovable;
258  }
259 
260  bool autoRun() const {
261  return autoRun_;
262  }
263 
264  void setAutoRun(bool autoRun) {
265  autoRun_ = autoRun;
266  }
267 
268  bool closeOnUnmount() const {
269  return closeOnUnmount_;
270  }
271 
272  void setCloseOnUnmount(bool value) {
273  closeOnUnmount_ = value;
274  }
275 
276  DesktopWindow::WallpaperMode wallpaperMode() const {
277  return DesktopWindow::WallpaperMode(wallpaperMode_);
278  }
279 
280  void setWallpaperMode(int wallpaperMode) {
281  wallpaperMode_ = wallpaperMode;
282  }
283 
284  QString wallpaper() const {
285  return wallpaper_;
286  }
287 
288  QString userWallpaperPath() const {
289  return userWallpaperPath_;
290  }
291 
292  int wallpaperInterval() const {
293  return wallpaperInterval_;
294  }
295 
296  void setWallpaper(QString wallpaper) {
297  wallpaper_ = wallpaper;
298  }
299 
300  void setUserWallpaperPath(QString path) {
301  userWallpaperPath_ = path;
302  }
303 
304  void setWallpaperInterval(int interval) {
305  wallpaperInterval_ = interval;
306  }
307 
308  void setWallpaperPattern(int pattern) {
309  wallpaperPattern_ = pattern;
310  }
311 
312  QString wallpaperDir() const {
313  return wallpaperDir_;
314  }
315 
316  void setLastSlide(QString wallpaper) {
317  lastSlide_ = wallpaper;
318  }
319 
320  QString lastSlide() const {
321  return lastSlide_;
322  }
323 
324  void setWallpaperDir(QString dir) {
325  wallpaperDir_ = dir;
326  }
327 
328  int slideShowInterval() const {
329  return slideShowInterval_;
330  }
331 
332  void setSlideShowInterval(int interval) {
333  slideShowInterval_ = interval;
334  }
335 
336  bool wallpaperRandomize() const {
337  return wallpaperRandomize_;
338  }
339 
340  void setWallpaperRandomize(bool randomize) {
341  wallpaperRandomize_ = randomize;
342  }
343 
344  const QColor& desktopBgColor() const {
345  return desktopBgColor_;
346  }
347 
348  void setDesktopBgColor(QColor desktopBgColor) {
349  desktopBgColor_ = desktopBgColor;
350  }
351 
352  const QColor& desktopFgColor() const {
353  return desktopFgColor_;
354  }
355 
356  void setDesktopFgColor(QColor desktopFgColor) {
357  desktopFgColor_ = desktopFgColor;
358  }
359 
360  const QColor& desktopShadowColor() const {
361  return desktopShadowColor_;
362  }
363 
364  void setDesktopShadowColor(QColor desktopShadowColor) {
365  desktopShadowColor_ = desktopShadowColor;
366  }
367 
368  QFont desktopFont() const {
369  return desktopFont_;
370  }
371 
372  void setDesktopFont(QFont font) {
373  desktopFont_ = font;
374  }
375 
376  int desktopIconSize() const {
377  return desktopIconSize_;
378  }
379 
380  void setDesktopIconSize(int desktopIconSize) {
381  desktopIconSize_ = desktopIconSize;
382  }
383 
384  QStringList desktopShortcuts() const {
385  return desktopShortcuts_;
386  }
387 
388  void setDesktopShortcuts(const QStringList& list) {
389  desktopShortcuts_ = list;
390  }
391 
392  bool showWmMenu() const {
393  return showWmMenu_;
394  }
395 
396  void setShowWmMenu(bool value) {
397  showWmMenu_ = value;
398  }
399 
400  bool desktopShowHidden() const {
401  return desktopShowHidden_;
402  }
403 
404  void setDesktopShowHidden(bool desktopShowHidden) {
405  desktopShowHidden_ = desktopShowHidden;
406  }
407 
408 // bool desktopHideItems() const {
409 // return desktopHideItems_;
410 // }
411 
412 // void setDesktopHideItems(bool hide) {
413 // desktopHideItems_ = hide;
414 // }
415 
416  bool desktopAutoSort() const {
417  return desktopAutoSort_;
418  }
419 
420  void setDesktopAutoSort(bool type) {
421  desktopAutoSort_ = type;
422  }
423 
424  Qt::SortOrder desktopSortOrder() const {
425  return desktopSortOrder_;
426  }
427 
428  void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
429  desktopSortOrder_ = desktopSortOrder;
430  }
431 
432  Fm::FolderModel::ColumnId desktopSortColumn() const {
433  return desktopSortColumn_;
434  }
435 
436  void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
437  desktopSortColumn_ = desktopSortColumn;
438  }
439 
440  bool desktopSortFolderFirst() const {
441  return desktopSortFolderFirst_;
442  }
443 
444  void setDesktopSortFolderFirst(bool desktopFolderFirst) {
445  desktopSortFolderFirst_ = desktopFolderFirst;
446  }
447 
448  bool alwaysShowTabs() const {
449  return alwaysShowTabs_;
450  }
451 
452  void setAlwaysShowTabs(bool alwaysShowTabs) {
453  alwaysShowTabs_ = alwaysShowTabs;
454  }
455 
456  bool showTabClose() const {
457  return showTabClose_;
458  }
459 
460  void setShowTabClose(bool showTabClose) {
461  showTabClose_ = showTabClose;
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  Fm::SidePane::Mode sidePaneMode() const {
536  return sidePaneMode_;
537  }
538 
539  void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
540  sidePaneMode_ = sidePaneMode;
541  }
542 
543  bool showMenuBar() const {
544  return showMenuBar_;
545  }
546 
547  void setShowMenuBar(bool showMenuBar) {
548  showMenuBar_ = showMenuBar;
549  }
550 
551  bool splitView() const {
552  return splitView_;
553  }
554 
555  void setSplitView(bool split) {
556  splitView_ = split;
557  }
558 
559  Fm::FolderView::ViewMode viewMode() const {
560  return viewMode_;
561  }
562 
563  void setViewMode(Fm::FolderView::ViewMode viewMode) {
564  viewMode_ = viewMode;
565  }
566 
567  bool showHidden() const {
568  return showHidden_;
569  }
570 
571  void setShowHidden(bool showHidden) {
572  showHidden_ = showHidden;
573  }
574 
575  bool sortCaseSensitive() const {
576  return sortCaseSensitive_;
577  }
578 
579  void setSortCaseSensitive(bool value) {
580  sortCaseSensitive_ = value;
581  }
582 
583 
584  bool placesHome() const {
585  return placesHome_;
586  }
587 
588  void setPlacesHome(bool placesHome) {
589  placesHome_ = placesHome;
590  }
591 
592  bool placesDesktop() const {
593  return placesDesktop_;
594  }
595 
596  void setPlacesDesktop(bool placesDesktop) {
597  placesDesktop_ = placesDesktop;
598  }
599 
600  bool placesApplications() const {
601  return placesApplications_;
602  }
603 
604  void setPlacesApplications(bool placesApplications) {
605  placesApplications_ = placesApplications;
606  }
607 
608  bool placesTrash() const {
609  return placesTrash_;
610  }
611 
612  void setPlacesTrash(bool placesTrash) {
613  placesTrash_ = placesTrash;
614  }
615 
616  bool placesRoot() const {
617  return placesRoot_;
618  }
619 
620  void setPlacesRoot(bool placesRoot) {
621  placesRoot_ = placesRoot;
622  }
623 
624  bool placesComputer() const {
625  return placesComputer_;
626  }
627 
628  void setPlacesComputer(bool placesComputer) {
629  placesComputer_ = placesComputer;
630  }
631 
632  bool placesNetwork() const {
633  return placesNetwork_;
634  }
635 
636  void setPlacesNetwork(bool placesNetwork) {
637  placesNetwork_ = placesNetwork;
638  }
639 
640  QSet<QString> getHiddenPlaces() const {
641  return hiddenPlaces_;
642  }
643 
644  void setHiddenPlace(const QString& str, bool hide) {
645  if(hide) {
646  hiddenPlaces_ << str;
647  }
648  else {
649  hiddenPlaces_.remove(str);
650  }
651  }
652 
653 
654  Qt::SortOrder sortOrder() const {
655  return sortOrder_;
656  }
657 
658  void setSortOrder(Qt::SortOrder sortOrder) {
659  sortOrder_ = sortOrder;
660  }
661 
662  Fm::FolderModel::ColumnId sortColumn() const {
663  return sortColumn_;
664  }
665 
666  void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
667  sortColumn_ = sortColumn;
668  }
669 
670  bool sortFolderFirst() const {
671  return sortFolderFirst_;
672  }
673 
674  void setSortFolderFirst(bool folderFirst) {
675  sortFolderFirst_ = folderFirst;
676  }
677 
678  bool showFilter() const {
679  return showFilter_;
680  }
681 
682  void setShowFilter(bool value) {
683  showFilter_ = value;
684  }
685 
686  bool pathBarButtons() const {
687  return pathBarButtons_;
688  }
689 
690  void setPathBarButtons(bool value) {
691  pathBarButtons_ = value;
692  }
693 
694  // settings for use with libfm
695  bool singleClick() const {
696  return singleClick_;
697  }
698 
699  void setSingleClick(bool singleClick) {
700  singleClick_ = singleClick;
701  }
702 
703  int autoSelectionDelay() const {
704  return autoSelectionDelay_;
705  }
706 
707  void setAutoSelectionDelay(int value) {
708  autoSelectionDelay_ = value;
709  }
710 
711  bool useTrash() const {
712  if(!supportTrash_) {
713  return false;
714  }
715  return useTrash_;
716  }
717 
718  void setUseTrash(bool useTrash) {
719  useTrash_ = useTrash;
720  }
721 
722  bool confirmDelete() const {
723  return confirmDelete_;
724  }
725 
726  void setConfirmDelete(bool confirmDelete) {
727  confirmDelete_ = confirmDelete;
728  }
729 
730  bool noUsbTrash() const {
731  return noUsbTrash_;
732  }
733 
734  void setNoUsbTrash(bool noUsbTrash) {
735  noUsbTrash_ = noUsbTrash;
736  fm_config->no_usb_trash = noUsbTrash_; // also set this to libfm since FmFileOpsJob reads this config value before trashing files.
737  }
738 
739  bool confirmTrash() const {
740  return confirmTrash_;
741  }
742 
743  void setConfirmTrash(bool value) {
744  confirmTrash_ = value;
745  }
746 
747  bool quickExec() const {
748  return quickExec_;
749  }
750 
751  void setQuickExec(bool value) {
752  quickExec_ = value;
753  fm_config->quick_exec = quickExec_;
754  }
755 
756  bool selectNewFiles() const {
757  return selectNewFiles_;
758  }
759 
760  void setSelectNewFiles(bool value) {
761  selectNewFiles_ = value;
762  }
763 
764  // bool thumbnailLocal_;
765  // bool thumbnailMax;
766 
767  int bigIconSize() const {
768  return bigIconSize_;
769  }
770 
771  void setBigIconSize(int bigIconSize) {
772  bigIconSize_ = bigIconSize;
773  }
774 
775  int smallIconSize() const {
776  return smallIconSize_;
777  }
778 
779  void setSmallIconSize(int smallIconSize) {
780  smallIconSize_ = smallIconSize;
781  }
782 
783  int sidePaneIconSize() const {
784  return sidePaneIconSize_;
785  }
786 
787  void setSidePaneIconSize(int sidePaneIconSize) {
788  sidePaneIconSize_ = sidePaneIconSize;
789  }
790 
791  int thumbnailIconSize() const {
792  return thumbnailIconSize_;
793  }
794 
795  QSize folderViewCellMargins() const {
796  return folderViewCellMargins_;
797  }
798 
799  void setFolderViewCellMargins(QSize size) {
800  folderViewCellMargins_ = size;
801  }
802 
803  QSize desktopCellMargins() const {
804  return desktopCellMargins_;
805  }
806 
807  void setDesktopCellMargins(QSize size) {
808  desktopCellMargins_ = size;
809  }
810 
811 
812  bool showThumbnails() {
813  return showThumbnails_;
814  }
815 
816  void setShowThumbnails(bool show) {
817  showThumbnails_ = show;
818  }
819 
820  void setThumbnailLocalFilesOnly(bool value) {
821  Fm::ThumbnailJob::setLocalFilesOnly(value);
822  }
823 
824  bool thumbnailLocalFilesOnly() const {
825  return Fm::ThumbnailJob::localFilesOnly();
826  }
827 
828  int maxThumbnailFileSize() const {
829  return Fm::ThumbnailJob::maxThumbnailFileSize();
830  }
831 
832  void setMaxThumbnailFileSize(int size) {
833  Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
834  }
835 
836  void setThumbnailIconSize(int thumbnailIconSize) {
837  thumbnailIconSize_ = thumbnailIconSize;
838  }
839 
840  bool siUnit() {
841  return siUnit_;
842  }
843 
844  void setSiUnit(bool siUnit) {
845  siUnit_ = siUnit;
846  // override libfm FmConfig settings. FIXME: should we do this?
847  fm_config->si_unit = (gboolean)siUnit_;
848  }
849 
850  bool backupAsHidden() const {
851  return backupAsHidden_;
852  }
853 
854  void setBackupAsHidden(bool value) {
855  backupAsHidden_ = value;
856  fm_config->backup_as_hidden = backupAsHidden_; // also set this to libfm since fm_file_info_is_hidden() reads this value internally.
857  }
858 
859  bool showFullNames() const {
860  return showFullNames_;
861  }
862 
863  void setShowFullNames(bool value) {
864  showFullNames_ = value;
865  }
866 
867  bool shadowHidden() const {
868  return shadowHidden_;
869  }
870 
871  void setShadowHidden(bool value) {
872  shadowHidden_ = value;
873  }
874 
875  bool onlyUserTemplates() const {
876  return onlyUserTemplates_;
877  }
878 
879  void setOnlyUserTemplates(bool value) {
880  onlyUserTemplates_ = value;
881  fm_config->only_user_templates = onlyUserTemplates_;
882  }
883 
884  bool templateTypeOnce() const {
885  return templateTypeOnce_;
886  }
887 
888  void setTemplateTypeOnce(bool value) {
889  templateTypeOnce_ = value;
890  fm_config->template_type_once = templateTypeOnce_;
891  }
892 
893  bool templateRunApp() const {
894  return templateRunApp_;
895  }
896 
897  void setTemplateRunApp(bool value) {
898  templateRunApp_ = value;
899  fm_config->template_run_app = templateRunApp_;
900  }
901 
902  // per-folder settings
903  FolderSettings loadFolderSettings(const Fm::FilePath& path) const;
904 
905  void saveFolderSettings(const Fm::FilePath& path, const FolderSettings& settings);
906 
907  void clearFolderSettings(const Fm::FilePath& path) const;
908 
909  bool searchNameCaseInsensitive() const {
910  return searchNameCaseInsensitive_;
911  }
912 
913  void setSearchNameCaseInsensitive(bool caseInsensitive) {
914  searchNameCaseInsensitive_ = caseInsensitive;
915  }
916 
917  bool searchContentCaseInsensitive() const {
918  return searchContentCaseInsensitive_;
919  }
920 
921  void setsearchContentCaseInsensitive(bool caseInsensitive) {
922  searchContentCaseInsensitive_ = caseInsensitive;
923  }
924 
925  bool searchNameRegexp() const {
926  return searchNameRegexp_;
927  }
928 
929  void setSearchNameRegexp(bool reg) {
930  searchNameRegexp_ = reg;
931  }
932 
933  bool searchContentRegexp() const {
934  return searchContentRegexp_;
935  }
936 
937  void setSearchContentRegexp(bool reg) {
938  searchContentRegexp_ = reg;
939  }
940 
941  bool searchRecursive() const {
942  return searchRecursive_;
943  }
944 
945  void setSearchRecursive(bool rec) {
946  searchRecursive_ = rec;
947  }
948 
949  bool searchhHidden() const {
950  return searchhHidden_;
951  }
952 
953  void setSearchhHidden(bool hidden) {
954  searchhHidden_ = hidden;
955  }
956 
957  QList<int> getCustomColumnWidths() const {
958  QList<int> l;
959  for(auto width : qAsConst(customColumnWidths_)) {
960  l << width.toInt();
961  }
962  return l;
963  }
964 
965  void setCustomColumnWidths(const QList<int> &widths) {
966  customColumnWidths_.clear();
967  for(auto width : widths) {
968  customColumnWidths_ << QVariant(width);
969  }
970  }
971 
972  QList<int> getHiddenColumns() const {
973  QList<int> l;
974  for(auto width : qAsConst(hiddenColumns_)) {
975  l << width.toInt();
976  }
977  return l;
978  }
979 
980  void setHiddenColumns(const QList<int> &columns) {
981  hiddenColumns_.clear();
982  for(auto column : columns) {
983  hiddenColumns_ << QVariant(column);
984  }
985  }
986 
987 private:
988  int toIconSize(int size, IconType type) const;
989 
990  QString profileName_;
991  bool supportTrash_;
992 
993  // NDEFileMAN specific
994  QString fallbackIconThemeName_;
995  bool useFallbackIconTheme_;
996 
997  OpenDirTargetType bookmarkOpenMethod_;
998  QString suCommand_;
999  QString terminal_;
1000  bool mountOnStartup_;
1001  bool mountRemovable_;
1002  bool autoRun_;
1003  bool closeOnUnmount_;
1004 
1005  int wallpaperMode_;
1006  QString wallpaper_;
1007  QString userWallpaperPath_;
1008  int wallpaperInterval_;
1009  int wallpaperPattern_;
1010  QString lastSlide_;
1011  QString wallpaperDir_;
1012  int slideShowInterval_;
1013  bool wallpaperRandomize_;
1014  QColor desktopBgColor_;
1015  QColor desktopFgColor_;
1016  QColor desktopShadowColor_;
1017  QFont desktopFont_;
1018  int desktopIconSize_;
1019  QStringList desktopShortcuts_;
1020  bool showWmMenu_;
1021 
1022  bool desktopShowHidden_;
1023  //bool desktopHideItems_;
1024  bool desktopAutoSort_;
1025  Qt::SortOrder desktopSortOrder_;
1026  Fm::FolderModel::ColumnId desktopSortColumn_;
1027  bool desktopSortFolderFirst_;
1028 
1029  bool alwaysShowTabs_;
1030  bool showTabClose_;
1031  bool rememberWindowSize_;
1032  int fixedWindowWidth_;
1033  int fixedWindowHeight_;
1034  int lastWindowWidth_;
1035  int lastWindowHeight_;
1036  bool lastWindowMaximized_;
1037  int splitterPos_;
1038  Fm::SidePane::Mode sidePaneMode_;
1039  bool showMenuBar_;
1040  bool splitView_;
1041 
1042  Fm::FolderView::ViewMode viewMode_;
1043  bool showHidden_;
1044  Qt::SortOrder sortOrder_;
1045  Fm::FolderModel::ColumnId sortColumn_;
1046  bool sortFolderFirst_;
1047  bool sortCaseSensitive_;
1048  bool showFilter_;
1049  bool pathBarButtons_;
1050 
1051  // settings for use with libfm
1052  bool singleClick_;
1053  int autoSelectionDelay_;
1054  bool useTrash_;
1055  bool confirmDelete_;
1056  bool noUsbTrash_; // do not trash files on usb removable devices
1057  bool confirmTrash_; // Confirm before moving files into "trash can"
1058  bool quickExec_; // Don't ask options on launch executable file
1059  bool selectNewFiles_;
1060 
1061  bool showThumbnails_;
1062 
1063  QString archiver_;
1064  bool siUnit_;
1065  bool backupAsHidden_;
1066  bool showFullNames_;
1067  bool shadowHidden_;
1068 
1069  bool placesHome_;
1070  bool placesDesktop_;
1071  bool placesApplications_;
1072  bool placesTrash_;
1073  bool placesRoot_;
1074  bool placesComputer_;
1075  bool placesNetwork_;
1076  QSet<QString> hiddenPlaces_;
1077 
1078  int bigIconSize_;
1079  int smallIconSize_;
1080  int sidePaneIconSize_;
1081  int thumbnailIconSize_;
1082 
1083  bool onlyUserTemplates_;
1084  bool templateTypeOnce_;
1085  bool templateRunApp_;
1086 
1087  QSize folderViewCellMargins_;
1088  QSize desktopCellMargins_;
1089 
1090  // search settings
1091  bool searchNameCaseInsensitive_;
1092  bool searchContentCaseInsensitive_;
1093  bool searchNameRegexp_;
1094  bool searchContentRegexp_;
1095  bool searchRecursive_;
1096  bool searchhHidden_;
1097 
1098  // detailed list columns
1099  QList<QVariant> customColumnWidths_;
1100  QList<QVariant> hiddenColumns_;
1101 };
1102 
1103 }
1104 
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