git repos / SagoImageBrowser

blame: src/preferencesdialog.h

normal view · raw

14cf904f Poul Sander 2026-06-22 18:18 1
/*
14cf904f Poul Sander 2026-06-22 18:18 2
MIT License
14cf904f Poul Sander 2026-06-22 18:18 3
14cf904f Poul Sander 2026-06-22 18:18 4
Copyright (c) 2026 Poul Sander
14cf904f Poul Sander 2026-06-22 18:18 5
14cf904f Poul Sander 2026-06-22 18:18 6
Permission is hereby granted, free of charge, to any person obtaining a copy
14cf904f Poul Sander 2026-06-22 18:18 7
of this software and associated documentation files (the "Software"), to deal
14cf904f Poul Sander 2026-06-22 18:18 8
in the Software without restriction, including without limitation the rights
14cf904f Poul Sander 2026-06-22 18:18 9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14cf904f Poul Sander 2026-06-22 18:18 10
copies of the Software, and to permit persons to whom the Software is
14cf904f Poul Sander 2026-06-22 18:18 11
furnished to do so, subject to the following conditions:
14cf904f Poul Sander 2026-06-22 18:18 12
14cf904f Poul Sander 2026-06-22 18:18 13
The above copyright notice and this permission notice shall be included in all
14cf904f Poul Sander 2026-06-22 18:18 14
copies or substantial portions of the Software.
14cf904f Poul Sander 2026-06-22 18:18 15
14cf904f Poul Sander 2026-06-22 18:18 16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14cf904f Poul Sander 2026-06-22 18:18 17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14cf904f Poul Sander 2026-06-22 18:18 18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14cf904f Poul Sander 2026-06-22 18:18 19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14cf904f Poul Sander 2026-06-22 18:18 20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
14cf904f Poul Sander 2026-06-22 18:18 21
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
14cf904f Poul Sander 2026-06-22 18:18 22
SOFTWARE.
14cf904f Poul Sander 2026-06-22 18:18 23
14cf904f Poul Sander 2026-06-22 18:18 24
*/
14cf904f Poul Sander 2026-06-22 18:18 25
10d6e6f8 Poul Sander 2026-02-24 18:40 26
#pragma once
10d6e6f8 Poul Sander 2026-02-24 18:40 27
10d6e6f8 Poul Sander 2026-02-24 18:40 28
#include <QDialog>
83f0e0bc Poul Sander 2026-05-30 17:59 29
#include <QKeySequence>
83f0e0bc Poul Sander 2026-05-30 17:59 30
#include <QMap>
10d6e6f8 Poul Sander 2026-02-24 18:40 31
10d6e6f8 Poul Sander 2026-02-24 18:40 32
class QComboBox;
4ae57f60 Poul Sander 2026-02-25 21:35 33
class QCheckBox;
459bad0f Poul Sander 2026-05-17 14:11 34
class QSpinBox;
83f0e0bc Poul Sander 2026-05-30 17:59 35
class QTabWidget;
83f0e0bc Poul Sander 2026-05-30 17:59 36
class QTableWidget;
10d6e6f8 Poul Sander 2026-02-24 18:40 37
10d6e6f8 Poul Sander 2026-02-24 18:40 38
class PreferencesDialog : public QDialog
10d6e6f8 Poul Sander 2026-02-24 18:40 39
{
10d6e6f8 Poul Sander 2026-02-24 18:40 40
    Q_OBJECT
10d6e6f8 Poul Sander 2026-02-24 18:40 41
10d6e6f8 Poul Sander 2026-02-24 18:40 42
public:
10d6e6f8 Poul Sander 2026-02-24 18:40 43
    explicit PreferencesDialog(QWidget *parent = nullptr);
10d6e6f8 Poul Sander 2026-02-24 18:40 44
10d6e6f8 Poul Sander 2026-02-24 18:40 45
    QString getBackgroundColor() const;
10d6e6f8 Poul Sander 2026-02-24 18:40 46
    void setBackgroundColor(const QString &color);
10d6e6f8 Poul Sander 2026-02-24 18:40 47
459bad0f Poul Sander 2026-05-17 14:11 48
    int getCacheSize() const;
459bad0f Poul Sander 2026-05-17 14:11 49
    void setCacheSize(int n);
459bad0f Poul Sander 2026-05-17 14:11 50
ac476ca8 Poul Sander 2026-05-18 16:47 51
    QString getThumbnailCacheSize() const;
ac476ca8 Poul Sander 2026-05-18 16:47 52
    void setThumbnailCacheSize(const QString &size);
ac476ca8 Poul Sander 2026-05-18 16:47 53
4ae57f60 Poul Sander 2026-02-25 21:35 54
    bool getLockDocking() const;
4ae57f60 Poul Sander 2026-02-25 21:35 55
    void setLockDocking(bool lock);
4ae57f60 Poul Sander 2026-02-25 21:35 56
d1aa6cbe Poul Sander 2026-03-02 16:57 57
    bool getResetLayout() const;
d1aa6cbe Poul Sander 2026-03-02 16:57 58
    void setResetLayout(bool reset);
d1aa6cbe Poul Sander 2026-03-02 16:57 59
83f0e0bc Poul Sander 2026-05-30 17:59 60
    QMap<int, QKeySequence> getShortcuts() const;
83f0e0bc Poul Sander 2026-05-30 17:59 61
    void setShortcuts(const QMap<int, QKeySequence> &map);
83f0e0bc Poul Sander 2026-05-30 17:59 62
8cb93c2f Poul Sander 2026-06-28 19:31 63
    QStringList getRootLabels() const;
8cb93c2f Poul Sander 2026-06-28 19:31 64
    void setRootLabels(const QStringList &labels);
8cb93c2f Poul Sander 2026-06-28 19:31 65
8cb93c2f Poul Sander 2026-06-28 19:31 66
    QStringList getRootPaths() const;
8cb93c2f Poul Sander 2026-06-28 19:31 67
    void setRootPaths(const QStringList &paths);
8cb93c2f Poul Sander 2026-06-28 19:31 68
7370f1c0 Poul Sander 2026-03-01 15:15 69
signals:
7370f1c0 Poul Sander 2026-03-01 15:15 70
    void resetLayoutRequested();
7370f1c0 Poul Sander 2026-03-01 15:15 71
10d6e6f8 Poul Sander 2026-02-24 18:40 72
private:
83f0e0bc Poul Sander 2026-05-30 17:59 73
    void setupGeneralTab(QTabWidget *tabs);
83f0e0bc Poul Sander 2026-05-30 17:59 74
    void setupShortcutsTab(QTabWidget *tabs);
8cb93c2f Poul Sander 2026-06-28 19:31 75
    void setupRootsTab(QTabWidget *tabs);
83f0e0bc Poul Sander 2026-05-30 17:59 76
    void highlightConflicts();
83f0e0bc Poul Sander 2026-05-30 17:59 77
10d6e6f8 Poul Sander 2026-02-24 18:40 78
    QComboBox *m_backgroundColorCombo;
459bad0f Poul Sander 2026-05-17 14:11 79
    QSpinBox  *m_cacheSizeSpinBox;
ac476ca8 Poul Sander 2026-05-18 16:47 80
    QComboBox *m_thumbnailSizeCombo;
4ae57f60 Poul Sander 2026-02-25 21:35 81
    QCheckBox *m_lockDockingCheck;
d1aa6cbe Poul Sander 2026-03-02 16:57 82
    QCheckBox *m_resetLayoutCheck;
83f0e0bc Poul Sander 2026-05-30 17:59 83
    QTableWidget *m_shortcutsTable = nullptr;
8cb93c2f Poul Sander 2026-06-28 19:31 84
    QTableWidget *m_rootsTable = nullptr;
83f0e0bc Poul Sander 2026-05-30 17:59 85
    QList<int> m_rowToAction;  // maps table row → ShortcutManager::Action
10d6e6f8 Poul Sander 2026-02-24 18:40 86
};
1970-01-01 00:00 87