Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
18dc97be
Commit
18dc97be
authored
3 years ago
by
t.knopff
Browse files
Options
Downloads
Patches
Plain Diff
Review comments
parent
4ba6081a
No related branches found
No related tags found
1 merge request
!392
Overhaul ui: job list
Pipeline
#46734
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Models/JobItem.cpp
+1
-2
1 addition, 2 deletions
GUI/Models/JobItem.cpp
GUI/Views/JobWidgets/JobPropertiesTableModel.cpp
+7
-20
7 additions, 20 deletions
GUI/Views/JobWidgets/JobPropertiesTableModel.cpp
with
8 additions
and
22 deletions
GUI/Models/JobItem.cpp
+
1
−
2
View file @
18dc97be
...
@@ -189,8 +189,7 @@ std::optional<size_t> JobItem::duration() const
...
@@ -189,8 +189,7 @@ std::optional<size_t> JobItem::duration() const
QDateTime
end_time
=
endTime
();
QDateTime
end_time
=
endTime
();
if
(
begin_time
.
isValid
()
&&
end_time
.
isValid
()
&&
begin_time
<
end_time
)
if
(
begin_time
.
isValid
()
&&
end_time
.
isValid
()
&&
begin_time
<
end_time
)
return
begin_time
.
msecsTo
(
end_time
);
return
begin_time
.
msecsTo
(
end_time
);
else
return
std
::
nullopt
;
return
std
::
nullopt
;
}
}
QString
JobItem
::
getComments
()
const
QString
JobItem
::
getComments
()
const
...
...
This diff is collapsed.
Click to expand it.
GUI/Views/JobWidgets/JobPropertiesTableModel.cpp
+
7
−
20
View file @
18dc97be
...
@@ -54,16 +54,14 @@ int JobPropertiesTableModel::rowCount(const QModelIndex& parent) const
...
@@ -54,16 +54,14 @@ int JobPropertiesTableModel::rowCount(const QModelIndex& parent) const
{
{
if
(
!
parent
.
isValid
()
&&
m_item
)
if
(
!
parent
.
isValid
()
&&
m_item
)
return
NumRows
;
return
NumRows
;
else
return
0
;
return
0
;
}
}
int
JobPropertiesTableModel
::
columnCount
(
const
QModelIndex
&
parent
)
const
int
JobPropertiesTableModel
::
columnCount
(
const
QModelIndex
&
parent
)
const
{
{
if
(
!
parent
.
isValid
()
&&
m_item
)
if
(
!
parent
.
isValid
()
&&
m_item
)
return
NumColumns
;
return
NumColumns
;
else
return
0
;
return
0
;
}
}
QVariant
JobPropertiesTableModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
QVariant
JobPropertiesTableModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
...
@@ -76,40 +74,30 @@ QVariant JobPropertiesTableModel::data(const QModelIndex& index, int role) const
...
@@ -76,40 +74,30 @@ QVariant JobPropertiesTableModel::data(const QModelIndex& index, int role) const
switch
(
index
.
column
())
{
switch
(
index
.
column
())
{
case
Column
::
Name
:
case
Column
::
Name
:
return
RowNames
[
index
.
row
()];
return
RowNames
[
index
.
row
()];
break
;
case
Column
::
Value
:
{
case
Column
::
Value
:
{
switch
(
index
.
row
())
{
switch
(
index
.
row
())
{
case
Row
::
Name
:
case
Row
::
Name
:
return
m_item
->
itemName
();
return
m_item
->
itemName
();
break
;
case
Row
::
Sample
:
case
Row
::
Sample
:
return
m_item
->
sampleName
();
return
m_item
->
sampleName
();
break
;
case
Row
::
Instrument
:
case
Row
::
Instrument
:
return
m_item
->
instrumentName
();
return
m_item
->
instrumentName
();
break
;
case
Row
::
Status
:
case
Row
::
Status
:
return
jobStatusToString
(
m_item
->
getStatus
());
return
jobStatusToString
(
m_item
->
getStatus
());
break
;
case
Row
::
Begin
:
case
Row
::
Begin
:
if
(
role
==
Qt
::
ToolTipRole
)
if
(
role
==
Qt
::
ToolTipRole
)
return
m_item
->
beginTime
().
toString
(
Qt
::
DefaultLocaleLongDate
);
return
m_item
->
beginTime
().
toString
(
Qt
::
DefaultLocaleLongDate
);
else
return
m_item
->
beginTime
().
toString
(
ModelDateShortFormat
);
return
m_item
->
beginTime
().
toString
(
ModelDateShortFormat
);
break
;
case
Row
::
End
:
case
Row
::
End
:
if
(
role
==
Qt
::
ToolTipRole
)
if
(
role
==
Qt
::
ToolTipRole
)
return
m_item
->
endTime
().
toString
(
Qt
::
DefaultLocaleLongDate
);
return
m_item
->
endTime
().
toString
(
Qt
::
DefaultLocaleLongDate
);
else
return
m_item
->
endTime
().
toString
(
ModelDateShortFormat
);
return
m_item
->
endTime
().
toString
(
ModelDateShortFormat
);
break
;
case
Row
::
Duration
:
{
case
Row
::
Duration
:
{
std
::
optional
<
size_t
>
duration
=
m_item
->
duration
();
std
::
optional
<
size_t
>
duration
=
m_item
->
duration
();
if
(
duration
)
if
(
duration
)
return
QString
(
"%1 s"
).
arg
(
duration
.
value
()
/
1000.
,
0
,
'f'
,
3
);
return
QString
(
"%1 s"
).
arg
(
duration
.
value
()
/
1000.
,
0
,
'f'
,
3
);
else
return
QVariant
();
return
QVariant
();
}
}
break
;
default
:
default
:
return
QVariant
();
return
QVariant
();
}
}
...
@@ -125,8 +113,7 @@ QVariant JobPropertiesTableModel::headerData(int section, Qt::Orientation orient
...
@@ -125,8 +113,7 @@ QVariant JobPropertiesTableModel::headerData(int section, Qt::Orientation orient
if
(
role
==
Qt
::
DisplayRole
&&
orientation
==
Qt
::
Horizontal
&&
section
>=
0
if
(
role
==
Qt
::
DisplayRole
&&
orientation
==
Qt
::
Horizontal
&&
section
>=
0
&&
section
<
NumColumns
)
&&
section
<
NumColumns
)
return
ColumnNames
[
section
];
return
ColumnNames
[
section
];
else
return
QVariant
();
return
QVariant
();
}
}
Qt
::
ItemFlags
JobPropertiesTableModel
::
flags
(
const
QModelIndex
&
index
)
const
Qt
::
ItemFlags
JobPropertiesTableModel
::
flags
(
const
QModelIndex
&
index
)
const
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment