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  void setWallpaper(QString wallpaper) {
289  wallpaper_ = wallpaper;
290  }
291 
292  QString wallpaperDir() const {
293  return wallpaperDir_;
294  }
295 
296  void setLastSlide(QString wallpaper) {
297  lastSlide_ = wallpaper;
298  }
299 
300  QString lastSlide() const {
301  return lastSlide_;
302  }
303 
304  void setWallpaperDir(QString dir) {
305  wallpaperDir_ = dir;
306  }
307 
308  int slideShowInterval() const {
309  return slideShowInterval_;
310  }
311 
312  void setSlideShowInterval(int interval) {
313  slideShowInterval_ = interval;
314  }
315 
316  bool wallpaperRandomize() const {
317  return wallpaperRandomize_;
318  }
319 
320  void setWallpaperRandomize(bool randomize) {
321  wallpaperRandomize_ = randomize;
322  }
323 
324  const QColor& desktopBgColor() const {
325  return desktopBgColor_;
326  }
327 
328  void setDesktopBgColor(QColor desktopBgColor) {
329  desktopBgColor_ = desktopBgColor;
330  }
331 
332  const QColor& desktopFgColor() const {
333  return desktopFgColor_;
334  }
335 
336  void setDesktopFgColor(QColor desktopFgColor) {
337  desktopFgColor_ = desktopFgColor;
338  }
339 
340  const QColor& desktopShadowColor() const {
341  return desktopShadowColor_;
342  }
343 
344  void setDesktopShadowColor(QColor desktopShadowColor) {
345  desktopShadowColor_ = desktopShadowColor;
346  }
347 
348  QFont desktopFont() const {
349  return desktopFont_;
350  }
351 
352  void setDesktopFont(QFont font) {
353  desktopFont_ = font;
354  }
355 
356  int desktopIconSize() const {
357  return desktopIconSize_;
358  }
359 
360  void setDesktopIconSize(int desktopIconSize) {
361  desktopIconSize_ = desktopIconSize;
362  }
363 
364  QStringList desktopShortcuts() const {
365  return desktopShortcuts_;
366  }
367 
368  void setDesktopShortcuts(const QStringList& list) {
369  desktopShortcuts_ = list;
370  }
371 
372  bool showWmMenu() const {
373  return showWmMenu_;
374  }
375 
376  void setShowWmMenu(bool value) {
377  showWmMenu_ = value;
378  }
379 
380  bool desktopShowHidden() const {
381  return desktopShowHidden_;
382  }
383 
384  void setDesktopShowHidden(bool desktopShowHidden) {
385  desktopShowHidden_ = desktopShowHidden;
386  }
387 
388 // bool desktopHideItems() const {
389 // return desktopHideItems_;
390 // }
391 
392 // void setDesktopHideItems(bool hide) {
393 // desktopHideItems_ = hide;
394 // }
395 
396  bool desktopAutoSort() const {
397  return desktopAutoSort_;
398  }
399 
400  void setDesktopAutoSort(bool hide) {
401  desktopAutoSort_ = hide;
402  }
403 
404  Qt::SortOrder desktopSortOrder() const {
405  return desktopSortOrder_;
406  }
407 
408  void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
409  desktopSortOrder_ = desktopSortOrder;
410  }
411 
412  Fm::FolderModel::ColumnId desktopSortColumn() const {
413  return desktopSortColumn_;
414  }
415 
416  void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
417  desktopSortColumn_ = desktopSortColumn;
418  }
419 
420  bool desktopSortFolderFirst() const {
421  return desktopSortFolderFirst_;
422  }
423 
424  void setDesktopSortFolderFirst(bool desktopFolderFirst) {
425  desktopSortFolderFirst_ = desktopFolderFirst;
426  }
427 
428  bool alwaysShowTabs() const {
429  return alwaysShowTabs_;
430  }
431 
432  void setAlwaysShowTabs(bool alwaysShowTabs) {
433  alwaysShowTabs_ = alwaysShowTabs;
434  }
435 
436  bool showTabClose() const {
437  return showTabClose_;
438  }
439 
440  void setShowTabClose(bool showTabClose) {
441  showTabClose_ = showTabClose;
442  }
443 
444  bool rememberWindowSize() const {
445  return rememberWindowSize_;
446  }
447 
448  void setRememberWindowSize(bool rememberWindowSize) {
449  rememberWindowSize_ = rememberWindowSize;
450  }
451 
452  int windowWidth() const {
453  if(rememberWindowSize_) {
454  return lastWindowWidth_;
455  }
456  else {
457  return fixedWindowWidth_;
458  }
459  }
460 
461  int windowHeight() const {
462  if(rememberWindowSize_) {
463  return lastWindowHeight_;
464  }
465  else {
466  return fixedWindowHeight_;
467  }
468  }
469 
470  bool windowMaximized() const {
471  if(rememberWindowSize_) {
472  return lastWindowMaximized_;
473  }
474  else {
475  return false;
476  }
477  }
478 
479  int fixedWindowWidth() const {
480  return fixedWindowWidth_;
481  }
482 
483  void setFixedWindowWidth(int fixedWindowWidth) {
484  fixedWindowWidth_ = fixedWindowWidth;
485  }
486 
487  int fixedWindowHeight() const {
488  return fixedWindowHeight_;
489  }
490 
491  void setFixedWindowHeight(int fixedWindowHeight) {
492  fixedWindowHeight_ = fixedWindowHeight;
493  }
494 
495  void setLastWindowWidth(int lastWindowWidth) {
496  lastWindowWidth_ = lastWindowWidth;
497  }
498 
499  void setLastWindowHeight(int lastWindowHeight) {
500  lastWindowHeight_ = lastWindowHeight;
501  }
502 
503  void setLastWindowMaximized(bool lastWindowMaximized) {
504  lastWindowMaximized_ = lastWindowMaximized;
505  }
506 
507  int splitterPos() const {
508  return splitterPos_;
509  }
510 
511  void setSplitterPos(int splitterPos) {
512  splitterPos_ = splitterPos;
513  }
514 
515  Fm::SidePane::Mode sidePaneMode() const {
516  return sidePaneMode_;
517  }
518 
519  void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
520  sidePaneMode_ = sidePaneMode;
521  }
522 
523  bool showMenuBar() const {
524  return showMenuBar_;
525  }
526 
527  void setShowMenuBar(bool showMenuBar) {
528  showMenuBar_ = showMenuBar;
529  }
530 
531  bool splitView() const {
532  return splitView_;
533  }
534 
535  void setSplitView(bool split) {
536  splitView_ = split;
537  }
538 
539  Fm::FolderView::ViewMode viewMode() const {
540  return viewMode_;
541  }
542 
543  void setViewMode(Fm::FolderView::ViewMode viewMode) {
544  viewMode_ = viewMode;
545  }
546 
547  bool showHidden() const {
548  return showHidden_;
549  }
550 
551  void setShowHidden(bool showHidden) {
552  showHidden_ = showHidden;
553  }
554 
555  bool sortCaseSensitive() const {
556  return sortCaseSensitive_;
557  }
558 
559  void setSortCaseSensitive(bool value) {
560  sortCaseSensitive_ = value;
561  }
562 
563 
564  bool placesHome() const {
565  return placesHome_;
566  }
567 
568  void setPlacesHome(bool placesHome) {
569  placesHome_ = placesHome;
570  }
571 
572  bool placesDesktop() const {
573  return placesDesktop_;
574  }
575 
576  void setPlacesDesktop(bool placesDesktop) {
577  placesDesktop_ = placesDesktop;
578  }
579 
580  bool placesApplications() const {
581  return placesApplications_;
582  }
583 
584  void setPlacesApplications(bool placesApplications) {
585  placesApplications_ = placesApplications;
586  }
587 
588  bool placesTrash() const {
589  return placesTrash_;
590  }
591 
592  void setPlacesTrash(bool placesTrash) {
593  placesTrash_ = placesTrash;
594  }
595 
596  bool placesRoot() const {
597  return placesRoot_;
598  }
599 
600  void setPlacesRoot(bool placesRoot) {
601  placesRoot_ = placesRoot;
602  }
603 
604  bool placesComputer() const {
605  return placesComputer_;
606  }
607 
608  void setPlacesComputer(bool placesComputer) {
609  placesComputer_ = placesComputer;
610  }
611 
612  bool placesNetwork() const {
613  return placesNetwork_;
614  }
615 
616  void setPlacesNetwork(bool placesNetwork) {
617  placesNetwork_ = placesNetwork;
618  }
619 
620  QSet<QString> getHiddenPlaces() const {
621  return hiddenPlaces_;
622  }
623 
624  void setHiddenPlace(const QString& str, bool hide) {
625  if(hide) {
626  hiddenPlaces_ << str;
627  }
628  else {
629  hiddenPlaces_.remove(str);
630  }
631  }
632 
633 
634  Qt::SortOrder sortOrder() const {
635  return sortOrder_;
636  }
637 
638  void setSortOrder(Qt::SortOrder sortOrder) {
639  sortOrder_ = sortOrder;
640  }
641 
642  Fm::FolderModel::ColumnId sortColumn() const {
643  return sortColumn_;
644  }
645 
646  void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
647  sortColumn_ = sortColumn;
648  }
649 
650  bool sortFolderFirst() const {
651  return sortFolderFirst_;
652  }
653 
654  void setSortFolderFirst(bool folderFirst) {
655  sortFolderFirst_ = folderFirst;
656  }
657 
658  bool showFilter() const {
659  return showFilter_;
660  }
661 
662  void setShowFilter(bool value) {
663  showFilter_ = value;
664  }
665 
666  bool pathBarButtons() const {
667  return pathBarButtons_;
668  }
669 
670  void setPathBarButtons(bool value) {
671  pathBarButtons_ = value;
672  }
673 
674  // settings for use with libfm
675  bool singleClick() const {
676  return singleClick_;
677  }
678 
679  void setSingleClick(bool singleClick) {
680  singleClick_ = singleClick;
681  }
682 
683  int autoSelectionDelay() const {
684  return autoSelectionDelay_;
685  }
686 
687  void setAutoSelectionDelay(int value) {
688  autoSelectionDelay_ = value;
689  }
690 
691  bool useTrash() const {
692  if(!supportTrash_) {
693  return false;
694  }
695  return useTrash_;
696  }
697 
698  void setUseTrash(bool useTrash) {
699  useTrash_ = useTrash;
700  }
701 
702  bool confirmDelete() const {
703  return confirmDelete_;
704  }
705 
706  void setConfirmDelete(bool confirmDelete) {
707  confirmDelete_ = confirmDelete;
708  }
709 
710  bool noUsbTrash() const {
711  return noUsbTrash_;
712  }
713 
714  void setNoUsbTrash(bool noUsbTrash) {
715  noUsbTrash_ = noUsbTrash;
716  fm_config->no_usb_trash = noUsbTrash_; // also set this to libfm since FmFileOpsJob reads this config value before trashing files.
717  }
718 
719  bool confirmTrash() const {
720  return confirmTrash_;
721  }
722 
723  void setConfirmTrash(bool value) {
724  confirmTrash_ = value;
725  }
726 
727  bool quickExec() const {
728  return quickExec_;
729  }
730 
731  void setQuickExec(bool value) {
732  quickExec_ = value;
733  fm_config->quick_exec = quickExec_;
734  }
735 
736  bool selectNewFiles() const {
737  return selectNewFiles_;
738  }
739 
740  void setSelectNewFiles(bool value) {
741  selectNewFiles_ = value;
742  }
743 
744  // bool thumbnailLocal_;
745  // bool thumbnailMax;
746 
747  int bigIconSize() const {
748  return bigIconSize_;
749  }
750 
751  void setBigIconSize(int bigIconSize) {
752  bigIconSize_ = bigIconSize;
753  }
754 
755  int smallIconSize() const {
756  return smallIconSize_;
757  }
758 
759  void setSmallIconSize(int smallIconSize) {
760  smallIconSize_ = smallIconSize;
761  }
762 
763  int sidePaneIconSize() const {
764  return sidePaneIconSize_;
765  }
766 
767  void setSidePaneIconSize(int sidePaneIconSize) {
768  sidePaneIconSize_ = sidePaneIconSize;
769  }
770 
771  int thumbnailIconSize() const {
772  return thumbnailIconSize_;
773  }
774 
775  QSize folderViewCellMargins() const {
776  return folderViewCellMargins_;
777  }
778 
779  void setFolderViewCellMargins(QSize size) {
780  folderViewCellMargins_ = size;
781  }
782 
783  QSize desktopCellMargins() const {
784  return desktopCellMargins_;
785  }
786 
787  void setDesktopCellMargins(QSize size) {
788  desktopCellMargins_ = size;
789  }
790 
791 
792  bool showThumbnails() {
793  return showThumbnails_;
794  }
795 
796  void setShowThumbnails(bool show) {
797  showThumbnails_ = show;
798  }
799 
800  void setThumbnailLocalFilesOnly(bool value) {
801  Fm::ThumbnailJob::setLocalFilesOnly(value);
802  }
803 
804  bool thumbnailLocalFilesOnly() const {
805  return Fm::ThumbnailJob::localFilesOnly();
806  }
807 
808  int maxThumbnailFileSize() const {
809  return Fm::ThumbnailJob::maxThumbnailFileSize();
810  }
811 
812  void setMaxThumbnailFileSize(int size) {
813  Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
814  }
815 
816  void setThumbnailIconSize(int thumbnailIconSize) {
817  thumbnailIconSize_ = thumbnailIconSize;
818  }
819 
820  bool siUnit() {
821  return siUnit_;
822  }
823 
824  void setSiUnit(bool siUnit) {
825  siUnit_ = siUnit;
826  // override libfm FmConfig settings. FIXME: should we do this?
827  fm_config->si_unit = (gboolean)siUnit_;
828  }
829 
830  bool backupAsHidden() const {
831  return backupAsHidden_;
832  }
833 
834  void setBackupAsHidden(bool value) {
835  backupAsHidden_ = value;
836  fm_config->backup_as_hidden = backupAsHidden_; // also set this to libfm since fm_file_info_is_hidden() reads this value internally.
837  }
838 
839  bool showFullNames() const {
840  return showFullNames_;
841  }
842 
843  void setShowFullNames(bool value) {
844  showFullNames_ = value;
845  }
846 
847  bool shadowHidden() const {
848  return shadowHidden_;
849  }
850 
851  void setShadowHidden(bool value) {
852  shadowHidden_ = value;
853  }
854 
855  bool onlyUserTemplates() const {
856  return onlyUserTemplates_;
857  }
858 
859  void setOnlyUserTemplates(bool value) {
860  onlyUserTemplates_ = value;
861  fm_config->only_user_templates = onlyUserTemplates_;
862  }
863 
864  bool templateTypeOnce() const {
865  return templateTypeOnce_;
866  }
867 
868  void setTemplateTypeOnce(bool value) {
869  templateTypeOnce_ = value;
870  fm_config->template_type_once = templateTypeOnce_;
871  }
872 
873  bool templateRunApp() const {
874  return templateRunApp_;
875  }
876 
877  void setTemplateRunApp(bool value) {
878  templateRunApp_ = value;
879  fm_config->template_run_app = templateRunApp_;
880  }
881 
882  // per-folder settings
883  FolderSettings loadFolderSettings(const Fm::FilePath& path) const;
884 
885  void saveFolderSettings(const Fm::FilePath& path, const FolderSettings& settings);
886 
887  void clearFolderSettings(const Fm::FilePath& path) const;
888 
889  bool searchNameCaseInsensitive() const {
890  return searchNameCaseInsensitive_;
891  }
892 
893  void setSearchNameCaseInsensitive(bool caseInsensitive) {
894  searchNameCaseInsensitive_ = caseInsensitive;
895  }
896 
897  bool searchContentCaseInsensitive() const {
898  return searchContentCaseInsensitive_;
899  }
900 
901  void setsearchContentCaseInsensitive(bool caseInsensitive) {
902  searchContentCaseInsensitive_ = caseInsensitive;
903  }
904 
905  bool searchNameRegexp() const {
906  return searchNameRegexp_;
907  }
908 
909  void setSearchNameRegexp(bool reg) {
910  searchNameRegexp_ = reg;
911  }
912 
913  bool searchContentRegexp() const {
914  return searchContentRegexp_;
915  }
916 
917  void setSearchContentRegexp(bool reg) {
918  searchContentRegexp_ = reg;
919  }
920 
921  bool searchRecursive() const {
922  return searchRecursive_;
923  }
924 
925  void setSearchRecursive(bool rec) {
926  searchRecursive_ = rec;
927  }
928 
929  bool searchhHidden() const {
930  return searchhHidden_;
931  }
932 
933  void setSearchhHidden(bool hidden) {
934  searchhHidden_ = hidden;
935  }
936 
937  QList<int> getCustomColumnWidths() const {
938  QList<int> l;
939  for(auto width : qAsConst(customColumnWidths_)) {
940  l << width.toInt();
941  }
942  return l;
943  }
944 
945  void setCustomColumnWidths(const QList<int> &widths) {
946  customColumnWidths_.clear();
947  for(auto width : widths) {
948  customColumnWidths_ << QVariant(width);
949  }
950  }
951 
952  QList<int> getHiddenColumns() const {
953  QList<int> l;
954  for(auto width : qAsConst(hiddenColumns_)) {
955  l << width.toInt();
956  }
957  return l;
958  }
959 
960  void setHiddenColumns(const QList<int> &columns) {
961  hiddenColumns_.clear();
962  for(auto column : columns) {
963  hiddenColumns_ << QVariant(column);
964  }
965  }
966 
967 private:
968  int toIconSize(int size, IconType type) const;
969 
970  QString profileName_;
971  bool supportTrash_;
972 
973  // NDEFileMAN specific
974  QString fallbackIconThemeName_;
975  bool useFallbackIconTheme_;
976 
977  OpenDirTargetType bookmarkOpenMethod_;
978  QString suCommand_;
979  QString terminal_;
980  bool mountOnStartup_;
981  bool mountRemovable_;
982  bool autoRun_;
983  bool closeOnUnmount_;
984 
985  int wallpaperMode_;
986  QString wallpaper_;
987  QString lastSlide_;
988  QString wallpaperDir_;
989  int slideShowInterval_;
990  bool wallpaperRandomize_;
991  QColor desktopBgColor_;
992  QColor desktopFgColor_;
993  QColor desktopShadowColor_;
994  QFont desktopFont_;
995  int desktopIconSize_;
996  QStringList desktopShortcuts_;
997  bool showWmMenu_;
998 
999  bool desktopShowHidden_;
1000  //bool desktopHideItems_;
1001  bool desktopAutoSort_;
1002  Qt::SortOrder desktopSortOrder_;
1003  Fm::FolderModel::ColumnId desktopSortColumn_;
1004  bool desktopSortFolderFirst_;
1005 
1006  bool alwaysShowTabs_;
1007  bool showTabClose_;
1008  bool rememberWindowSize_;
1009  int fixedWindowWidth_;
1010  int fixedWindowHeight_;
1011  int lastWindowWidth_;
1012  int lastWindowHeight_;
1013  bool lastWindowMaximized_;
1014  int splitterPos_;
1015  Fm::SidePane::Mode sidePaneMode_;
1016  bool showMenuBar_;
1017  bool splitView_;
1018 
1019  Fm::FolderView::ViewMode viewMode_;
1020  bool showHidden_;
1021  Qt::SortOrder sortOrder_;
1022  Fm::FolderModel::ColumnId sortColumn_;
1023  bool sortFolderFirst_;
1024  bool sortCaseSensitive_;
1025  bool showFilter_;
1026  bool pathBarButtons_;
1027 
1028  // settings for use with libfm
1029  bool singleClick_;
1030  int autoSelectionDelay_;
1031  bool useTrash_;
1032  bool confirmDelete_;
1033  bool noUsbTrash_; // do not trash files on usb removable devices
1034  bool confirmTrash_; // Confirm before moving files into "trash can"
1035  bool quickExec_; // Don't ask options on launch executable file
1036  bool selectNewFiles_;
1037 
1038  bool showThumbnails_;
1039 
1040  QString archiver_;
1041  bool siUnit_;
1042  bool backupAsHidden_;
1043  bool showFullNames_;
1044  bool shadowHidden_;
1045 
1046  bool placesHome_;
1047  bool placesDesktop_;
1048  bool placesApplications_;
1049  bool placesTrash_;
1050  bool placesRoot_;
1051  bool placesComputer_;
1052  bool placesNetwork_;
1053  QSet<QString> hiddenPlaces_;
1054 
1055  int bigIconSize_;
1056  int smallIconSize_;
1057  int sidePaneIconSize_;
1058  int thumbnailIconSize_;
1059 
1060  bool onlyUserTemplates_;
1061  bool templateTypeOnce_;
1062  bool templateRunApp_;
1063 
1064  QSize folderViewCellMargins_;
1065  QSize desktopCellMargins_;
1066 
1067  // search settings
1068  bool searchNameCaseInsensitive_;
1069  bool searchContentCaseInsensitive_;
1070  bool searchNameRegexp_;
1071  bool searchContentRegexp_;
1072  bool searchRecursive_;
1073  bool searchhHidden_;
1074 
1075  // detailed list columns
1076  QList<QVariant> customColumnWidths_;
1077  QList<QVariant> hiddenColumns_;
1078 };
1079 
1080 }
1081 
1082 #endif // NDEFILEMAN_SETTINGS_H
Definition: settings.h:42
Definition: settings.h:90
Definition: settings.h:49
Definition: settings.h:170
Definition: application.cpp:59