Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
KCron
Commits
43cb1a84
Commit
43cb1a84
authored
Jan 14, 2021
by
Laurent Montel
😁
Browse files
Rename private variables
parent
0f82a544
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
src/kcmCron.cpp
View file @
43cb1a84
...
...
@@ -30,24 +30,8 @@
K_PLUGIN_FACTORY
(
KCMCronFactory
,
registerPlugin
<
KCMCron
>
();
)
class
KCMCronPrivate
{
public:
/**
* Main GUI view/working area.
*/
CrontabWidget
*
crontabWidget
=
nullptr
;
/**
* Document object, here crotab entries.
*/
CTHost
*
ctHost
=
nullptr
;
};
KCMCron
::
KCMCron
(
QWidget
*
parent
,
const
QVariantList
&
/*args*/
)
:
KCModule
(
parent
)
,
d
(
new
KCMCronPrivate
())
{
KAboutData
*
aboutData
=
new
KAboutData
(
QStringLiteral
(
"kcm_cron"
),
i18n
(
"Task Scheduler"
),
QStringLiteral
(
"5.0"
),
i18n
(
"KDE Task Scheduler"
),
KAboutLicense
::
GPL
,
i18n
(
"(c) 2008, Nicolas Ternisien
\n
(c) 1999-2000, Gary Meyer"
));
...
...
@@ -62,23 +46,23 @@ KCMCron::KCMCron(QWidget *parent, const QVariantList & /*args*/)
// Initialize document.
CTInitializationError
ctInitializationError
;
d
->
c
tHost
=
new
CTHost
(
findCrontabBinary
(),
ctInitializationError
);
mC
tHost
=
new
CTHost
(
findCrontabBinary
(),
ctInitializationError
);
if
(
ctInitializationError
.
hasErrorMessage
())
{
KMessageBox
::
error
(
this
,
i18n
(
"The following error occurred while initializing KCron:"
"
\n\n
%1
\n\n
KCron will now exit.
\n
"
,
ctInitializationError
.
errorMessage
()));
}
d
->
c
rontabWidget
=
new
CrontabWidget
(
this
,
d
->
c
tHost
);
mC
rontabWidget
=
new
CrontabWidget
(
this
,
mC
tHost
);
logDebug
()
<<
"Crontab Widget initialized"
;
connect
(
d
->
c
rontabWidget
->
tasksWidget
(),
SIGNAL
(
taskModified
(
bool
)),
this
,
SIGNAL
(
changed
(
bool
)));
connect
(
d
->
c
rontabWidget
->
variablesWidget
(),
SIGNAL
(
variableModified
(
bool
)),
this
,
SIGNAL
(
changed
(
bool
)));
connect
(
mC
rontabWidget
->
tasksWidget
(),
SIGNAL
(
taskModified
(
bool
)),
this
,
SIGNAL
(
changed
(
bool
)));
connect
(
mC
rontabWidget
->
variablesWidget
(),
SIGNAL
(
variableModified
(
bool
)),
this
,
SIGNAL
(
changed
(
bool
)));
// Initialize view.
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
layout
->
addWidget
(
d
->
c
rontabWidget
);
layout
->
addWidget
(
mC
rontabWidget
);
init
();
}
...
...
@@ -90,24 +74,23 @@ QString KCMCron::findCrontabBinary()
KCMCron
::~
KCMCron
()
{
delete
d
->
c
rontabWidget
;
delete
d
->
c
tHost
;
delete
mC
rontabWidget
;
delete
mC
tHost
;
delete
d
;
}
void
KCMCron
::
load
()
{
logDebug
()
<<
"Calling load"
;
d
->
c
tHost
->
cancel
();
mC
tHost
->
cancel
();
}
void
KCMCron
::
save
()
{
logDebug
()
<<
"Saving crontab..."
;
CTSaveStatus
saveStatus
=
d
->
c
tHost
->
save
();
CTSaveStatus
saveStatus
=
mC
tHost
->
save
();
if
(
saveStatus
.
isError
()
==
true
)
{
KMessageBox
::
detailedError
(
this
,
saveStatus
.
errorMessage
(),
saveStatus
.
detailErrorMessage
());
}
...
...
@@ -117,16 +100,16 @@ void KCMCron::defaults()
{
logDebug
()
<<
"Loading defaults"
;
d
->
c
tHost
->
cancel
();
mC
tHost
->
cancel
();
}
bool
KCMCron
::
init
()
{
// Display greeting screen.
// if there currently are no scheduled tasks...
if
(
!
d
->
c
tHost
->
isRootUser
())
{
if
(
!
mC
tHost
->
isRootUser
())
{
int
taskCount
=
0
;
foreach
(
CTCron
*
ctCron
,
d
->
c
tHost
->
crons
)
{
foreach
(
CTCron
*
ctCron
,
mC
tHost
->
crons
)
{
taskCount
+=
ctCron
->
tasks
().
count
();
}
...
...
@@ -142,7 +125,7 @@ bool KCMCron::init()
CTHost
*
KCMCron
::
ctHost
()
const
{
return
d
->
c
tHost
;
return
mC
tHost
;
}
#include "kcmCron.moc"
src/kcmCron.h
View file @
43cb1a84
...
...
@@ -23,8 +23,7 @@
#include <KSharedConfig>
class
CTHost
;
class
KCMCronPrivate
;
class
CrontabWidget
;
class
KCMCron
:
public
KCModule
{
...
...
@@ -53,8 +52,15 @@ public:
QString
findCrontabBinary
();
private:
/**
* Main GUI view/working area.
*/
CrontabWidget
*
mCrontabWidget
=
nullptr
;
KCMCronPrivate
*
const
d
;
/**
* Document object, here crotab entries.
*/
CTHost
*
mCtHost
=
nullptr
;
};
#endif // KCM_CRON_H
src/taskEditorDialog.cpp
View file @
43cb1a84
This diff is collapsed.
Click to expand it.
src/taskEditorDialog.h
View file @
43cb1a84
...
...
@@ -65,9 +65,9 @@ public:
void
paintEvent
(
QPaintEvent
*
)
override
;
bool
i
sDirty
;
QPalette
p
alSelected
;
QPalette
p
alNormal
;
bool
mI
sDirty
;
QPalette
mP
alSelected
;
QPalette
mP
alNormal
;
};
/**
...
...
@@ -197,51 +197,51 @@ private:
/**
* Task.
*/
CTTask
*
c
tTask
;
CTTask
*
mC
tTask
=
nullptr
;
CrontabWidget
*
c
rontabWidget
;
CrontabWidget
*
mC
rontabWidget
=
nullptr
;
// Widgets.
KTitleWidget
*
t
itleWidget
;
QPushButton
*
o
kButton
;
KTitleWidget
*
mT
itleWidget
=
nullptr
;
QPushButton
*
mO
kButton
=
nullptr
;
QComboBox
*
u
serCombo
;
QComboBox
*
mU
serCombo
=
nullptr
;
QTextEdit
*
l
eComment
;
QTextEdit
*
mL
eComment
=
nullptr
;
QLabel
*
c
ommandIcon
;
QPixmap
missingCommandPixmap
;
KUrlRequester
*
c
ommand
;
QLabel
*
mC
ommandIcon
=
nullptr
;
QPixmap
m
M
issingCommandPixmap
;
KUrlRequester
*
mC
ommand
=
nullptr
;
QCheckBox
*
c
hkEnabled
;
QCheckBox
*
c
hkReboot
;
QCheckBox
*
c
bEveryDay
;
QCheckBox
*
mC
hkEnabled
=
nullptr
;
QCheckBox
*
mC
hkReboot
=
nullptr
;
QCheckBox
*
mC
bEveryDay
=
nullptr
;
QGroupBox
*
b
gMonth
;
NumberPushButton
*
monthButtons
[
13
];
// The index 0 is not used
SetOrClearAllButton
*
a
llMonths
;
QGroupBox
*
mB
gMonth
=
nullptr
;
NumberPushButton
*
m
M
onthButtons
[
13
];
// The index 0 is not used
SetOrClearAllButton
*
mA
llMonths
=
nullptr
;
QGroupBox
*
b
gDayOfMonth
;
NumberPushButton
*
d
ayOfMonthButtons
[
32
];
// The index 0 is not used
SetOrClearAllButton
*
a
llDaysOfMonth
;
QGroupBox
*
mB
gDayOfMonth
;
NumberPushButton
*
mD
ayOfMonthButtons
[
32
];
// The index 0 is not used
SetOrClearAllButton
*
mA
llDaysOfMonth
=
nullptr
;
QGroupBox
*
b
gDayOfWeek
;
NumberPushButton
*
d
ayOfWeekButtons
[
8
];
// The index 0 is not used
SetOrClearAllButton
*
a
llDaysOfWeek
;
QGroupBox
*
mB
gDayOfWeek
=
nullptr
;
NumberPushButton
*
mD
ayOfWeekButtons
[
8
];
// The index 0 is not used
SetOrClearAllButton
*
mA
llDaysOfWeek
=
nullptr
;
QGroupBox
*
h
oursGroup
;
QLabel
*
morningLabel
;
QLabel
*
a
fternoonLabel
;
QPushButton
*
h
ourButtons
[
24
];
SetOrClearAllButton
*
a
llHours
;
QGroupBox
*
mH
oursGroup
=
nullptr
;
QLabel
*
m
M
orningLabel
=
nullptr
;
QLabel
*
mA
fternoonLabel
=
nullptr
;
QPushButton
*
mH
ourButtons
[
24
];
SetOrClearAllButton
*
mA
llHours
=
nullptr
;
QGroupBox
*
minutesGroup
;
QGridLayout
*
minutesLayout
;
QPushButton
*
minuteButtons
[
60
];
QGroupBox
*
m
M
inutesGroup
=
nullptr
;
QGridLayout
*
m
M
inutesLayout
=
nullptr
;
QPushButton
*
m
M
inuteButtons
[
60
];
QHBoxLayout
*
minutesPreselectionLayout
;
QComboBox
*
minutesPreselection
;
QHBoxLayout
*
m
M
inutesPreselectionLayout
=
nullptr
;
QComboBox
*
m
M
inutesPreselection
=
nullptr
;
static
const
int
minuteTotal
=
59
;
// or 55 or 59
...
...
@@ -249,7 +249,7 @@ private:
static
const
int
reducedMinuteStep
=
5
;
QStringList
s
pecialValidCommands
;
QStringList
mS
pecialValidCommands
;
};
#endif // TASK_EDITOR_DIALOG_H
src/taskWidget.cpp
View file @
43cb1a84
...
...
@@ -21,8 +21,8 @@
TaskWidget
::
TaskWidget
(
TasksWidget
*
_tasksWidget
,
CTTask
*
_cttask
)
:
QTreeWidgetItem
(
_tasksWidget
->
treeWidget
())
{
c
tTask
=
_cttask
;
t
asksWidget
=
_tasksWidget
;
mC
tTask
=
_cttask
;
mT
asksWidget
=
_tasksWidget
;
refresh
();
}
...
...
@@ -31,16 +31,16 @@ void TaskWidget::refresh()
{
int
column
=
0
;
if
(
t
asksWidget
->
needUserColumn
())
{
setText
(
column
++
,
c
tTask
->
userLogin
);
if
(
mT
asksWidget
->
needUserColumn
())
{
setText
(
column
++
,
mC
tTask
->
userLogin
);
}
setText
(
column
++
,
c
tTask
->
schedulingCronFormat
());
setText
(
column
++
,
mC
tTask
->
schedulingCronFormat
());
setText
(
column
,
c
tTask
->
command
);
setIcon
(
column
++
,
c
tTask
->
commandIcon
());
setText
(
column
,
mC
tTask
->
command
);
setIcon
(
column
++
,
mC
tTask
->
commandIcon
());
if
(
c
tTask
->
enabled
)
{
if
(
mC
tTask
->
enabled
)
{
setText
(
column
,
i18n
(
"Enabled"
));
setIcon
(
column
++
,
QIcon
::
fromTheme
(
QStringLiteral
(
"dialog-ok-apply"
)));
}
else
{
...
...
@@ -48,17 +48,17 @@ void TaskWidget::refresh()
setIcon
(
column
++
,
QIcon
::
fromTheme
(
QStringLiteral
(
"dialog-cancel"
)));
}
setText
(
column
++
,
c
tTask
->
comment
);
setText
(
column
++
,
c
tTask
->
describe
());
setText
(
column
++
,
mC
tTask
->
comment
);
setText
(
column
++
,
mC
tTask
->
describe
());
}
void
TaskWidget
::
toggleEnable
()
{
c
tTask
->
enabled
=
!
c
tTask
->
enabled
;
mC
tTask
->
enabled
=
!
mC
tTask
->
enabled
;
refresh
();
}
CTTask
*
TaskWidget
::
getCTTask
()
const
{
return
c
tTask
;
return
mC
tTask
;
}
src/taskWidget.h
View file @
43cb1a84
...
...
@@ -46,9 +46,9 @@ private:
/**
* Task.
*/
CTTask
*
c
tTask
;
CTTask
*
mC
tTask
=
nullptr
;
TasksWidget
*
t
asksWidget
;
TasksWidget
*
mT
asksWidget
=
nullptr
;
};
#endif // TASK_WIDGET_H
src/tasksWidget.cpp
View file @
43cb1a84
...
...
@@ -25,27 +25,11 @@
#include "logging.h"
class
TasksWidgetPrivate
{
public:
QAction
*
newTaskAction
;
QAction
*
modifyAction
;
QAction
*
deleteAction
;
QAction
*
runNowAction
;
QAction
*
printAction
;
};
/**
* Construct tasks folder from branch.
*/
TasksWidget
::
TasksWidget
(
CrontabWidget
*
crontabWidget
)
:
GenericListWidget
(
crontabWidget
,
i18n
(
"<b>Scheduled Tasks</b>"
),
QIcon
::
fromTheme
(
QStringLiteral
(
"system-run"
)))
,
d
(
new
TasksWidgetPrivate
())
{
refreshHeaders
();
...
...
@@ -61,7 +45,6 @@ TasksWidget::TasksWidget(CrontabWidget *crontabWidget)
TasksWidget
::~
TasksWidget
()
{
delete
d
;
}
QList
<
TaskWidget
*>
TasksWidget
::
selectedTasksWidget
()
const
...
...
@@ -261,44 +244,44 @@ bool TasksWidget::needUserColumn() const
void
TasksWidget
::
setupActions
(
CrontabWidget
*
crontabWidget
)
{
d
->
n
ewTaskAction
=
new
QAction
(
this
);
d
->
n
ewTaskAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-new"
)));
d
->
n
ewTaskAction
->
setText
(
i18nc
(
"Adds a new task"
,
"New &Task..."
));
d
->
n
ewTaskAction
->
setToolTip
(
i18n
(
"Create a new task."
));
addRightAction
(
d
->
n
ewTaskAction
,
this
,
SLOT
(
createTask
()));
d
->
modifyAction
=
new
QAction
(
this
);
d
->
modifyAction
->
setText
(
i18n
(
"M&odify..."
));
d
->
modifyAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-open"
)));
d
->
modifyAction
->
setToolTip
(
i18n
(
"Modify the selected task."
));
addRightAction
(
d
->
modifyAction
,
this
,
SLOT
(
modifySelection
()));
d
->
d
eleteAction
=
new
QAction
(
this
);
d
->
d
eleteAction
->
setText
(
i18n
(
"&Delete"
));
d
->
d
eleteAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)));
d
->
d
eleteAction
->
setToolTip
(
i18n
(
"Delete the selected task."
));
addRightAction
(
d
->
d
eleteAction
,
this
,
SLOT
(
deleteSelection
()));
d
->
r
unNowAction
=
new
QAction
(
this
);
d
->
r
unNowAction
->
setText
(
i18n
(
"&Run Now"
));
d
->
r
unNowAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"system-run"
)));
d
->
r
unNowAction
->
setToolTip
(
i18n
(
"Run the selected task now."
));
addRightAction
(
d
->
r
unNowAction
,
this
,
SLOT
(
runTaskNow
()));
d
->
p
rintAction
=
KStandardAction
::
print
(
crontabWidget
,
SLOT
(
print
()),
this
);
addRightAction
(
d
->
p
rintAction
,
crontabWidget
,
SLOT
(
print
()));
mN
ewTaskAction
=
new
QAction
(
this
);
mN
ewTaskAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-new"
)));
mN
ewTaskAction
->
setText
(
i18nc
(
"Adds a new task"
,
"New &Task..."
));
mN
ewTaskAction
->
setToolTip
(
i18n
(
"Create a new task."
));
addRightAction
(
mN
ewTaskAction
,
this
,
SLOT
(
createTask
()));
m
M
odifyAction
=
new
QAction
(
this
);
m
M
odifyAction
->
setText
(
i18n
(
"M&odify..."
));
m
M
odifyAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-open"
)));
m
M
odifyAction
->
setToolTip
(
i18n
(
"Modify the selected task."
));
addRightAction
(
m
M
odifyAction
,
this
,
SLOT
(
modifySelection
()));
mD
eleteAction
=
new
QAction
(
this
);
mD
eleteAction
->
setText
(
i18n
(
"&Delete"
));
mD
eleteAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)));
mD
eleteAction
->
setToolTip
(
i18n
(
"Delete the selected task."
));
addRightAction
(
mD
eleteAction
,
this
,
SLOT
(
deleteSelection
()));
mR
unNowAction
=
new
QAction
(
this
);
mR
unNowAction
->
setText
(
i18n
(
"&Run Now"
));
mR
unNowAction
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"system-run"
)));
mR
unNowAction
->
setToolTip
(
i18n
(
"Run the selected task now."
));
addRightAction
(
mR
unNowAction
,
this
,
SLOT
(
runTaskNow
()));
mP
rintAction
=
KStandardAction
::
print
(
crontabWidget
,
SLOT
(
print
()),
this
);
addRightAction
(
mP
rintAction
,
crontabWidget
,
SLOT
(
print
()));
addRightStretch
();
}
void
TasksWidget
::
prepareContextualMenu
()
{
treeWidget
()
->
addAction
(
d
->
n
ewTaskAction
);
treeWidget
()
->
addAction
(
mN
ewTaskAction
);
treeWidget
()
->
addAction
(
createSeparator
());
treeWidget
()
->
addAction
(
d
->
modifyAction
);
treeWidget
()
->
addAction
(
d
->
d
eleteAction
);
treeWidget
()
->
addAction
(
m
M
odifyAction
);
treeWidget
()
->
addAction
(
mD
eleteAction
);
treeWidget
()
->
addAction
(
createSeparator
());
...
...
@@ -308,28 +291,28 @@ void TasksWidget::prepareContextualMenu()
treeWidget
()
->
addAction
(
createSeparator
());
treeWidget
()
->
addAction
(
d
->
r
unNowAction
);
treeWidget
()
->
addAction
(
mR
unNowAction
);
}
void
TasksWidget
::
toggleRunNowAction
(
bool
state
)
{
setActionEnabled
(
d
->
r
unNowAction
,
state
);
setActionEnabled
(
mR
unNowAction
,
state
);
}
void
TasksWidget
::
togglePrintAction
(
bool
state
)
{
setActionEnabled
(
d
->
p
rintAction
,
state
);
setActionEnabled
(
mP
rintAction
,
state
);
}
void
TasksWidget
::
toggleModificationActions
(
bool
state
)
{
setActionEnabled
(
d
->
modifyAction
,
state
);
setActionEnabled
(
d
->
d
eleteAction
,
state
);
setActionEnabled
(
m
M
odifyAction
,
state
);
setActionEnabled
(
mD
eleteAction
,
state
);
}
void
TasksWidget
::
toggleNewEntryAction
(
bool
state
)
{
setActionEnabled
(
d
->
n
ewTaskAction
,
state
);
setActionEnabled
(
mN
ewTaskAction
,
state
);
}
void
TasksWidget
::
changeCurrentSelection
()
...
...
src/tasksWidget.h
View file @
43cb1a84
...
...
@@ -16,8 +16,6 @@
class
TaskWidget
;
class
TasksWidgetPrivate
;
/**
* QTreeWidget of a "tasks" folder.
*/
...
...
@@ -95,7 +93,15 @@ private:
void
setupActions
(
CrontabWidget
*
crontabWidget
);
void
prepareContextualMenu
();
TasksWidgetPrivate
*
const
d
;
QAction
*
mNewTaskAction
=
nullptr
;
QAction
*
mModifyAction
=
nullptr
;
QAction
*
mDeleteAction
=
nullptr
;
QAction
*
mRunNowAction
=
nullptr
;
QAction
*
mPrintAction
=
nullptr
;
};
#endif // TASKS_WIDGET_H
src/variableEditorDialog.cpp
View file @
43cb1a84
...
...
@@ -25,13 +25,13 @@
VariableEditorDialog
::
VariableEditorDialog
(
CTVariable
*
_ctVariable
,
const
QString
&
_caption
,
CrontabWidget
*
_crontabWidget
)
:
QDialog
(
_crontabWidget
)
{
c
tVariable
=
_ctVariable
;
c
rontabWidget
=
_crontabWidget
;
mC
tVariable
=
_ctVariable
;
mC
rontabWidget
=
_crontabWidget
;
setModal
(
true
);
setWindowTitle
(
_caption
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
o
kButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
mO
kButton
=
buttonBox
->
button
(
QDialogButtonBox
::
Ok
);
QGridLayout
*
layout
=
new
QGridLayout
;
setLayout
(
layout
);
...
...
@@ -45,36 +45,36 @@ VariableEditorDialog::VariableEditorDialog(CTVariable *_ctVariable, const QStrin
int
layoutPosition
=
0
;
// top title widget
t
itleWidget
=
new
KTitleWidget
(
this
);
t
itleWidget
->
setText
(
i18n
(
"Add or modify a variable"
));
layout
->
addWidget
(
t
itleWidget
,
layoutPosition
,
0
,
1
,
2
);
mT
itleWidget
=
new
KTitleWidget
(
this
);
mT
itleWidget
->
setText
(
i18n
(
"Add or modify a variable"
));
layout
->
addWidget
(
mT
itleWidget
,
layoutPosition
,
0
,
1
,
2
);
// variable
QLabel
*
labVariable
=
new
QLabel
(
i18nc
(
"The environmental variable name ie HOME, MAILTO etc"
,
"&Variable:"
),
this
);
layout
->
addWidget
(
labVariable
,
++
layoutPosition
,
0
,
Qt
::
AlignLeft
);
c
mbVariable
=
new
QComboBox
(
this
);
c
mbVariable
->
setEditable
(
true
);
layout
->
addWidget
(
c
mbVariable
,
layoutPosition
,
1
);
mC
mbVariable
=
new
QComboBox
(
this
);
mC
mbVariable
->
setEditable
(
true
);
layout
->
addWidget
(
mC
mbVariable
,
layoutPosition
,
1
);
c
mbVariable
->
addItem
(
QStringLiteral
(
"HOME"
));
c
mbVariable
->
addItem
(
QStringLiteral
(
"MAILTO"
));
c
mbVariable
->
addItem
(
QStringLiteral
(
"PATH"
));
c
mbVariable
->
addItem
(
QStringLiteral
(
"SHELL"
));
c
mbVariable
->
addItem
(
QStringLiteral
(
"LD_CONFIG_PATH"
));
mC
mbVariable
->
addItem
(
QStringLiteral
(
"HOME"
));
mC
mbVariable
->
addItem
(
QStringLiteral
(
"MAILTO"
));
mC
mbVariable
->
addItem
(
QStringLiteral
(
"PATH"
));
mC
mbVariable
->
addItem
(
QStringLiteral
(
"SHELL"
));
mC
mbVariable
->
addItem
(
QStringLiteral
(
"LD_CONFIG_PATH"
));
labVariable
->
setBuddy
(
c
mbVariable
);
labVariable
->
setBuddy
(
mC
mbVariable
);
// details
QLabel
*
labDetails
=
new
QLabel
(
QLatin1String
(
""
),
this
);
layout
->
addWidget
(
labDetails
,
++
layoutPosition
,
0
,
Qt
::
AlignLeft
);
QHBoxLayout
*
detailsLayout
=
new
QHBoxLayout
;
d
etailsIcon
=
new
QLabel
(
this
);
detailsLayout
->
addWidget
(
d
etailsIcon
);
mD
etailsIcon
=
new
QLabel
(
this
);
detailsLayout
->
addWidget
(
mD
etailsIcon
);
d
etails
=
new
QLabel
(
this
);
detailsLayout
->
addWidget
(
d
etails
);
mD
etails
=
new
QLabel
(
this
);
detailsLayout
->
addWidget
(
mD
etails
);
layout
->
addLayout
(
detailsLayout
,
layoutPosition
,
1
,
Qt
::
AlignLeft
);
...
...
@@ -82,58 +82,58 @@ VariableEditorDialog::VariableEditorDialog(CTVariable *_ctVariable, const QStrin
QLabel
*
labValue
=
new
QLabel
(
i18n
(
"Va&lue:"
),
this
);
layout
->
addWidget
(
labValue
,
++
layoutPosition
,
0
,
Qt
::
AlignLeft
);
l
eValue
=
new
QLineEdit
(
this
);
layout
->
addWidget
(
l
eValue
,
layoutPosition
,
1
);
l
eValue
->
setMaxLength
(
255
);
labValue
->
setBuddy
(
l
eValue
);
mL
eValue
=
new
QLineEdit
(
this
);
layout
->
addWidget
(
mL
eValue
,
layoutPosition
,
1
);
mL
eValue
->
setMaxLength
(
255
);
labValue
->
setBuddy
(
mL
eValue
);
// User Combo
QLabel
*
userLabel
=
new
QLabel
(
i18n
(
"&Run as:"
),
this
);
layout
->
addWidget
(
userLabel
,
++
layoutPosition
,
0
);
u
serCombo
=
new
QComboBox
(
this
);
mU
serCombo
=
new
QComboBox
(
this
);
userLabel
->
setBuddy
(
u
serCombo
);
layout
->
addWidget
(
u
serCombo
,
layoutPosition
,
1
);
userLabel
->
setBuddy
(
mU
serCombo
);
layout
->
addWidget
(
mU
serCombo
,
layoutPosition
,
1
);
if
(
c
rontabWidget
->
variablesWidget
()
->
needUserColumn
())
{
KCronHelper
::
initUserCombo
(
u
serCombo
,
c
rontabWidget
,
c
tVariable
->
userLogin
);
if
(
mC
rontabWidget
->
variablesWidget
()
->
needUserColumn
())
{
KCronHelper
::
initUserCombo
(
mU
serCombo
,
mC
rontabWidget
,
mC
tVariable
->
userLogin
);
}
else
{
userLabel
->
hide
();
u
serCombo
->
hide
();
mU
serCombo
->
hide
();
}
// comment
QLabel
*
labComment
=
new
QLabel
(
i18n
(
"Co&mment:"
),
this
);
layout
->
addWidget
(
labComment
,
++
layoutPosition
,
0
,
Qt
::
AlignLeft
);
t
eComment
=
KCronHelper
::
createCommentEdit
(
this
);
layout
->
addWidget
(
t
eComment
,
layoutPosition
,
1
);
labComment
->
setBuddy
(
t
eComment
);
mT
eComment
=
KCronHelper
::
createCommentEdit
(
this
);
layout
->
addWidget
(
mT
eComment
,
layoutPosition
,
1
);
labComment
->
setBuddy
(
mT
eComment
);
// enabled
c
hkEnabled
=
new
QCheckBox
(
i18n
(
"&Enable this variable"
),
this
);
layout
->
addWidget
(
c
hkEnabled
,
++
layoutPosition
,
0
,
1
,
2
);
mC
hkEnabled
=
new
QCheckBox
(
i18n
(
"&Enable this variable"
),
this
);
layout
->
addWidget
(
mC
hkEnabled
,
++
layoutPosition
,
0
,
1
,
2
);
layout
->
addWidget
(
buttonBox
,
++
layoutPosition
,
0
,
1
,
2
);
// set starting field values
c
mbVariable
->
setEditText
(
c
tVariable
->
variable
);
l
eValue
->
setText
(
c
tVariable
->
value
);
t
eComment
->
setText
(
c
tVariable
->
comment
);
c
hkEnabled
->