Warning, /maui/index-fm/src/widgets/views/SettingsDialog.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.14
0002 import QtQuick.Controls 2.14
0003 import QtQuick.Layouts 1.3
0004 
0005 import org.mauikit.controls 1.3 as Maui
0006 import org.mauikit.filebrowsing 1.3 as FB
0007 
0008 
0009 Maui.SettingsDialog
0010 {
0011     id: control
0012 
0013     Maui.SectionGroup
0014     {
0015         title: i18n("Behaviour")
0016 //        description: i18n("Configure the app plugins and behavior.")      
0017 
0018         Maui.SectionItem
0019         {
0020             label1.text:  i18n("Save Session")
0021             label2.text: i18n("Save and restore tabs.")
0022 
0023             Switch
0024             {
0025                 checkable: true
0026                 checked:  settings.restoreSession
0027                 onToggled: settings.restoreSession = !settings.restoreSession
0028             }
0029         }
0030 
0031         Maui.SectionItem
0032         {
0033             label1.text:  i18n("Dynamic Preferences")
0034             label2.text: i18n("Save custom preferences per directory, otherwise use the default preferences.")
0035 
0036             Switch
0037             {
0038                 checkable: true
0039                 checked:  settings.dirConf
0040                 onToggled: settings.dirConf = !settings.dirConf
0041             }
0042         }
0043 
0044         Maui.SectionItem
0045         {
0046             enabled: Maui.Handy.isLinux
0047             label1.text:  i18n("Sync Terminal")
0048             label2.text: i18n("Sync the terminal current working directory to the browser location.")
0049 
0050             Switch
0051             {
0052                 checkable: true
0053                 checked:  settings.syncTerminal
0054                 onToggled: settings.syncTerminal = !settings.syncTerminal
0055             }
0056         }
0057     }    
0058     
0059     Maui.SectionGroup
0060     {
0061         title: i18n("Previews")
0062 //        description: i18n("Configure the app plugins and behavior.")      
0063 
0064         Maui.SectionItem
0065         {
0066             enabled: Maui.Handy.isLinux && !Maui.Handy.islinux
0067             label1.text: i18n("Open in Window")
0068             label2.text: i18n("Show the file previews in a new window.")
0069 
0070             Switch
0071             {
0072                 checkable: true
0073                 checked:  appSettings.previewerWindow
0074                 onToggled: appSettings.previewerWindow = !appSettings.previewerWindow
0075             }
0076         }
0077 
0078         Maui.SectionItem
0079         {
0080             label1.text:  i18n("Autoplay")
0081             label2.text: i18n("Auto start playing audio and video file previews.")
0082 
0083             Switch
0084             {
0085                 checkable: true
0086                 checked:  appSettings.autoPlayPreviews
0087                 onToggled: appSettings.autoPlayPreviews = !appSettings.autoPlayPreviews
0088             }
0089         }
0090 
0091         Maui.SectionItem
0092         {
0093             label1.text:  i18n("Prefer Preview")
0094             label2.text: i18n("Open files in a preview mode instead of opening them in a dedicated application.")
0095 
0096             Switch
0097             {
0098                 checkable: true
0099                 checked:  appSettings.previewFiles
0100                 onToggled: appSettings.previewFiles = !appSettings.previewFiles
0101             }
0102         }
0103     }
0104 
0105     Maui.SectionGroup
0106     {
0107         title: i18n("Browsing & Navigation")
0108 
0109         Maui.SectionItem
0110         {
0111             label1.text: i18n("Thumbnails")
0112             label2.text: i18n("Show previews of images, videos and PDF files.")
0113 
0114             Switch
0115             {
0116                 checkable: true
0117                 checked:  settings.showThumbnails
0118                 onToggled: settings.showThumbnails = ! settings.showThumbnails
0119             }
0120         }
0121 
0122         Maui.SectionItem
0123         {
0124             label1.text:  i18n("View Type")
0125             label2.text: i18n("Default view type.")
0126 
0127             Maui.ToolActions
0128             {
0129                 autoExclusive: true
0130                 expanded: true
0131                 display: ToolButton.IconOnly
0132 
0133                 Action
0134                 {
0135                     text: i18n("List")
0136                     icon.name: "view-list-details"
0137                     checked: appSettings.viewType === FB.FMList.LIST_VIEW
0138                     checkable: true
0139                     onTriggered:
0140                     {
0141                         appSettings.viewType = FB.FMList.LIST_VIEW
0142                     }
0143                 }
0144 
0145                 Action
0146                 {
0147                     text: i18n("Grid")
0148                     icon.name: "view-list-icons"
0149                     checked:  appSettings.viewType === FB.FMList.ICON_VIEW
0150                     checkable: true
0151 
0152                     onTriggered:
0153                     {
0154                         appSettings.viewType = FB.FMList.ICON_VIEW
0155                     }
0156                 }
0157             }
0158         }
0159 
0160         Maui.SectionItem
0161         {
0162             label1.text:  i18n("Sort")
0163             label2.text: i18n("Default sorting value.")
0164 
0165             Maui.ToolButtonMenu
0166             {
0167                 icon.name: "view-sort"
0168 
0169                 onToggled: open()
0170                 checkable: true
0171 
0172                 Action
0173                 {
0174                     text: i18n("Type")
0175                     checked: sortSettings.sortBy === FB.FMList.MIME
0176                     checkable: true
0177 
0178                     onTriggered:
0179                     {
0180                         sortSettings.sortBy = FB.FMList.MIME
0181                     }
0182                 }
0183 
0184                 Action
0185                 {
0186                     text: i18n("Date")
0187                     checked: sortSettings.sortBy === FB.FMList.DATE
0188                     checkable: true
0189                     onTriggered:
0190                     {
0191                         sortSettings.sortBy = FB.FMList.DATE
0192                     }
0193                 }
0194 
0195                 Action
0196                 {
0197                     text: i18n("Modified")
0198                     checked: sortSettings.sortBy === FB.FMList.MODIFIED
0199                     checkable: true
0200                     onTriggered:
0201                     {
0202                         sortSettings.sortBy = FB.FMList.MODIFIED
0203                     }
0204                 }
0205 
0206                 Action
0207                 {
0208                     text: i18n("Size")
0209                     checked: sortSettings.sortBy === FB.FMList.SIZE
0210                     checkable: true
0211                     onTriggered:
0212                     {
0213                         sortSettings.sortBy = FB.FMList.SIZE
0214                     }
0215                 }
0216 
0217                 Action
0218                 {
0219                     text: i18n("Name")
0220                     checked:  sortSettings.sortBy === FB.FMList.LABEL
0221                     checkable: true
0222                     onTriggered:
0223                     {
0224                         sortSettings.sortBy = FB.FMList.LABEL
0225                     }
0226                 }
0227 
0228                 MenuSeparator{}
0229 
0230                 MenuItem
0231                 {
0232                     text: i18n("Show Folders First")
0233                     checked:   sortSettings.foldersFirst
0234                     checkable: true
0235 
0236                     onTriggered:
0237                     {
0238                     sortSettings.foldersFirst =  !sortSettings.foldersFirst
0239 
0240                     }
0241                 }
0242 
0243                 MenuItem
0244                 {
0245                     id: groupAction
0246                     text: i18n("Group")
0247                     checkable: true
0248                     checked: sortSettings.group
0249                     onTriggered:
0250                     {
0251                         sortSettings.group = !sortSettings.group
0252                     }
0253                 }
0254             }
0255         }
0256 
0257 
0258     }
0259 
0260     Maui.SectionGroup
0261     {
0262         title: i18n("Interface")
0263 //        description: i18n("Configure the app UI.")
0264 
0265         Maui.SectionItem
0266         {
0267             label1.text: i18n("Grid Items Size")
0268             label2.text: i18n("Size of the grid view.")
0269 
0270             Maui.ToolActions
0271             {
0272                 expanded: true
0273                 autoExclusive: true
0274                 display: ToolButton.TextOnly
0275 
0276                 //                currentIndex: appSettings.gridSize
0277 
0278                 //                Action
0279                 //                {
0280                 //                    text: i18n("S")
0281                 //                    onTriggered: appSettings.gridSize = 0
0282                 //                }
0283 
0284                 Action
0285                 {
0286                     text: i18n("M")
0287                     checked: appSettings.gridSize === 1
0288                     onTriggered: appSettings.gridSize = 1
0289                 }
0290 
0291                 Action
0292                 {
0293                     text: i18n("L")
0294                     checked: appSettings.gridSize === 2
0295                     onTriggered: appSettings.gridSize = 2
0296                 }
0297 
0298                 Action
0299                 {
0300                     text: i18n("X")
0301                     checked: appSettings.gridSize === 3
0302                     onTriggered: appSettings.gridSize = 3
0303                 }
0304 
0305                 Action
0306                 {
0307                     text: i18n("XL")
0308                     checked: appSettings.gridSize === 4
0309                     onTriggered: appSettings.gridSize = 4
0310                 }
0311             }
0312         }
0313 
0314         Maui.SectionItem
0315         {
0316             label1.text: i18n("List Items Size")
0317             label2.text: i18n("Size of the list view.")
0318 
0319             Maui.ToolActions
0320             {
0321                 expanded: true
0322                 autoExclusive: true
0323                 display: ToolButton.TextOnly
0324 
0325                 Action
0326                 {
0327                     text: i18n("S")
0328                     onTriggered: appSettings.listSize = 0
0329                     checked: appSettings.listSize === 0
0330                 }
0331 
0332                 Action
0333                 {
0334                     text: i18n("M")
0335                     onTriggered: appSettings.listSize = 1
0336                     checked: appSettings.listSize === 1
0337                 }
0338 
0339                 Action
0340                 {
0341                     text: i18n("L")
0342                     onTriggered: appSettings.listSize = 2
0343                     checked: appSettings.listSize === 2
0344                 }
0345 
0346                 Action
0347                 {
0348                     text: i18n("X")
0349                     onTriggered: appSettings.listSize = 3
0350                     checked: appSettings.listSize === 3
0351                 }
0352             }
0353         }
0354 
0355         Maui.SectionItem
0356         {
0357             label1.text: i18n("Overview")
0358             label2.text: i18n("Use overview mode as default on launch.")
0359 
0360             Switch
0361             {
0362                 checked:  appSettings.overviewStart
0363                 onToggled: appSettings.overviewStart = !appSettings.overviewStart
0364             }
0365         }
0366     }
0367     
0368       Maui.SectionGroup
0369     {
0370         title: i18n("Terminal")
0371        description: i18n("Embedded terminal options.")       
0372        enabled: Maui.Handy.isLinux
0373 
0374         Maui.SectionItem
0375         {
0376            label1.text: i18n("Adaptive Color Scheme")
0377             label2.text: i18n("Colors based on the current style.")
0378 
0379             Switch
0380             {
0381                 checked: appSettings.terminalFollowsColorScheme
0382                 onToggled: appSettings.terminalFollowsColorScheme = !appSettings.terminalFollowsColorScheme
0383             }
0384         }
0385         
0386         Maui.SectionItem
0387         {
0388             label1.text: i18n("Color Scheme")
0389             label2.text: i18n("Change the color scheme of the terminal.")
0390             enabled: !appSettings.terminalFollowsColorScheme
0391 
0392             ToolButton
0393             {
0394                 checkable: true
0395                 icon.name: "go-next"
0396                 onToggled: 
0397                 {
0398                     var component = Qt.createComponent("TerminalColorSchemes.qml");
0399     var page = component.createObject(control);
0400                     control.addPage(page)
0401                 }
0402             }
0403         }
0404     }
0405 
0406     Maui.SectionItem
0407     {
0408         label1.text: i18n("Quick places")
0409         label2.text: i18n("Access to standard locations.")
0410 
0411         ToolButton
0412         {
0413             checkable: true
0414             icon.name: "go-next"
0415             onToggled: control.addPage(_sidebarPlacesComponent)
0416         }
0417     }
0418     
0419 
0420     Component
0421     {
0422         id: _sidebarPlacesComponent
0423 
0424         Maui.SettingsPage
0425         {
0426             title: i18n("Places")
0427 
0428             Maui.SectionGroup
0429             {
0430                 title: i18n("Places")
0431 //                description: i18n("Toggle sidebar sections.")
0432 
0433                 Maui.SectionItem
0434                 {
0435                     label1.text: i18n("Quick places")
0436                     label2.text: i18n("Access to standard locations.")
0437 
0438                     Switch
0439                     {
0440                         checkable: true
0441                         checked: appSettings.quickSidebarSection
0442                         onToggled: appSettings.quickSidebarSection = !appSettings.quickSidebarSection
0443                     }
0444                 }
0445 
0446                 Maui.SectionItem
0447                 {
0448                     label1.text: i18n("Bookmarks")
0449                     label2.text: i18n("Access to standard locations.")
0450 
0451                     Switch
0452                     {
0453                         checkable: true
0454                         checked: appSettings.sidebarSections.indexOf(FB.FMList.BOOKMARKS_PATH) >= 0
0455                         onToggled:
0456                         {
0457                             toggleSection(FB.FMList.BOOKMARKS_PATH)
0458                         }
0459                     }
0460                 }
0461 
0462                 Maui.SectionItem
0463                 {
0464                     label1.text: i18n("Remote")
0465                     label2.text: i18n("Access to network locations.")
0466 
0467                     Switch
0468                     {
0469                         checkable: true
0470                         checked: appSettings.sidebarSections.indexOf(FB.FMList.REMOTE_PATH)>= 0
0471                         onToggled:
0472                         {
0473                             toggleSection(FB.FMList.REMOTE_PATH)
0474                         }
0475                     }
0476 
0477                 }
0478 
0479                 Maui.SectionItem
0480                 {
0481                     label1.text: i18n("Removable")
0482                     label2.text: i18n("Access to USB sticks and SD Cards.")
0483 
0484                     Switch
0485                     {
0486                         checkable: true
0487                         checked: appSettings.sidebarSections.indexOf(FB.FMList.REMOVABLE_PATH)>= 0
0488                         onToggled:
0489                         {
0490                             toggleSection(FB.FMList.REMOVABLE_PATH)
0491                         }
0492                     }
0493                 }
0494 
0495                 Maui.SectionItem
0496                 {
0497                     label1.text: i18n("Devices")
0498                     label2.text: i18n("Access drives.")
0499 
0500                     Switch
0501                     {
0502                         checkable: true
0503                         checked: appSettings.sidebarSections.indexOf(FB.FMList.DRIVES_PATH)>= 0
0504                         onToggled:
0505                         {
0506                             toggleSection(FB.FMList.DRIVES_PATH)
0507                         }
0508                     }
0509                 }
0510             }
0511         }
0512     }
0513 }