Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
KTeaTime
Commits
131f11e4
Commit
131f11e4
authored
Jan 18, 2021
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variable + const'ify pointer
parent
7a637350
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
102 deletions
+102
-102
src/settings.cpp
src/settings.cpp
+66
-66
src/settings.h
src/settings.h
+3
-3
src/tealistmodel.cpp
src/tealistmodel.cpp
+1
-1
src/timeedit.cpp
src/timeedit.cpp
+24
-24
src/timeedit.h
src/timeedit.h
+3
-3
src/toplevel.h
src/toplevel.h
+5
-5
No files found.
src/settings.cpp
View file @
131f11e4
...
...
@@ -43,16 +43,16 @@ class SettingsUI : public QWidget, public Ui::SettingsWidget
};
SettingsDialog
::
SettingsDialog
(
TopLevel
*
toplevel
,
const
QList
<
Tea
>
&
teas
)
:
QDialog
(),
m_toplevel
(
toplevel
)
:
QDialog
()
,
mUi
(
new
SettingsUI
(
this
))
,
m_toplevel
(
toplevel
)
{
setWindowTitle
(
i18n
(
"Configure Tea Cooker"
)
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Help
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
ui
=
new
SettingsUI
(
this
);
mainLayout
->
addWidget
(
ui
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
|
QDialogButtonBox
::
Help
,
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
mainLayout
->
addWidget
(
mUi
);
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setDefault
(
true
);
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
SettingsDialog
::
accept
);
...
...
@@ -85,50 +85,50 @@ SettingsDialog::SettingsDialog(TopLevel *toplevel, const QList<Tea> &teas)
int
remindertime
=
group
.
readEntry
(
"ReminderTime"
,
60
);
bool
vis
=
group
.
readEntry
(
"UseVisualize"
,
true
);
u
i
->
popupCheckBox
->
setChecked
(
popup
);
u
i
->
autohideCheckBox
->
setChecked
(
autohide
);
u
i
->
reminderCheckBox
->
setChecked
(
reminder
);
u
i
->
visualizeCheckBox
->
setChecked
(
vis
);
mU
i
->
popupCheckBox
->
setChecked
(
popup
);
mU
i
->
autohideCheckBox
->
setChecked
(
autohide
);
mU
i
->
reminderCheckBox
->
setChecked
(
reminder
);
mU
i
->
visualizeCheckBox
->
setChecked
(
vis
);
u
i
->
autohideSpinBox
->
setValue
(
autohidetime
);
u
i
->
reminderSpinBox
->
setValue
(
remindertime
);
u
i
->
autohideSpinBox
->
setSuffix
(
ki18ncp
(
"Auto hide popup after"
,
" second"
,
" seconds"
)
);
u
i
->
reminderSpinBox
->
setSuffix
(
ki18ncp
(
"Reminder every"
,
" second"
,
" seconds"
)
);
mU
i
->
autohideSpinBox
->
setValue
(
autohidetime
);
mU
i
->
reminderSpinBox
->
setValue
(
remindertime
);
mU
i
->
autohideSpinBox
->
setSuffix
(
ki18ncp
(
"Auto hide popup after"
,
" second"
,
" seconds"
)
);
mU
i
->
reminderSpinBox
->
setSuffix
(
ki18ncp
(
"Reminder every"
,
" second"
,
" seconds"
)
);
u
i
->
autohideCheckBox
->
setEnabled
(
popup
);
u
i
->
autohideSpinBox
->
setEnabled
(
autohide
);
u
i
->
reminderSpinBox
->
setEnabled
(
reminder
);
mU
i
->
autohideCheckBox
->
setEnabled
(
popup
);
mU
i
->
autohideSpinBox
->
setEnabled
(
autohide
);
mU
i
->
reminderSpinBox
->
setEnabled
(
reminder
);
m_model
=
new
TeaListModel
(
teas
,
this
);
u
i
->
tealistTreeView
->
setModel
(
m_model
);
mU
i
->
tealistTreeView
->
setModel
(
m_model
);
connect
(
u
i
->
tealistTreeView
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
SettingsDialog
::
updateSelection
);
connect
(
mU
i
->
tealistTreeView
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
SettingsDialog
::
updateSelection
);
u
i
->
removeButton
->
setEnabled
(
false
);
u
i
->
upButton
->
setEnabled
(
false
);
u
i
->
downButton
->
setEnabled
(
false
);
mU
i
->
removeButton
->
setEnabled
(
false
);
mU
i
->
upButton
->
setEnabled
(
false
);
mU
i
->
downButton
->
setEnabled
(
false
);
u
i
->
newButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"list-add"
)
)
);
u
i
->
removeButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"edit-delete"
)
)
);
u
i
->
upButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"arrow-up"
)
)
);
u
i
->
downButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"arrow-down"
)
)
);
mU
i
->
newButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"list-add"
)
)
);
mU
i
->
removeButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"edit-delete"
)
)
);
mU
i
->
upButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"arrow-up"
)
)
);
mU
i
->
downButton
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"arrow-down"
)
)
);
connect
(
u
i
->
popupCheckBox
,
&
QCheckBox
::
toggled
,
this
,
&
SettingsDialog
::
checkPopupButtonState
);
connect
(
mU
i
->
popupCheckBox
,
&
QCheckBox
::
toggled
,
this
,
&
SettingsDialog
::
checkPopupButtonState
);
connect
(
u
i
->
newButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
newButtonClicked
);
connect
(
u
i
->
removeButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
removeButtonClicked
);
connect
(
u
i
->
upButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
upButtonClicked
);
connect
(
u
i
->
downButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
downButtonClicked
);
connect
(
mU
i
->
newButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
newButtonClicked
);
connect
(
mU
i
->
removeButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
removeButtonClicked
);
connect
(
mU
i
->
upButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
upButtonClicked
);
connect
(
mU
i
->
downButton
,
&
QToolButton
::
clicked
,
this
,
&
SettingsDialog
::
downButtonClicked
);
connect
(
u
i
->
teaNameEdit
,
&
QLineEdit
::
textChanged
,
this
,
&
SettingsDialog
::
nameValueChanged
);
connect
(
u
i
->
minutesSpin
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
SettingsDialog
::
timeValueChanged
);
connect
(
u
i
->
secondsSpin
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
SettingsDialog
::
timeValueChanged
);
connect
(
mU
i
->
teaNameEdit
,
&
QLineEdit
::
textChanged
,
this
,
&
SettingsDialog
::
nameValueChanged
);
connect
(
mU
i
->
minutesSpin
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
SettingsDialog
::
timeValueChanged
);
connect
(
mU
i
->
secondsSpin
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
SettingsDialog
::
timeValueChanged
);
}
SettingsDialog
::~
SettingsDialog
()
{
delete
m_model
;
delete
u
i
;
delete
mU
i
;
}
void
SettingsDialog
::
showHelp
()
...
...
@@ -146,12 +146,12 @@ void SettingsDialog::accept()
hide
();
group
.
writeEntry
(
"Geometry"
,
saveGeometry
());
group
.
writeEntry
(
"UsePopup"
,
u
i
->
popupCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"PopupAutoHide"
,
u
i
->
autohideCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"PopupAutoHideTime"
,
u
i
->
autohideSpinBox
->
value
()
);
group
.
writeEntry
(
"UseReminder"
,
u
i
->
reminderCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"ReminderTime"
,
u
i
->
reminderSpinBox
->
value
()
);
group
.
writeEntry
(
"UseVisualize"
,
u
i
->
visualizeCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"UsePopup"
,
mU
i
->
popupCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"PopupAutoHide"
,
mU
i
->
autohideCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"PopupAutoHideTime"
,
mU
i
->
autohideSpinBox
->
value
()
);
group
.
writeEntry
(
"UseReminder"
,
mU
i
->
reminderCheckBox
->
checkState
()
==
Qt
::
Checked
);
group
.
writeEntry
(
"ReminderTime"
,
mU
i
->
reminderSpinBox
->
value
()
);
group
.
writeEntry
(
"UseVisualize"
,
mU
i
->
visualizeCheckBox
->
checkState
()
==
Qt
::
Checked
);
config
->
sync
();
m_toplevel
->
setTeaList
(
m_model
->
getTeaList
()
);
...
...
@@ -159,13 +159,13 @@ void SettingsDialog::accept()
void
SettingsDialog
::
checkPopupButtonState
(
bool
b
)
{
u
i
->
autohideCheckBox
->
setEnabled
(
b
);
mU
i
->
autohideCheckBox
->
setEnabled
(
b
);
if
(
!
b
)
{
u
i
->
autohideSpinBox
->
setEnabled
(
b
);
mU
i
->
autohideSpinBox
->
setEnabled
(
b
);
}
else
if
(
u
i
->
autohideCheckBox
->
checkState
()
==
2
)
{
u
i
->
autohideSpinBox
->
setEnabled
(
b
);
else
if
(
mU
i
->
autohideCheckBox
->
checkState
()
==
2
)
{
mU
i
->
autohideSpinBox
->
setEnabled
(
b
);
}
}
...
...
@@ -174,7 +174,7 @@ void SettingsDialog::newButtonClicked()
int
count
=
m_model
->
rowCount
();
m_model
->
insertRows
(
count
,
1
);
QItemSelectionModel
*
sm
=
u
i
->
tealistTreeView
->
selectionModel
();
QItemSelectionModel
*
sm
=
mU
i
->
tealistTreeView
->
selectionModel
();
QItemSelection
selection
(
m_model
->
index
(
count
,
0
),
m_model
->
index
(
count
,
1
)
);
sm
->
select
(
selection
,
QItemSelectionModel
::
Clear
|
QItemSelectionModel
::
Select
);
}
...
...
@@ -182,7 +182,7 @@ void SettingsDialog::newButtonClicked()
void
SettingsDialog
::
removeButtonClicked
()
{
const
QModelIndexList
indexes
=
u
i
->
tealistTreeView
->
selectionModel
()
->
selectedIndexes
();
const
QModelIndexList
indexes
=
mU
i
->
tealistTreeView
->
selectionModel
()
->
selectedIndexes
();
for
(
const
QModelIndex
&
index
:
indexes
)
{
// Only delete a row when column==0, otherwise the row will be delete
...
...
@@ -208,7 +208,7 @@ void SettingsDialog::downButtonClicked()
void
SettingsDialog
::
moveSelectedItem
(
bool
moveup
)
{
QItemSelectionModel
*
sm
=
u
i
->
tealistTreeView
->
selectionModel
();
QItemSelectionModel
*
sm
=
mU
i
->
tealistTreeView
->
selectionModel
();
QModelIndexList
items
=
sm
->
selection
().
indexes
();
if
(
!
items
.
isEmpty
()
)
{
...
...
@@ -240,41 +240,41 @@ void SettingsDialog::updateSelection(const QItemSelection &selected, const QItem
bool
state
=
!
items
.
isEmpty
();
u
i
->
teaPropertiesGroup
->
setEnabled
(
state
);
u
i
->
teaNameEdit
->
setEnabled
(
state
);
u
i
->
minutesSpin
->
setEnabled
(
state
);
u
i
->
secondsSpin
->
setEnabled
(
state
);
u
i
->
removeButton
->
setEnabled
(
state
);
mU
i
->
teaPropertiesGroup
->
setEnabled
(
state
);
mU
i
->
teaNameEdit
->
setEnabled
(
state
);
mU
i
->
minutesSpin
->
setEnabled
(
state
);
mU
i
->
secondsSpin
->
setEnabled
(
state
);
mU
i
->
removeButton
->
setEnabled
(
state
);
if
(
state
)
{
name
=
m_model
->
data
(
m_model
->
index
(
items
.
at
(
0
).
row
(),
0
),
Qt
::
EditRole
).
toString
();
time
=
m_model
->
data
(
m_model
->
index
(
items
.
at
(
0
).
row
(),
1
),
Qt
::
EditRole
).
toUInt
();
u
i
->
upButton
->
setEnabled
(
items
.
at
(
0
).
row
()
>
0
);
u
i
->
downButton
->
setEnabled
(
items
.
at
(
0
).
row
()
<
(
m_model
->
rowCount
()
-
1
)
);
mU
i
->
upButton
->
setEnabled
(
items
.
at
(
0
).
row
()
>
0
);
mU
i
->
downButton
->
setEnabled
(
items
.
at
(
0
).
row
()
<
(
m_model
->
rowCount
()
-
1
)
);
}
else
{
u
i
->
upButton
->
setEnabled
(
false
);
u
i
->
downButton
->
setEnabled
(
false
);
mU
i
->
upButton
->
setEnabled
(
false
);
mU
i
->
downButton
->
setEnabled
(
false
);
}
u
i
->
teaNameEdit
->
setText
(
name
);
u
i
->
minutesSpin
->
setValue
(
time
/
60
);
u
i
->
secondsSpin
->
setValue
(
time
%
60
);
mU
i
->
teaNameEdit
->
setText
(
name
);
mU
i
->
minutesSpin
->
setValue
(
time
/
60
);
mU
i
->
secondsSpin
->
setValue
(
time
%
60
);
}
void
SettingsDialog
::
timeValueChanged
()
{
QModelIndexList
items
=
u
i
->
tealistTreeView
->
selectionModel
()
->
selection
().
indexes
();
QModelIndexList
items
=
mU
i
->
tealistTreeView
->
selectionModel
()
->
selection
().
indexes
();
if
(
!
items
.
isEmpty
()
)
{
int
time
=
u
i
->
secondsSpin
->
value
();
time
+=
u
i
->
minutesSpin
->
value
()
*
60
;
int
time
=
mU
i
->
secondsSpin
->
value
();
time
+=
mU
i
->
minutesSpin
->
value
()
*
60
;
if
(
time
<=
0
)
{
time
=
1
;
u
i
->
secondsSpin
->
setValue
(
time
);
mU
i
->
secondsSpin
->
setValue
(
time
);
}
m_model
->
setData
(
m_model
->
index
(
items
.
at
(
0
).
row
(),
1
),
time
,
Qt
::
EditRole
);
}
...
...
@@ -283,7 +283,7 @@ void SettingsDialog::timeValueChanged()
void
SettingsDialog
::
nameValueChanged
(
const
QString
&
text
)
{
QModelIndexList
items
=
u
i
->
tealistTreeView
->
selectionModel
()
->
selection
().
indexes
();
QModelIndexList
items
=
mU
i
->
tealistTreeView
->
selectionModel
()
->
selection
().
indexes
();
if
(
!
items
.
isEmpty
()
)
{
m_model
->
setData
(
m_model
->
index
(
items
.
at
(
0
).
row
(),
0
),
text
,
Qt
::
EditRole
);
...
...
src/settings.h
View file @
131f11e4
...
...
@@ -55,9 +55,9 @@ class SettingsDialog : public QDialog
void
moveSelectedItem
(
bool
moveup
);
SettingsUI
*
u
i
;
TopLevel
*
m_toplevel
;
TeaListModel
*
m_model
;
SettingsUI
*
const
mU
i
;
TopLevel
*
const
m_toplevel
;
TeaListModel
*
m_model
=
nullptr
;
};
...
...
src/tealistmodel.cpp
View file @
131f11e4
...
...
@@ -96,7 +96,7 @@ bool TeaListModel::setData(const QModelIndex &index, const QVariant &value, int
}
else
if
(
index
.
column
()
==
1
)
{
m_tealist
[
index
.
row
()
].
setTime
(
value
.
toUInt
()
);
}
emit
dataChanged
(
index
,
index
);
Q_EMIT
dataChanged
(
index
,
index
);
return
true
;
}
...
...
src/timeedit.cpp
View file @
131f11e4
...
...
@@ -42,35 +42,35 @@ class TimeEditUI : public QWidget, public Ui::TimeEditWidget
TimeEditDialog
::
TimeEditDialog
(
TopLevel
*
toplevel
)
:
QDialog
(),
m_toplevel
(
toplevel
)
:
QDialog
()
,
mUi
(
new
TimeEditUI
(
this
))
,
mToplevel
(
toplevel
)
{
setWindowTitle
(
i18n
(
"Custom Tea"
)
);
b
uttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
b
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setWhatsThis
(
i18n
(
"Start a new custom tea with the time configured in this dialog."
));
b
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setDefault
(
true
);
b
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
b
uttonBox
->
button
(
QDialogButtonBox
::
Cancel
)
->
setWhatsThis
(
i18n
(
"Close this dialog without starting a new tea."
));
mB
uttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
mB
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setWhatsThis
(
i18n
(
"Start a new custom tea with the time configured in this dialog."
));
mB
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setDefault
(
true
);
mB
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
mB
uttonBox
->
button
(
QDialogButtonBox
::
Cancel
)
->
setWhatsThis
(
i18n
(
"Close this dialog without starting a new tea."
));
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
ui
=
new
TimeEditUI
(
this
);
mainLayout
->
addWidget
(
ui
);
mainLayout
->
addWidget
(
buttonBox
);
mainLayout
->
addWidget
(
mUi
);
mainLayout
->
addWidget
(
mButtonBox
);
KSharedConfigPtr
config
=
KSharedConfig
::
openConfig
();
KConfigGroup
group
(
config
,
"AnonymousTeaDialog"
);
int
time
=
group
.
readEntry
(
"AnonymousTeaTime"
,
180
);
u
i
->
minutes
->
setSuffix
(
ki18np
(
" minute"
,
" minutes"
)
);
u
i
->
seconds
->
setSuffix
(
ki18np
(
" second"
,
" seconds"
)
);
mU
i
->
minutes
->
setSuffix
(
ki18np
(
" minute"
,
" minutes"
)
);
mU
i
->
seconds
->
setSuffix
(
ki18np
(
" second"
,
" seconds"
)
);
u
i
->
minutes
->
setValue
(
time
/
60
);
u
i
->
seconds
->
setValue
(
time
%
60
);
mU
i
->
minutes
->
setValue
(
time
/
60
);
mU
i
->
seconds
->
setValue
(
time
%
60
);
u
i
->
minutes
->
setFocus
(
Qt
::
ShortcutFocusReason
);
mU
i
->
minutes
->
setFocus
(
Qt
::
ShortcutFocusReason
);
restoreGeometry
(
group
.
readEntry
<
QByteArray
>
(
"Geometry"
,
QByteArray
()));
...
...
@@ -82,23 +82,23 @@ TimeEditDialog::TimeEditDialog(TopLevel *toplevel)
x
=
qMin
(
qMax
(
0
,
y
),
desktopSize
.
height
()
-
height
()
);
move
(
QPoint
(
x
,
y
)
);
connect
(
u
i
->
minutes
,
QOverload
<
int
>::
of
(
&
KPluralHandlingSpinBox
::
valueChanged
),
this
,
&
TimeEditDialog
::
checkOkButtonState
);
connect
(
u
i
->
seconds
,
QOverload
<
int
>::
of
(
&
KPluralHandlingSpinBox
::
valueChanged
),
this
,
&
TimeEditDialog
::
checkOkButtonState
);
connect
(
mU
i
->
minutes
,
QOverload
<
int
>::
of
(
&
KPluralHandlingSpinBox
::
valueChanged
),
this
,
&
TimeEditDialog
::
checkOkButtonState
);
connect
(
mU
i
->
seconds
,
QOverload
<
int
>::
of
(
&
KPluralHandlingSpinBox
::
valueChanged
),
this
,
&
TimeEditDialog
::
checkOkButtonState
);
connect
(
b
uttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
TimeEditDialog
::
accept
);
connect
(
b
uttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
TimeEditDialog
::
reject
);
connect
(
mB
uttonBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
TimeEditDialog
::
accept
);
connect
(
mB
uttonBox
,
&
QDialogButtonBox
::
rejected
,
this
,
&
TimeEditDialog
::
reject
);
}
TimeEditDialog
::~
TimeEditDialog
()
{
delete
u
i
;
delete
mU
i
;
}
void
TimeEditDialog
::
checkOkButtonState
()
{
b
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
u
i
->
minutes
->
value
()
||
u
i
->
seconds
->
value
()
);
mB
uttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
mU
i
->
minutes
->
value
()
||
mU
i
->
seconds
->
value
()
);
}
...
...
@@ -106,8 +106,8 @@ void TimeEditDialog::accept()
{
hide
();
int
time
=
u
i
->
seconds
->
value
();
time
+=
u
i
->
minutes
->
value
()
*
60
;
int
time
=
mU
i
->
seconds
->
value
();
time
+=
mU
i
->
minutes
->
value
()
*
60
;
KSharedConfigPtr
config
=
KSharedConfig
::
openConfig
();
KConfigGroup
group
(
config
,
"AnonymousTeaDialog"
);
...
...
@@ -117,7 +117,7 @@ void TimeEditDialog::accept()
group
.
writeEntry
(
"AnonymousTeaDialogXPos"
,
x
()
);
group
.
writeEntry
(
"AnonymousTeaDialogYPos"
,
y
()
);
m
_t
oplevel
->
runTea
(
Tea
(
i18n
(
"Custom Tea"
),
time
)
);
m
T
oplevel
->
runTea
(
Tea
(
i18n
(
"Custom Tea"
),
time
)
);
}
...
...
src/timeedit.h
View file @
131f11e4
...
...
@@ -44,9 +44,9 @@ class TimeEditDialog : public QDialog
void
checkOkButtonState
();
void
accept
()
override
;
TimeEditUI
*
u
i
;
TopLevel
*
m_t
oplevel
;
QDialogButtonBox
*
b
uttonBox
;
TimeEditUI
*
const
mU
i
;
TopLevel
*
const
mT
oplevel
;
QDialogButtonBox
*
mB
uttonBox
=
nullptr
;
};
#endif
...
...
src/toplevel.h
View file @
131f11e4
...
...
@@ -63,12 +63,12 @@ class TopLevel : public QSystemTrayIcon
void
configureNotifications
();
QList
<
Tea
>
m_tealist
;
QAction
*
action
;
QActionGroup
*
m_teaActionGroup
;
KActionCollection
*
m_actionCollection
;
QAction
*
action
=
nullptr
;
QActionGroup
*
m_teaActionGroup
=
nullptr
;
KActionCollection
*
m_actionCollection
=
nullptr
;
KHelpMenu
*
m_helpMenu
;
QTimer
*
m_timer
;
KHelpMenu
*
m_helpMenu
=
nullptr
;
QTimer
*
m_timer
=
nullptr
;
QPointer
<
KNotification
>
m_popup
;
QString
m_iconName
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment