Namespace sh::ui::qt

namespace sh::ui::qt

The Qt user interface implementation.

This is the default UI. It builds a desktop application based on the Qt gui components.

class LineEditWithKeyboardShortcuts : public QLineEdit
#include <qtjumpbar.h>

Helper widget of QtJumpBar.

Public Functions

LineEditWithKeyboardShortcuts(QWidget *parent = 0)

Signals

void enterPressed()
void escapePressed()
class QtAboutDialog : public sh::ui::qt::QtDialog, public sh::ui::AboutDialog
#include <qtaboutdialog.h>

Qt based about dialog.

Public Functions

QtAboutDialog()
~QtAboutDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

Ui::QtAboutDialog *ui

Private Slots

void on_btnClose_clicked()
void on_btnLicense_clicked()
void on_btnHomepage_clicked()
class QtActionExecutionInfoDialog : public QDialog, public sh::ui::ActionExecutionInfoDialog
#include <qtactionexecutioninfodialog.h>

Qt progress dialog for action executions.

Public Types

enum MessageBoxButton

Buttons in a message box from ActionExecutionUserFeedback.

Values:

enumerator NONE = 0
enumerator OK = 1 << 0
enumerator Continue = 1 << 1
enumerator Cancel = 1 << 2
enumerator Retry = 1 << 3
enumerator Yes = 1 << 4
enumerator No = 1 << 5

Public Functions

QtActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info, QWidget *parent = 0)
~QtActionExecutionInfoDialog()
void setDetails(QString fv, QString fob, QString tv, QString tob)

Sets the item details text (‘from a/foo.jpg’, ‘to b/foo.jpg’). .

void setHead(QString txt)

Sets the header text. .

void setProgress(bool isDeterminate, quint64 done, quint64 all, QString text)

Sets the progress. .

int messageBox(QString text, QList<QString> answers, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, QList<QString> answericons = QList<QString>())
int inputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int multilineInputBox(QString text, QList<QString> answers, QString *value, QString icon = QString(), int defaultanswer = -1, int cancelanswer = -1)
int simpleChooserGridform(QString text, GridformEntries *entries, QStringList answers, int defaultanswer = -1, int cancelanswer = -1)
bool credentialsDialog(QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember, QString *domain, QString *username, QString *password, bool *isAnonymous, bool *isRemember)
bool unixPermissionsDialog(bool *userMayRead, bool *userMayWrite, bool *userMayExecute, bool *groupMayRead, bool *groupMayWrite, bool *groupMayExecute, bool *othersMayRead, bool *othersMayWrite, bool *othersMayExecute, bool *sticky, bool *setuid, bool *setgid, QStringList users, QStringList groups, QString *ownerUser, QString *ownerGroup)
void setLogicallyVisible(bool v)

Sets if this dialog is logically visible (i.e. set visible by the action). .

void setBackground(bool v)

Sets if this dialog is currently in background mode (i.e. not visible). .

void setForceForeground(bool v)

Sets if this dialog is currently forced to be visible in foreground. .

bool isLogicallyVisible()

Returns if this dialog is logically visible (i.e. set visible by the action).

bool isBackground()

Returns if this dialog is currently in background mode (i.e. not visible).

QString simpleInputBox(QString text, QString deflt, int valuePreselectFrom = -1, int valuePreselectTo = -1)
int simpleMessageBox(QString text, int buttons = (int)MessageBoxButton::OK, QString icon = QString(), int defaultbutton = (MessageBoxButton)0, int cancelbutton = (MessageBoxButton)0)

Private Functions

void _computevisibility()

Private Members

Ui::QtActionExecutionInfoDialog *ui
sh::ui::qt::feedbackpanels::FeedbackPanel *currentFeedbackPanel = 0

Private Slots

void on_btnCancel_clicked()
void on_btnBackground_clicked()
class QtActionExecutionInfoPanel : public QWidget, public sh::ui::ActionExecutionInfoPanel
#include <qtactionexecutioninfopanel.h>

Qt status bar info-panel for an action execution.

Public Functions

QtActionExecutionInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color, QWidget *parent = 0)
void setLabel(QString s)

Sets the label text. .

void setWidth(int width)

Sets the panel with (in pixels). .

QSize sizeHint() const
void setProgress(bool isProgressDeterminate, quint64 progressDone, quint64 progressAll)

Sets the progress. .

void setForceForeground(bool v)

Sets if the associated action is currently forced to be visible in foreground. .

void setPanelVisible(bool v)

Sets if the panel is visible. .

void onClicked(std::function<void()> fctQObject *owner = 0, )

Sets a handler for a click on the button (optionally bound to an owner lifetime).

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

void onVisibilityChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel visibility changes (optionally bound to an owner lifetime).

Private Functions

void _check_indeterminateanimationtimer_enable()

Private Members

QString lbl1
bool _progressDeterminate = false
int _indeterminateAnimationCounter = 0
int _width
QTimer *_indeterminateAnimationTimer
quint64 _progressAll
quint64 _progressDone
bool _isforeground_forced = false
sh::actions::ActionExecutionInfo *info
QPixmap gradient
QColor colorProgress2
QColor colorProgress1
QColor colorBase
QColor colorFrame
QColor colorText
QColor colorTextDark
class QtActionMenu : public QMenu
#include <qtactionmenu.h>

Qt based action menu used for context menus and in the toolbar.

Public Functions

QtActionMenu(QWidget *parent = 0)
void setHeader(QString t)
QList<QAction*> allActions()
void clearAllActions()
void removeActionAt(int i)
QAction *addNewAction(int i = -1)
QAction *addNewSubMenu(sh::ui::qt::QtActionMenu **qsubmenu, int i = -1)
QAction *addNewSeparator(int i = -1)
QAction *addNewHeader(int i = -1)
bool actionIsHeader(QAction *a)

Private Functions

void _observeAction(QAction *a)
void _correctMenuPosition()

Private Members

QColor brandingcolor
QFont _boldfont
QFont _normalfont
int _origMenuPosX = -1
int _origMenuPosY = -1
QString _header
int _cntInternalActions
class QtActionMenuHandler
#include <qtactionmenuhandler.h>

A handler which reflects the sh::actions objects to a graphical menu (and keeps that up-to-date).

Public Functions

QtActionMenuHandler(std::shared_ptr<sh::actions::ActionInstantiation> ai, std::shared_ptr<QtActionMenu> menu)

Private Functions

void _markDefault2()
void _append_actions(sh::ui::qt::QtActionMenu *menu, QList<std::shared_ptr<sh::actions::ActionInstantiation>> acts, std::shared_ptr<sh::actions::ActionCategory> category)

Private Members

QList<std::shared_ptr<sh::actions::ActionInstantiation>> selacts
QList<std::shared_ptr<sh::actions::ActionInstantiation>> diracts
QHash<QAction*, std::shared_ptr<sh::actions::AbstractActionItem>> qaction2action
std::weak_ptr<QtActionMenu> menu

Private Static Functions

std::shared_ptr<sh::actions::ActionActionItem> _getDefaultAction(QList<std::shared_ptr<sh::actions::AbstractActionItem>> actionList)
void _markDefault(std::weak_ptr<sh::actions::SubmenuActionItem> itmSubmenu, sh::ui::qt::QtActionMenu *menu)
QAction *_createAndConnectAction(sh::actions::AbstractActionItem *itm, sh::ui::qt::QtActionMenu *menu, std::function<void()> onchangedQObject *onchangedbuddy = 0, )
void _applyPropertiesToQAction(sh::actions::AbstractActionItem *itm, QAction *_widgetaction)
void _updateSubmenu(sh::actions::SubmenuActionItem *itm, QtActionMenu *menu, std::function<void()> onchanged = 0)

Friends

friend class QtToolbarButtonHandler
class QtDialog : public QDialog
#include <qtdialog.h>

Abstract base class for a qt based dialog. Typically used for also implementing some sh::ui::Dialog.

Subclassed by sh::ui::qt::QtAboutDialog, sh::ui::qt::QtExceptionDialog, sh::ui::qt::QtFilePropertyDialog, sh::ui::qt::QtLogViewDialog, sh::ui::qt::QtManageBookmarksDialog, sh::ui::qt::QtManageProfilesDialog, sh::ui::qt::QtOpenWithDialog, sh::ui::qt::QtStoreProfileDialog, sh::ui::qt::QtTuningDialog

Public Functions

QtDialog()
class QtDialogManager : public sh::ui::DialogManager
#include <qtdialog.h>

A DialogManager used in Qt ui.

Public Functions

std::shared_ptr<Dialog> getDialogById(qint64 id)

Returns a Dialog by dialog id.

Must be called in main thread.

QList<std::shared_ptr<Dialog>> getAllDialogs()

Returns a list of all dialogs currently shown (in order of creation).

Must be called in main thread.

QList<qint64> getAllDialogIds()

Returns a list of dialog ids of all dialogs currently shown (in order of creation).

Must be called in main thread.

template<class TDlg, typename ...Args>
std::shared_ptr<TDlg> createAndShowDialog(Args... args)

Creates and shows a Dialog by class and constructor parameters.

Those dialogs (TDlg) have to implement Dialog (typically a subclass of it, representing a particular dialog, like FilePropertyDialog), and also some ui mode (e.g. qt, web) specific class (depends on that ui mode).

You typically should not have to use it outside of MainWindow or subclasses. The MainWindow interface allows to create all available dialogs in a ui mode independent way.

May be called in any thread.

Return

The created Dialog instance.

Private Functions

void showDialog(std::shared_ptr<Dialog> dialog) override

This method implements the ui mode specific mechanism for showing a dialog.

Must be called in main thread.

class QtExceptionDialog : public sh::ui::qt::QtDialog, public sh::ui::ExceptionDialog
#include <qtexceptiondialog.h>

Qt based exception dialog.

Public Functions

QtExceptionDialog(QString error1, QString error2, QString details, QString icon, bool mayRetry, bool mayClose, bool mayCancel, bool showLoglabelAndDetails)
~QtExceptionDialog()
ExceptionDialogResult answer() override

Returns the answer the user has given in this dialog.

QString error1()

Returns the 1st error text.

QString error2()

Returns the 2nd error text.

QString details()

Returns the error details.

QString icon()

Returns the icon (as name resolveable by sh::base::IconManager).

bool mayRetry()

Returns if it’s allowed to retry.

bool mayClose()

Returns if it’s allowed to just close and continue without closing Shallot.

bool mayCancel()

Returns if it’s allowed to cancel, i.e. throwing a sh::exceptions::CancelException.

bool showLoglabelAndDetails()

Returns if the dialog shall allow to read the details.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

Ui::QtExceptionDialog *ui
ExceptionDialogResult _answer = ExceptionDialogResult::Shutdown

Private Slots

void on_btnExit_clicked()
void on_btnClose_clicked()
void on_btnCancel_clicked()
void on_btnRetry_clicked()
void on_btnShowLog_clicked()
void on_btnExitAndSaveLog_clicked()
void on_btnShowDetails_toggled(bool checked)
class QtFileDetailsPanel : public QWidget
#include <qtfiledetailspanel.h>

The details panel.

Can be shown in the main window. It presents detail information about the selected file.

Public Functions

QtFileDetailsPanel(QWidget *parent = 0)
void setNodes(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void setOrientation(Qt::Orientation orientation)
QSize sizeHint() const override
~QtFileDetailsPanel()

Private Members

int PADDINGX
int PADDINGY
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> _nodes
QList<std::shared_ptr<sh::paneldetails::PanelDetail>> _panelDetails
QList<DetailPlacement> _placements
QFont fontNormal
QFont fontBold
QPixmap _widgetimagecache
QTimer _widgetimagecachetimer
Qt::Orientation _orientation = Qt::Horizontal
class DetailPlacement
#include <qtfiledetailspanel.h>

Public Functions

DetailPlacement(int x, int y, int w, int h, QList<DetailRowPlacement> rowplacements, std::shared_ptr<sh::paneldetails::PanelDetail> detail)

Public Members

std::shared_ptr<sh::paneldetails::PanelDetail> detail
int x
int y
int w
int h
QList<DetailRowPlacement> rowplacements
class DetailRowPlacement
#include <qtfiledetailspanel.h>

Public Functions

DetailRowPlacement(int h, int contentx, int contenty, QList<int> elementwidths)
DetailRowPlacement() = default
DetailRowPlacement(const DetailRowPlacement&) = default

Public Members

int h
int contentx
int contenty
QList<int> elementwidths
class QtFileIconview : public QListView, public sh::ui::qt::QtFileView
#include <qtfileiconview.h>

Icon view for the contents of one directory.

Public Functions

QtFileIconview(QWidget *parent = 0)

Constructed only by the infrastructure and made available otherwise.

void setThumbDimension(double size)

Sets the size of the thumbnail image.

void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
void setSort(int column, Qt::SortOrder order)
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Members

int _deleg_w = 0
int _deleg_h = 0
int _dsx = 0
int _dsy = 0
int _lineheight = 0
class QtFileList : public QTreeView, public sh::ui::qt::QtFileView
#include <qtfilelist.h>

List view for the contents of one directory.

Public Functions

QtFileList(QWidget *parent = 0)

Constructed only by the infrastructure and made available otherwise.

void setSort(int column, Qt::SortOrder order) override
void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Functions

QString getColumnNameForIndex(int index)
void _adaptColumnWidth(int index)

Private Members

bool _skip_slot_sectionResized = false

Private Slots

void slot_sectionResized(int index, int oldsize, int newsize)

Private Static Attributes

std::shared_ptr<sh::configuration::ConfigurationValue> cfgvalFileListIconSize = sh::configuration::ConfigurationManager::instance()->registerConfigValue("sh::ui::qt::QtFileList.FileListIconSize", -1, sh::configuration::ConfigurationValue::valueTypeInteger(), QObject::tr("Icon size in file list panels"), sh::configuration::ConfigurationCategory::CategoryGUI, QString(), QObject::tr("For default size, set it to -1."))
class QtFilePropertyDialog : public sh::ui::qt::QtDialog, public sh::ui::FilePropertyDialog
#include <qtfilepropertydialog.h>

Qt based properties dialog.

Public Functions

~QtFilePropertyDialog()
QtFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Constructed only by the infrastructure and made available otherwise.

void init(std::shared_ptr<Dialog> dialog) override

Executes custom stuff on initialization, e.g. for populating the dialog.

void refresh() override

Refreshes the dialog content.

sh::ui::FilePropertyDialogTabTableView *createTabViewTable() override

Creates a new tab view table sub-widget.

sh::ui::FilePropertyDialogTabTextView *createTabViewText() override

Creates a new tab view text sub-widget.

sh::ui::FilePropertyDialogTabIconTextBannerView *createTabViewIconTextBanner() override

Creates a new tab view icon text banner sub-widget.

QList<std::shared_ptr<FilePropertyDialogTab>> tabs()

Returns a list of all tabs.

sh::ui::FilePropertyDialogTabActionsView *widgetAt(std::shared_ptr<FilePropertyDialogTab> tab, int i)

Returns the widget from a tab at a certain index.

int widgetCount(std::shared_ptr<FilePropertyDialogTab> tab)

Returns the number of widgets in a tab.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Public Slots

void on_btnClose_clicked()
void on_btnRefresh_clicked()
void on_tabWidget_currentChanged(int index)
void selectTabByScrollPosition()

Public Static Functions

void addTabFactory(int i, std::shared_ptr<FilePropertyDialogTabFactory> factory)

Adds a FilePropertyDialogTabFactory so the Properties dialogs show its content.

See also the REGISTER_FILEPROPERTYDIALOGTAB macro.

Parameters
  • i: An index which controls the display order. Use one of the REGISTER_FILEPROPERTYDIALOGTAB_INDEX_* values in FilePropertyDialogTabFactory as base values.

Private Members

Ui::QtFilePropertyDialog *ui
QList<QWidget*> _internaltabwidgets
QList<QString> _tabheads
int _skip_on_tabWidget_currentChanged = 0
int _skip_selectTabByScrollPosition = 0
QVBoxLayout *scrollAreaLayout

Friends

friend class FilePropertyDialogTab
class QtFilePropertyDialogTabActionsView : public QWidget, public sh::ui::FilePropertyDialogTabActionsView
#include <qtfilepropertydialogtabactionsview.h>

A tab view which shows a main widget in the main part and some buttons below.

Public Functions

QtFilePropertyDialogTabActionsView(QWidget *parent = 0)

Is intended to be directly constructed from everywhere.

void setContent(FilePropertyDialogTabViewContent *w)

Sets the main widget. .

void setButtons(QList<QString> buttons)

Sets the list of buttons. .

void setVisible(bool v)

Sets the view visible or hidden. .

FilePropertyDialogTabViewContent *content()

The main widget.

QList<QString> buttons()

The list of buttons.

void onButtonTriggered(std::function<void(int i)> fct, QObject *owner = 0, )

Sets a handler for a click on one of the buttons (optionally bound to an owner lifetime).

class QtFilePropertyDialogTabIconTextBannerView : public QWidget, public sh::ui::FilePropertyDialogTabIconTextBannerView
#include <qtfilepropertydialogtabicontextbannerview.h>

Qt based FilePropertyDialogTabIconTextBannerView.

Public Functions

QtFilePropertyDialogTabIconTextBannerView(QWidget *parent = 0)
void clear()

Clears the contents.

void insertIcon(QIcon icon, int sizePt = 24)

Adds an icon.

void insertText(QString text)

Adds a text.

Private Members

QHBoxLayout *_layout
class QtFilePropertyDialogTabTableView : public QTableView, public sh::ui::FilePropertyDialogTabTableView
#include <qtfilepropertydialogtabtableview.h>

Qt based FilePropertyDialogTabTableView.

Public Types

typedef QPair<int, int> ItemIndex

Public Functions

QtFilePropertyDialogTabTableView(QWidget *parent = 0)
void setContent(QList<QPair<QString, QString>> content)

Sets the content.

QList<ItemIndex> getSelectedItems()

Returns the selected cells.

QVariant getItemValue(int r, int c)

Returns a value of a cell.

Private Functions

void createAndSetModel()
class QtFilePropertyDialogTabTextView : public QLabel, public sh::ui::FilePropertyDialogTabTextView
#include <qtfilepropertydialogtabtextview.h>

Qt based FilePropertyDialogTabTextView.

Public Functions

QtFilePropertyDialogTabTextView(QWidget *parent = 0)
void setContent(QString content)

Sets the content.

class QtFilesystemPanel : public QWidget
#include <qtfilesystempanel.h>

A splitted horizontal panel of file views.

Public Functions

QtFilesystemPanel(QWidget *parent = 0)
~QtFilesystemPanel()
void addView(bool reinitialize = false)
void removeView(int i)
sh::ui::FileView *currentView()
int currentViewIndex()
int viewsCount()
sh::ui::FileView *view(int i)
void selectFolder(std::shared_ptr<sh::filesystem::FilesystemNode> folder, int index = -1)
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void _emit_viewmodeChanged(int i)
void buildView(std::shared_ptr<sh::ui::qt::QtFileView> *list, sh::ui::qt::QtFileViewControl *viewctrl, bool isNew)
void setCustomWidget(int i, std::shared_ptr<QWidget> w)
std::shared_ptr<sh::ui::qt::QtFileView> viewwidget(int i)

Signals

void panelFolderActivated(std::shared_ptr<sh::filesystem::FilesystemNode> folder, bool realSwitch)
void panelCurrentViewChanged()
void panelViewmodeChanged(int i)
void panelViewOptionChanged(int i)
void panelViewCountChanged()
void panelSelectionChanged()

Private Members

Ui::QtFilesystemPanel *ui
std::shared_ptr<sh::ui::qt::QtFileView> activeView
QString activeColor
QString inactiveColor
QList<std::shared_ptr<sh::ui::qt::QtFileView>> _views
QList<QWidget*> _mainviews
QHash<QWidget*, std::shared_ptr<QWidget>> _customwidgets
QList<sh::ui::qt::QtFileViewControl*> _viewcontrols
bool _skip_eventfilter = false

Friends

friend class ui::qt::QtMainWindow
friend class ui::FileView
class QtFileView : public std::enable_shared_from_this<QtFileView>
#include <qtfileview.h>

Abstract base class for views for the contents of one directory.

Subclassed by sh::ui::qt::QtFileIconview, sh::ui::qt::QtFileList

Public Functions

QtFileView()

Constructed only by the infrastructure and made available otherwise.

~QtFileView()
void setBackgroundColor(QString c)
QString backgroundColor()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes()
void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
std::shared_ptr<sh::filesystem::FilesystemNode> node()
QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes()
void setSizeFormatting(sh::filesystem::SizeFormatting v)
void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n)
void setHiddenFilesVisible(bool value)
QThread *thread()
void configure(sh::ui::qt::QtFileViewControl *viewctrl)
void focus()
void setSort(int column, Qt::SortOrder order)
QObject *as_qobject()
QWidget *as_qwidget()
QAbstractItemView *as_qabstractitemview()
sh::ui::qt::QtFileViewControl *control()

Private Members

sh::ui::qt::QtFileViewControl *_viewctrl = nullptr
QString _tmp_bgColor
QPoint _dragStartPosition
int _async_gotodir_index = 0
bool _dragIsValid = false
int _sort_column = 0
Qt::SortOrder _sort_order = Qt::AscendingOrder

Friends

friend class sh::actions::common::ActionHistoryNavigateForward
friend class sh::actions::common::ActionHistoryNavigateBackward
friend class sh::actions::common::ActionNavigateInHistory
friend class sh::ui::qt::QtFileViewControl
class EventFilter : public QObject

Public Functions

EventFilter(QObject *parent, QtFileView *fileview, sh::ui::qt::QtFileViewControl *fileviewctrl)
bool eventFilter(QObject *object, QEvent *event)

Private Members

QtFileView *fileview
sh::ui::qt::QtFileViewControl *fileviewctrl
class QtFileViewControl : public sh::ui::FileView
#include <qtfileviewcontrol.h>

Qt based file view.

Public Functions

QtFileViewControl(sh::ui::qt::QtFilesystemPanel *panel, int i)
~QtFileViewControl()
sh::ui::ColumnDimensions *columndimensions() override

Returns the column dimensions handler. .

sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *historyTracker() override

Returns the history tracker. .

FileViewMode viewmode() override

Returns the view mode (icons, list, … ?). .

void setViewmode(FileViewMode m) override

Sets the view mode. .

int index() override

Returns the position of this file view within the panel. .

void gotoDir(std::shared_ptr<sh::filesystem::FilesystemNode> n) override

Jumps to a new current directory.

Implementations have to call the base class implementation inside.

sh::filesystem::SizeFormatting getSizeFormattingMode() override

Returns the mode how file sizes are formatted for displaying. .

void setSizeFormattingMode(sh::filesystem::SizeFormatting mode) override

Sets the mode how file sizes are formatted for displaying. .

bool hiddenFilesVisible() override

Returns if hidden files are visible. .

void setHiddenFilesVisible(bool v) override

Sets the visibility of hidden files. .

int iconDimension() override

Returns the icon size (in pixels). .

void setIconDimension(int v) override

Sets the icon size (in pixels). .

void setSort(int column, Qt::SortOrder order) override

Sets how to sort this view. .

int sortColumn() override

Returns the index of the current sort column. .

Qt::SortOrder sortOrder() override

Returns the current sort order. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> selectedNodes() override

Returns the nodes which the user has selected in this fileview. .

void setSelection(const QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Sets the node selection of this fileview. .

QList<std::shared_ptr<sh::filesystem::FilesystemNode>> getAllVisibleNodes() override

Returns a list of all nodes currently listed in this file view. .

void emit_nodesActivated(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void emit_selectionChanged()
std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the current directory.

void reload(bool skipModel = false)

Reloads the data inside this file view.

sh::filesystem::FilesystemModelFileviewProxy *filemodel()

Returns the filesystem model for this view. .

void setFilemodel(sh::filesystem::FilesystemModelFileviewProxy *model)

Sets the filesystem model for this view. .

Signals

void nodesActivated(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)
void selectionChanged()

Triggered when the selection have changed.

void viewOptionChanged()

Triggered when some view options have changed.

Private Functions

void setIndex(int i)

Private Members

sh::ui::qt::QtFilesystemPanel *_panel
int i
sh::ui::ColumnDimensions *_columndimensions
sh::tools::HistoryTracker<std::shared_ptr<const sh::filesystem::Eurl>> *_historyTracker
FileViewMode _viewmode = FileViewMode::ListView
bool _hiddenfilesvisible = false
int _icondimension = 0
int _sortColumn
Qt::SortOrder _sortOrder
sh::filesystem::SizeFormatting _sizeformattingmode = sh::filesystem::SizeFormatting::SizeFormattingModePrefixes

Friends

friend class sh::ui::qt::QtFilesystemPanel
class QtJumpBar : public QWidget
#include <qtjumpbar.h>

Button bar for navigating to places with parent-buttons and an text entry.

Public Functions

QtJumpBar(QWidget *parent = 0)
~QtJumpBar()
void setButtonMode()
void setTextMode()
bool isTextMode()
std::shared_ptr<sh::filesystem::FilesystemNode> node()
void setNode(std::shared_ptr<sh::filesystem::FilesystemNode> node)
QSize sizeHint() const

Signals

void nodeChanged()
void eurlRequested(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Private Functions

void _buildButtons()

Private Members

std::shared_ptr<sh::filesystem::FilesystemNode> _node = 0
Ui::QtJumpBar *ui
bool _isTextMode

Private Slots

void on_btnOk_clicked()
void on_btnAbort_clicked()
class QtLinkButton : public QToolButton
#include <qtlinkbutton.h>

QToolButton with different look.

Subclassed by sh::ui::qt::QtSearchPanelButton

Public Functions

QtLinkButton(QWidget *parent = 0)
void setSizeByFactor(int f)
void setMenu(QStringList items, QString menuchangetxt = tr("(change)"))
void setSelectedMenuItem(int idx)

Signals

void menuItemSelected(int idx)

Private Members

QString _linkcolor
QStringList _menuitems
QString _menuchangetxt
class QtLogViewDialog : public sh::ui::qt::QtDialog, public sh::ui::LogViewDialog
#include <qtlogviewdialog.h>

Qt based log view dialog.

Public Functions

QtLogViewDialog(QString headtext, QString subheadtxt, base::LogSeverity minseverity)
~QtLogViewDialog()
QString headtext()

Returns the header text.

QString subheadtxt()

Returns the 2nd header text.

sh::base::LogSeverity minimumSeverity()

Returns the minimum severity.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _reloadLog()
void setMinimumSeverity(sh::base::LogSeverity minseverity)

Private Members

Ui::QtLogViewDialog *ui

Private Slots

void on_btnClose_clicked()
void on_btnSaveToFile_clicked()
void on_btnSeverity_clicked()
class QtMainWindow : public QMainWindow, public sh::ui::MainWindow
#include <qtmainwindow.h>

The qt main window implementation.

Public Functions

QtMainWindow(QWidget *parent = 0)
~QtMainWindow()
void initialize() override

Initializes this main window. .

std::shared_ptr<DialogManager> dialogManager() override

Returns the DialogManager which creates and drives Dialogs for this main window.

You typically should not need to use it directly.

int fileViewCount() override

Returns the current number of file views. .

void addFileView(bool reinitialize = false) override

Adds a new file view. .

void removeFileView(int i) override

Removes a file view. .

sh::ui::FileView *currentFileView() override

Returns the file view which is currently active (i.e. focussed). .

sh::ui::FileView *getFileView(int i) override

Returns a file view by position index. .

void jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node) override

Let the current view jump to another location. .

void setTitlePattern(QString value) override

Sets the window title pattern. .

void setTreeVisible(bool v) override

Sets the visibility of the directory tree. .

void setFileDetailsPanelVisible(bool v) override

Sets the visibility of the file details panel. .

std::shared_ptr<sh::filesystem::FilesystemNode> currentDirectory() override

Gets the sh::filesystem::FilesystemNode selected in the current view. .

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(int position, sh::actions::ActionExecutionInfo *info, QColor color = QColor()) override

Creates a new action execution panel.

Let this smart pointer die for removing it.

void jumpbarSetTextMode() override

Sets the jumpbar to text input mode. .

void jumpbarSetButtonMode() override

Sets the jumpbar to button mode. .

bool jumpbarIsTextMode() override

Returns if the jumpbar is in text input mode. .

QString toolbarPosition() override

Returns the current toolbar position. .

void setToolbarPosition(QString pos) override

Sets the toolbar position. .

QString detailPanelPosition() override

Returns the current detail panel position. .

void setDetailPanelPosition(QString pos) override

Sets the detail panel position. .

std::shared_ptr<AboutDialog> showAboutDialog() override

Shows and returns an ‘About’ dialog. .

std::shared_ptr<ManageProfilesDialog> showManageProfilesDialog() override

Shows and returns a ‘Manage Saved Settings’ dialog. .

std::shared_ptr<OpenWithDialog> showOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods) override

Shows and returns a ‘Open With’ dialog. .

std::shared_ptr<StoreProfileDialog> showStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl) override

Shows and returns a ‘Save Settings’ dialog. .

std::shared_ptr<TuningDialog> showTuningDialog() override

Shows and returns a ‘Tuning’ dialog. .

std::shared_ptr<LogViewDialog> showLogViewDialog(QString headtext = QString(), QString subheadtxt = QString(), sh::base::LogSeverity minseverity = sh::base::LogSeverity::_DEFAULT) override

Shows and returns a ‘Log’ dialog. .

std::shared_ptr<ManageBookmarksDialog> showManageBookmarksDialog() override

Shows and returns a ‘Manage Bookmarks’ dialog. .

std::shared_ptr<FilePropertyDialog> showFilePropertyDialog(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes) override

Shows and returns a ‘File Properties’ dialog. .

std::shared_ptr<ActionExecutionInfoDialog> createActionExecutionInfoDialog(sh::actions::ActionExecutionInfo *info) override

Creates an action execution dialog. .

void handleCloseAppRejected(QString rejectmsg) override

React on a rejected application close request (with some feedback message). .

void handleClosed() override

Do some cleanup steps just when closing starts. Implementations must call base implementation!

sh::ui::qt::QtUIStyle *uiStyle()

Gets a QtUIStyle instance, which helps for common ui styling.

void _initialize(sh::base::SingletonInitializer *singletonInitializer)

Initializes the main window. For custom initialization logic, see MainWindow.initialize. .

void fileViewsReloadAll()

Reload all content in each file view.

void onFileViewOptionsChanged(std::function<void(int)> fct, QObject *owner = 0, )

Sets a handler for some view options in a file view changed (optionally bound to an owner lifetime).

void onCurrentFileViewChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the currently active file view changed (optionally bound to an owner lifetime).

void onFileViewCountChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the number of file views changed (optionally bound to an owner lifetime).

void onCurrentDirectoryChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current directory in the active file view changed (optionally bound to an owner lifetime).

void onGlobalViewOptionsChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for some global view options changed (optionally bound to an owner lifetime).

void onCurrentProfileChanged(std::function<void()> fctQObject *owner = 0, )

Sets a handler for the current profile changed (optionally bound to an owner lifetime).

void jumpToEurl(std::shared_ptr<const sh::filesystem::Eurl> eurl)

Let the current view jump to another location. .

QString titlePattern()

Returns the window title pattern.

void setCurrentProfile(QString profile)

Sets the current profile. .

QString currentProfile()

Returns the current profile.

void reloadProfile()

Reloads the profile data.

bool treeVisible()

Returns the visibility of the directory tree.

void setTreeSticky(bool v)

Sets if the directory tree should follow the active file view. .

bool treeSticky()

Returns if the directory tree follows the active file view.

bool fileDetailsPanelVisible()

Returns the visibility of the file details panel.

std::shared_ptr<sh::ui::ActionExecutionInfoPanel> addInfoPanel(sh::actions::ActionExecutionInfo *info, QColor color = QColor())

Creates a new action execution panel.

Let this smart pointer die for removing it.

std::shared_ptr<ActionExecutionInfoPanel> showErrorPanel()

Shows an error panel.

void _closeDirectly()

Directly begin application shutdown without checks.

bool closeApp()

Check if the application may shut down now, and if so, initiate it.

bool isCloseable(QString *msg = nullptr)

Check if the application may shut down now.

bool isClosing()

Returns if the application is currently closing.

Public Static Functions

bool tryCreateMainWindow(MainWindow *&mainWindow)
QtMainWindow *mainWindow()
void setMainWindow(MainWindow *mainWindow)

Sets the main window instance. .

bool isReady()

Returns if this process ui is ready (i.e. is created or runs headless).

bool runsHeadless()

Returns if this process runs headless, i.e. without any ui, just for a background process.

void _closeDirectly(sh::base::SingletonInitializer *singletonInitializer)
QString uiMode()

Returns the UI mode (e.g. qt, web).

Private Functions

void _setupGlobalShortcut(std::shared_ptr<sh::actions::AbstractActionItem> action)
void _setupGlobalShortcut_recursive(std::shared_ptr<sh::actions::SubmenuActionItem> submenu)
void _addPermanentActionToToolbar(std::shared_ptr<sh::actions::SubmenuActionItem> a, bool rightSide = false, bool preventDefaultAction = false)
void _refreshToolbar(std::shared_ptr<sh::actions::ActionInstantiation>)
void _jumpToNode(std::shared_ptr<sh::filesystem::FilesystemNode> node, int skip)
void _jumpToIndex(QModelIndex idx, int skip)
void _newToStatusbar_helper(sh::ui::qt::QtActionExecutionInfoPanel *w)
void _refresh_detailthumbnailvisibility()
void _thumbnail_resized()
void _resizethumbnail()
void _detailpanel_resized()
void _resizedetailpanel()
void requestDetailThumbnail(bool force = true)
void setStatusBarVisibility(bool v)

Private Members

Ui::QtMainWindow *ui
sh::ui::qt::QtFilesystemPanel *fspanel
sh::filesystem::FilesystemModelDirectoryTreeProxy *treemodel = 0
sh::ui::qt::QtJumpBar *jumpbar
QTimer _statusbar_timer
int _statusbar_fullheight
int _statusbar_targetheight = 0
QSet<sh::ui::qt::QtActionExecutionInfoPanel*> _statusbar_childs
std::shared_ptr<sh::filesystem::FilesystemNode> _currentDirectory = 0
bool _request_detailthumbnail_skip = false
int _thumbnailwidth = 0
Qt::Orientation _myorientation = Qt::Horizontal
sh::ui::qt::QtUIStyle *_uistyle = 0
QAction *_toolbarLeftRightSplitSeparator
QHash<QString, std::shared_ptr<sh::actions::common::ActionGroups>> actionGroupsActions
QList<QtToolbarButtonHandler*> toolbarButtonHandlers
std::shared_ptr<QtDialogManager> _dialogManager

Private Slots

void slot_detailbar_moved()
void slot_toolbar_moved()
void slot_statusbartimer()
void slot_treeview_collapsedexpanded(const QModelIndex &index)

Private Static Attributes

QtMainWindow *_qtMainWindow = nullptr

Friends

friend class QtToolbarButton
friend class QtFilesystemPanel
class MyFlexibleLabel : public QLabel
#include <qtmainwindow.h>

Needed internally in main window in order to have a label which really does not request any sizes.

Public Functions

MyFlexibleLabel(QWidget *parent = 0)
QSize sizeHint() const override
class QtManageBookmarksDialog : public sh::ui::qt::QtDialog, public sh::ui::ManageBookmarksDialog
#include <qtmanagebookmarksdialog.h>

Qt based manage bookmarks dialog.

Public Functions

QtManageBookmarksDialog()
~QtManageBookmarksDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void readBookmarks()
void _refresh_values()
void _selectbookmark(QString id)
void _selectfolder(QStringList name)

Private Members

Ui::QtManageBookmarksDialog *ui

Private Slots

void on_btnClose_clicked()
void on_treeWidget_itemSelectionChanged()
void on_btnDelete_clicked()
void on_edtLabel_textChanged(const QString &arg1)
void on_edtLocation_textChanged(const QString &arg1)
void on_btnStore_clicked()
void on_btnNew_clicked()
void on_btnUp_clicked()
void on_btnDown_clicked()
void on_btnMove_clicked()
class QtManageProfilesDialog : public sh::ui::qt::QtDialog, public sh::ui::ManageProfilesDialog
#include <qtmanageprofilesdialog.h>

Qt based manage saved settings dialog.

Public Functions

QtManageProfilesDialog()
~QtManageProfilesDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _createProfileList()
void _createSettingsList()
void _createNodesList()

Private Members

Ui::QtManageProfilesDialog *ui
QStringListModel *_model
sh::settings::ProfileNode *_currentNode = 0
QHash<QListWidgetItem*, QString> _nodes

Private Slots

void on_comboBox_currentTextChanged(const QString &arg1)
void on_btnClose_clicked()
void on_btnDelNode_clicked()
void on_btnDelProfile_clicked()
void slot_listViewactivated(QListWidgetItem*, QListWidgetItem*)
class QtOpenWithDialog : public sh::ui::qt::QtDialog, public sh::ui::OpenWithDialog
#include <qtopenwithdialog.h>

Qt based open with dialog.

Public Functions

QtOpenWithDialog(std::shared_ptr<sh::filesystem::FilesystemNode> node, QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)
~QtOpenWithDialog()
void setProgramList(QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> openMethods)
std::shared_ptr<sh::tools::filetypes::OpenMethod> chosenMethod() override

Returns the chosen open-method (program for opening the file).

bool rememberForMimetype() override

Returns if the chosen method is checked to be remembered for the same mime-type in the future.

std::shared_ptr<const sh::filesystem::Eurl> rememberForDirectory() override

If it’s checked for the chosen method to be remembered for some subdirectory in the future, it returns the Eurl of this subdirectory, otherwise nullptr.

bool rememberForFile() override

Returns if the chosen method is checked to be remembered for the same file in the future.

std::shared_ptr<sh::filesystem::FilesystemNode> node()

Returns the file node which is later to be opened.

QList<std::shared_ptr<tools::filetypes::OpenMethod>> openMethods()

Returns the open-methods (programs for opening the file) to present for choice.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Members

std::shared_ptr<sh::tools::filetypes::OpenMethod> _chosenMethod
std::shared_ptr<const sh::filesystem::Eurl> _rememberfordirectory
QAbstractItemModel *_listmodel
Ui::QtOpenWithDialog *ui

Private Slots

void on_btnCancel_clicked()
void on_btnOk_clicked()
void on_btnSelectOther_clicked()
void on_listView_activated(const QModelIndex &index)
void on_btnAnotherAncestor_clicked()
void on_chkRememberDir_toggled(bool checked)
class QtOpenWithDialogModel : public QStringListModel
#include <qtopenwithdialog.h>

Used internally in OpenWithDialogModel.

Public Functions

QtOpenWithDialogModel(QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> methods, QObject *parent = 0)
QVariant data(const QModelIndex &index, int role) const

Private Members

QList<std::shared_ptr<sh::tools::filetypes::OpenMethod>> _methods
class QtSearchPanel : public QWidget
#include <qtsearchpanel.h>

Search panel for usage in the Qt main window.

Public Functions

QtSearchPanel(std::shared_ptr<sh::filesystem::FilesystemNode> node, QWidget *parent = 0)
~QtSearchPanel()

Friends

friend class QtSearchPanelConfiguration
template<class T1, class T2>
class QtSearchPanelAbstractEditor : public T1, public T2
#include <qtsearchpanelconfiguration.h>

Helper for other Qt based search panel editors.

Public Functions

QtSearchPanelAbstractEditor(QWidget *parent = 0)
bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelButton : public sh::ui::qt::QtLinkButton, public sh::ui::SearchPanelButton
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelButton.

Public Functions

QtSearchPanelButton(QWidget *parent = 0)
void setButtonText(QString txt)

Sets the button text. .

void setMenuSelection(int i)

Sets the currently selected menu item (for buttons with menus). .

void setSizeByFactor(int f)
void setMenu(QStringList items, QString menuchangetxt = tr("(change)"))
void setSelectedMenuItem(int idx)

Signals

void menuItemSelected(int idx)
class QtSearchPanelConfiguration : public sh::ui::SearchPanelConfiguration
#include <qtsearchpanelconfiguration.h>

Search panel configuration for usage in a Qt ui.

Public Functions

QtSearchPanelConfiguration(QtSearchPanel *owner, QHBoxLayout *editors)
SearchPanelButton *addMenuButton(QString text, QStringList menu, std::function<void(int)> onchanged)

Adds and returns a button for a menu. .

SearchPanelButton *addActionButton(QString text, std::function<void()> action)

Adds and returns a button for an action. .

SearchPanelTextEditor *addTextEditor()

Adds and returns a text editor. .

SearchPanelDateTimeEditor *addDateTimeEditor()

Adds and returns a date/time editor. .

SearchPanelLabelEditor *addLabel()

Adds and returns a label. .

SearchPanelSpacerEditor *addSpacer()

Adds and returns a spacer. .

SearchPanelAbstractEditor *getEditorAt(int i)

Returns the editor widget at a given position. .

void onDestroyed(std::function<void()> fctQObject *owner = 0, )

Sets a handler for panel removal (optionally bound to an owner lifetime).

Public Members

_SearchPanelConfiguration_HelperQObject myqobject

Private Members

QtSearchPanel *owner
QHBoxLayout *editors
class QtSearchPanelDateTimeEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QDateTimeEdit, SearchPanelDateTimeEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelDateTimeEditor.

Public Functions

QtSearchPanelDateTimeEditor(QWidget *parent = 0)
QDateTime datetime()

Returns the selected date/time. .

void setDatetime(QDateTime s)

Sets the selected date/time.

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelLabelEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLabel, sh::ui::SearchPanelLabelEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelLabelEditor.

Public Functions

QtSearchPanelLabelEditor(QWidget *parent = 0)
QString textContent()

Returns the text content. .

void setTextContent(QString s)

Sets the text content. .

SearchPanelAbstractEditor *focusProxyEditor()

Returns the focus proxy widget (which focus gets redirected to in some situations). .

void setFocusProxyEditor(SearchPanelAbstractEditor *w)

Sets the focus proxy widget (which focus gets redirected to in some situations). .

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelSpacerEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLabel, sh::ui::SearchPanelSpacerEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelSpacerEditor.

Public Functions

QtSearchPanelSpacerEditor(QWidget *parent = 0)
bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSearchPanelTextEditor : public sh::ui::qt::QtSearchPanelAbstractEditor<QLineEdit, sh::ui::SearchPanelTextEditor>
#include <qtsearchpanelconfiguration.h>

Qt based SearchPanelTextEditor.

Public Functions

QtSearchPanelTextEditor(QWidget *parent = 0)
QString textContent()

Returns the text content. .

void setTextContent(QString s)

Sets the text content. .

QString placeholderDescription()

Returns the placeholder description text (visible if field is empty). .

void setPlaceholderDescription(QString s)

Sets the placeholder description text (visible if field is empty). .

bool isWidgetEnabled()
void setWidgetEnabled(bool v)
class QtSettingUIFrame : public QFrame
#include <qtsettinguiframe.h>

User interface for one handling one setting.

Public Functions

QtSettingUIFrame(sh::settings::Setting *setting, bool withcheckbox, QString displayvalue, QString additionalCheck, QVariant additionalCheckValue, QWidget *parent = 0)
bool isChecked()
void setChecked(bool val)
void setAdditionalCheckVisible(bool v)
QVariant additionalCheckValue()

Private Members

QCheckBox *_checkbox = 0
QCheckBox *_additionalcheckbox = 0
QLabel *_additionalcheckboxlabel = 0
QWidget *_additionalcheckwidget = 0
QVariant _additionalCheckValue
class QtStoreProfileDialog : public sh::ui::qt::QtDialog, public sh::ui::StoreProfileDialog
#include <qtstoreprofiledialog.h>

Qt based save settings dialog.

Public Functions

QtStoreProfileDialog(std::shared_ptr<const sh::filesystem::Eurl> eurl)
~QtStoreProfileDialog()
QList<sh::ui::StoreProfileDialog::SettingEntry> checkedSettings() override

Returns the list of settings the user has checked to store.

QString profileName() override

Returns the profile the user has chosen to store settings for.

bool withSubDirectories() override

Returns if the user has chosen to apply the checked settings also for subdirectories.

QStringList inheritsFrom() override

Returns the list of profiles the user has chosen to inherit from.

bool hasGlobal() override

Returns if the user has chosen to apply the checked settings for each directory (instead of the current directory).

std::shared_ptr<const sh::filesystem::Eurl> eurl()

Returns the current directory this dialog shall work on.

qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Functions

void _settingsLevel(int level, bool persist = true)
void _setglobal(bool v)

Private Members

QHash<sh::ui::qt::QtSettingUIFrame*, std::shared_ptr<sh::settings::Setting>> _widgets
QHash<int, QLabel*> _headerlabels
QStringList _inheritProfileNameList
bool _global = false
Ui::QtStoreProfileDialog *ui
int _level

Private Slots

void on_btnAddProf_clicked()
void on_btnGlobal_clicked()
void on_btn22_clicked()
void on_toolButton_2_clicked()
void on_toolButton_clicked()
class QtToolbarButton : public QToolButton
#include <qttoolbarbutton.h>

A qt toolbar button implementation with optional submenu.

Public Types

enum Position

Values:

enumerator LEFT
enumerator RIGHT
enumerator TOP
enumerator BOTTOM

Public Functions

QtToolbarButton(QWidget *parent = 0)
void setText(const QString &text)
QString text() const
void setIcon(const QIcon &icon)
QIcon icon()
QSize sizeHint() const
void setButtonText(QString v)
QString buttonText()
void setButtonIcon(QIcon v)
QIcon buttonIcon()
void setButtonEnabled(bool v)
bool isButtonEnabled()
bool hasExpander()
void setSubmenu(QtActionMenu *menu)
QtActionMenu *submenu()
void setLocation(Position location)
void setClickAction(std::function<void()> action)
void unsetClickAction()
void trigger()
void openMenu()

Private Functions

void _calcDims()
void computeArrowAndDividerLineCoordinates()

Private Members

QString _text
QString _text1
QString _textWithoutMnemonic1
QString _text2
QString _textWithoutMnemonic2
QIcon _icon
bool _drawIconOnly = false
bool _hovered = false
bool _arrowhovered = false
sh::ui::qt::QtActionMenu *_menu = 0
std::function<void()> _clickAction
Position location
int tw1
int tworig1
int tw2
int tworig2
int twmax
int tworigmax
int th
int thorig
int iw
int ih
int iedim
int ew
int eh
const int textpad = 20
const int opad = 3
int expx1
int expx2
int expy1
int expy2
int xt
int yt1
int yt2
int xi
int yi
QPainterPath arrow
bool _drawmnemonics = false

Private Slots

void slot_clicked()

Friends

friend class sh::actions::ActionsManager
class QtToolbarButtonHandler
#include <qttoolbarbuttonhandler.h>

A handler which reflects the sh::actions objects to a graphical toolbar button (and keeps that up-to-date).

Public Functions

QtToolbarButtonHandler(std::shared_ptr<sh::actions::SubmenuActionItem> action, bool preventDefaultAction, QtToolbarButton *button, QAction *qaction)
~QtToolbarButtonHandler()

Private Functions

void _updateSubmenu()

Private Members

std::shared_ptr<sh::actions::SubmenuActionItem> action
QtActionMenu menu
bool preventDefaultAction
QtToolbarButton *button

Private Static Functions

void _applyPropertiesToButton(sh::actions::SubmenuActionItem *action, QtToolbarButton *button, QAction *qaction)
class QtTuningDialog : public sh::ui::qt::QtDialog, public sh::ui::TuningDialog
#include <qttuningdialog.h>

Qt based tuning dialog.

Public Functions

QtTuningDialog()
~QtTuningDialog()
qint64 dialogId()

Returns the dialog id.

Each instance has an id unique in the complete Shallot process lifetime.

Must be called in main thread.

bool isInited()

Returns if this dialog is initialized.

Must be called in main thread.

bool wasAccepted()

Returns if this dialog was ‘accepted’ by the user (typically by clicking some ‘OK’ button).

Must be called in main thread.

void waitClosed()

Wait until the user closed the dialog in some way.

May be called in any thread.

void close()

Closes the dialog.

Must be called in main thread.

bool wasClosed()

Returns if this dialog was closed.

Must be called in main thread.

DialogManager *manager()

Returns the DialogManager which hosts this dialog.

Private Types

typedef QPair<QString, QWidget*> BoxWidgetByDesc

Private Functions

QString _changedlglabel(std::shared_ptr<sh::configuration::ConfigurationValue> cv)
void do_change(std::shared_ptr<sh::configuration::ConfigurationValue> cv)
void filterVisibility(QString s)

Private Members

Ui::QtTuningDialog *ui
QList<BoxWidgetByDesc> boxWidgetsByDesc

Private Slots

void on_btnCancel_clicked()
void on_lineEditSearchInt_textChanged(const QString &arg1)
void on_lineEditSearchExt_textChanged(const QString &arg1)
void on_lineEditSearchBehav_textChanged(const QString &arg1)
void on_lineEditSearchAppear_textChanged(const QString &arg1)
void on_tabWidget_currentChanged(int index)
class QtUIStyle
#include <qtuistyle.h>

Methods for applying the Shallot visible style.

See sh::ui::qt::QtMainWindow about how to get an instance.

Public Functions

QtUIStyle(sh::ui::qt::QtMainWindow *mainwnd)

Constructed only by the infrastructure and made available otherwise.

QColor windowColor()
QColor backgroundColor()
QColor inactiveBackgroundColor()
QColor windowColorHighlighted()
QColor windowColorHalfHighlighted()
QColor windowColorDarkened()
QColor windowColorLikeTitlebar()
QColor linkColor()
QColor titlebarColor()
QColor foregroundColor()
QColor foregroundColorLighter1()
QColor foregroundColorLighter2()
int fontSizeInPt(int r = 100)
QColor mix(float n1, QColor c1, QColor c2)
Sheet createSheet()

Private Members

sh::ui::qt::QtMainWindow *_mainWindow
class Sheet
#include <qtuistyle.h>

Public Functions

QString sheet()
Sheet customcss(QString css)
Sheet fontsize_byFactor(int f)
Sheet fontsize_header()
Sheet fontsize_smaller()
Sheet textcolor(QColor color)
Sheet textcolor_lighter1()
Sheet textcolor_lighter2()
Sheet background(QColor color, bool restrictQWidget = true)
Sheet background_highlighted(bool restrictQWidget = true)
Sheet background_halfhighlighted(bool restrictQWidget = true)
Sheet background_darkened(bool restrictQWidget = true)
Sheet background_liketitlebar(bool restrictQWidget = true)
Sheet applyTo(QWidget *widget)
Sheet bold()

Private Functions

Sheet(QtUIStyle *style, QString sheet)

Private Members

QString _sheet
QtUIStyle *_style

Friends

friend class QtUIStyle
namespace feedbackpanels

Qt user interface parts for user feedback in action execution dialogs.

Implementations of sh::ui::qt::feedbackpanels::FeedbackPanel are used for implementing parts of sh::ui::ActionExecutionInfoDialog.

Typedefs

typedef QPair<QString, QWidget*> GridFormRow
class Credentials : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <credentials.h>

FeedbackPanel for user login credentials (password based).

Public Functions

Credentials(QString domain, QString username, QString password, QString text, bool showDomain, bool showUsername, bool showPassword, bool showAnonymous, bool showRemember)
~Credentials()
void cancelRequested()
bool isClosed()
void waitUntilClosed()
int preferredHeight()

Public Members

QString domain
QString username
QString password
bool anonymous
bool remember
bool accepted

Signals

void wasClosed()

Private Members

Ui::Credentials *ui

Private Slots

void on_chkAnonymous_toggled(bool checked)
void on_pushButton_3_clicked()
void on_pushButton_4_clicked()
class FeedbackPanel : public QWidget
#include <feedbackpanel.h>

Abstract base class for a Qt helper widget used in action user feedback.

Subclassed by sh::ui::qt::feedbackpanels::Credentials, sh::ui::qt::feedbackpanels::GridForm, sh::ui::qt::feedbackpanels::MsgBox, sh::ui::qt::feedbackpanels::UnixPermissions

Public Functions

FeedbackPanel(QWidget *parent = 0)
bool isClosed()
void waitUntilClosed()
int preferredHeight()
void cancelRequested() = 0

Signals

void wasClosed()

Private Members

QMutex _mutex
QWaitCondition _closedcondition
bool _closed = false
class GridForm : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <gridform.h>

FeedbackPanel for grid based forms.

Public Functions

GridForm(QString text, QList<sh::ui::qt::feedbackpanels::GridFormRow> form, QStringList answers, int defaultanswer = -1, int cancelanswer = -1, QWidget *parent = 0)
~GridForm()
int preferredHeight()
void cancelRequested()
bool isClosed()
void waitUntilClosed()

Public Members

int answer = -1

Signals

void wasClosed()

Private Members

Ui::GridForm *ui
QHash<QPushButton*, int> btn2index
QPushButton *_cancelBtn = 0
QPushButton *_defaultBtn = 0

Private Slots

void slot_btnclicked()
class GridFormInnerSimpleChooser : public QWidget
#include <gridforminnersimplechooser.h>

Helper widget for a GridForm.

Public Functions

GridFormInnerSimpleChooser(sh::actions::ActionExecutionUserFeedback::Choices *choices, QWidget *parent = 0)
~GridFormInnerSimpleChooser()

Public Members

int answer = -1
QString text

Private Functions

bool eventFilter(QObject *obj, QEvent *event)

Private Members

QLineEdit *lineedit
sh::actions::ActionExecutionUserFeedback::Choices *choices
QVBoxLayout *mylayout
sh::actions::ActionExecutionUserFeedback::Choice *currentchoice = 0

Private Slots

void slot_chosen(int id)
void slot_textedited(QString t)
class MsgBox : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <msgbox.h>

FeedbackPanel for showing a message, some answer buttons, and optionally a text input box.

Public Functions

MsgBox(QString question, QList<QString> answers, QString icon = "", QString withInputBox = QString(), bool inputBoxMultiline = false, int defaultanswer = -1, int cancelanswer = -1, int valuePreselectFrom = -1, int valuePreselectTo = -1, QList<QString> answericons = QList<QString>(), QWidget *parent = 0)
~MsgBox()
void cancelRequested()
bool isClosed()
void waitUntilClosed()

Public Members

int answer = -1
QString text

Signals

void wasClosed()

Private Members

Ui::MsgBox *ui
QHash<QPushButton*, int> btn2index
QWidget *_initialFocusWidget = 0
QPushButton *_cancelBtn = 0
QPushButton *_defaultBtn = 0
bool _inputBoxMultiline
int _valuePreselectFrom
int _valuePreselectTo

Private Slots

void slot_btnclicked()
class UnixPermissions : public sh::ui::qt::feedbackpanels::FeedbackPanel
#include <unixpermissions.h>

FeedbackPanel for setting one set of unix filesystem permissions.

Public Functions

UnixPermissions(QWidget *parent = 0)
~UnixPermissions()
void cancelRequested()
void setflags(bool userMayRead, bool userMayWrite, bool userMayExecute, bool groupMayRead, bool groupMayWrite, bool groupMayExecute, bool othersMayRead, bool othersMayWrite, bool othersMayExecute, bool sticky, bool setuid, bool setgid)
void setusers(QStringList users, QString selecteduser)
void setgroups(QStringList groups, QString selectedgroup)
bool isClosed()
void waitUntilClosed()
int preferredHeight()

Public Members

bool accepted
bool userMayRead
bool userMayWrite
bool userMayExecute
bool groupMayRead
bool groupMayWrite
bool groupMayExecute
bool othersMayRead
bool othersMayWrite
bool othersMayExecute
bool sticky
bool setuid
bool setgid
QString user
QString group

Signals

void wasClosed()

Private Members

Ui::UnixPermissions *ui

Private Slots

void on_pushButton_clicked()
void on_pushButton_2_clicked()