#include <KisSessionManagerDialog.h>
|
| bool | event (QEvent *event) override |
| |
Definition at line 19 of file KisSessionManagerDialog.h.
◆ KisSessionManagerDialog()
| KisSessionManagerDialog::KisSessionManagerDialog |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
Definition at line 18 of file KisSessionManagerDialog.cpp.
19 : QDialog(parent)
20{
21 setupUi(this);
22
23
26 }
27
34
38 lstSessions->setEditTriggers(QAbstractItemView::NoEditTriggers);
39
41
42 connect(lstSessions->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this, SLOT(
slotModelSelectionChanged(QItemSelection, QItemSelection)));
43
45}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
The KisResourceModel class provides the main access to resources. It is possible to filter the resour...
static int refreshEventType
void slotSessionDoubleClicked(QModelIndex item)
void slotModelSelectionChanged(QItemSelection selected, QItemSelection deselected)
KisResourceModel * m_model
References connect(), m_model, KisAbstractResourceModel::Name, refreshEventType, ResourceType::Sessions, slotClose(), slotDeleteSession(), slotModelSelectionChanged(), slotNewSession(), slotRenameSession(), slotSessionDoubleClicked(), slotSwitchSession(), and updateButtons().
◆ event()
| bool KisSessionManagerDialog::event |
( |
QEvent * | event | ) |
|
|
overrideprotected |
Definition at line 47 of file KisSessionManagerDialog.cpp.
48{
50
52 btnDelete->setEnabled(hasSelectedSession);
53 btnSwitchTo->setEnabled(hasSelectedSession);
54 btnRename->setEnabled(hasSelectedSession);
55 return true;
56 } else {
57 return QDialog::event(
event);
58 }
59}
KisSessionResourceSP getSelectedSession() const
bool event(QEvent *event) override
References event(), getSelectedSession(), and refreshEventType.
◆ getSelectedSession()
Definition at line 124 of file KisSessionManagerDialog.cpp.
125{
126 QModelIndex idx = lstSessions->currentIndex();
127 if (idx.isValid()) {
130 }
131 return nullptr;
132}
KoResourceSP resourceForIndex(QModelIndex index=QModelIndex()) const override
resourceForIndex returns a properly versioned and id'ed resource object
References m_model, and KisResourceModel::resourceForIndex().
◆ slotClose
| void KisSessionManagerDialog::slotClose |
( |
| ) |
|
|
privateslot |
◆ slotDeleteSession
| void KisSessionManagerDialog::slotDeleteSession |
( |
| ) |
|
|
privateslot |
◆ slotModelAboutToBeReset
| void KisSessionManagerDialog::slotModelAboutToBeReset |
( |
QModelIndex | | ) |
|
|
privateslot |
◆ slotModelReset
| void KisSessionManagerDialog::slotModelReset |
( |
| ) |
|
|
privateslot |
◆ slotModelSelectionChanged
| void KisSessionManagerDialog::slotModelSelectionChanged |
( |
QItemSelection | selected, |
|
|
QItemSelection | deselected ) |
|
privateslot |
◆ slotNewSession
| void KisSessionManagerDialog::slotNewSession |
( |
| ) |
|
|
privateslot |
Definition at line 68 of file KisSessionManagerDialog.cpp.
69{
71
72 name = QInputDialog::getText(
this,
73 i18n("Create session"),
74 i18n("Session name:"), QLineEdit::Normal,
75 name);
76 if (
name.isEmpty())
return;
77
79
80 QString filename =
name.split(
" ").join(
"_") + session->defaultFileExtension();
81 session->setFilename(filename);
82 session->setName(name);
83 session->storeCurrentWindows();
84
86
88
89}
void setCurrentSession(KisSessionResourceSP session)
static bool addResourceWithUserInput(QWidget *widgetParent, KoResourceSP resource, QString storageLocation="")
const char * name(StandardAction id)
References KisResourceUserOperations::addResourceWithUserInput(), KisPart::instance(), and KisPart::setCurrentSession().
◆ slotRenameSession
| void KisSessionManagerDialog::slotRenameSession |
( |
| ) |
|
|
privateslot |
◆ slotSessionDoubleClicked
| void KisSessionManagerDialog::slotSessionDoubleClicked |
( |
QModelIndex | item | ) |
|
|
privateslot |
◆ slotSwitchSession
| void KisSessionManagerDialog::slotSwitchSession |
( |
| ) |
|
|
privateslot |
◆ updateButtons()
| void KisSessionManagerDialog::updateButtons |
( |
| ) |
|
|
private |
◆ m_lastSessionId
| int KisSessionManagerDialog::m_lastSessionId |
|
private |
◆ m_model
◆ refreshEventType
| int KisSessionManagerDialog::refreshEventType = -1 |
|
staticprivate |
The documentation for this class was generated from the following files: