mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:46:03 +00:00
UI: ProgramsWindow: Tweak "End Time" column.
This commit is contained in:
parent
14d521ef38
commit
5b9b770eb8
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
#define APPS_HEADER_VERSION 2
|
#define APPS_HEADER_VERSION 3
|
||||||
|
|
||||||
const ValuesList appBlockInHourValues = {
|
const ValuesList appBlockInHourValues = {
|
||||||
3, 1, 6, 12, 24, 24 * 7, 24 * 30
|
3, 1, 6, 12, 24, 24 * 7, 24 * 30
|
||||||
@ -412,11 +412,13 @@ void ProgramsWindow::setupTableAppsHeader()
|
|||||||
header->setSectionResizeMode(0, QHeaderView::Interactive);
|
header->setSectionResizeMode(0, QHeaderView::Interactive);
|
||||||
header->setSectionResizeMode(1, QHeaderView::Interactive);
|
header->setSectionResizeMode(1, QHeaderView::Interactive);
|
||||||
header->setSectionResizeMode(2, QHeaderView::Interactive);
|
header->setSectionResizeMode(2, QHeaderView::Interactive);
|
||||||
header->setSectionResizeMode(3, QHeaderView::Stretch);
|
header->setSectionResizeMode(3, QHeaderView::Fixed);
|
||||||
header->setSectionResizeMode(4, QHeaderView::Stretch);
|
header->setSectionResizeMode(4, QHeaderView::Stretch);
|
||||||
|
|
||||||
header->resizeSection(0, 540);
|
header->resizeSection(0, 600);
|
||||||
|
header->resizeSection(1, 120);
|
||||||
header->resizeSection(2, 100);
|
header->resizeSection(2, 100);
|
||||||
|
header->resizeSection(3, 30);
|
||||||
|
|
||||||
header->setSectionsClickable(true);
|
header->setSectionsClickable(true);
|
||||||
header->setSortIndicatorShown(true);
|
header->setSortIndicatorShown(true);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
<file>images/chart_bar.png</file>
|
<file>images/chart_bar.png</file>
|
||||||
<file>images/chart_line.png</file>
|
<file>images/chart_line.png</file>
|
||||||
<file>images/clock.png</file>
|
<file>images/clock.png</file>
|
||||||
|
<file>images/clock_stop.png</file>
|
||||||
<file>images/cog.png</file>
|
<file>images/cog.png</file>
|
||||||
<file>images/computer-96.png</file>
|
<file>images/computer-96.png</file>
|
||||||
<file>images/control_fastforward.png</file>
|
<file>images/control_fastforward.png</file>
|
||||||
|
Binary file not shown.
@ -88,8 +88,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../model/applistmodel.cpp" line="93"/>
|
<location filename="../model/applistmodel.cpp" line="93"/>
|
||||||
<source>End Time</source>
|
<source>End</source>
|
||||||
<translation>Время окончания</translation>
|
<translation>Кон.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../model/applistmodel.cpp" line="94"/>
|
<location filename="../model/applistmodel.cpp" line="94"/>
|
||||||
@ -246,12 +246,12 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ConfManager</name>
|
<name>ConfManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../conf/confmanager.cpp" line="316"/>
|
<location filename="../conf/confmanager.cpp" line="332"/>
|
||||||
<source>Configuration Error</source>
|
<source>Configuration Error</source>
|
||||||
<translation>Ошибка конфигурации</translation>
|
<translation>Ошибка конфигурации</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../conf/confmanager.cpp" line="808"/>
|
<location filename="../conf/confmanager.cpp" line="827"/>
|
||||||
<source>Application '%1' already exists</source>
|
<source>Application '%1' already exists</source>
|
||||||
<translation>Приложение '%1' уже существует</translation>
|
<translation>Приложение '%1' уже существует</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1119,7 +1119,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>TaskInfoZoneDownloader</name>
|
<name>TaskInfoZoneDownloader</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../task/taskinfozonedownloader.cpp" line="31"/>
|
<location filename="../task/taskinfozonedownloader.cpp" line="36"/>
|
||||||
<source>Zone Addresses Updated!</source>
|
<source>Zone Addresses Updated!</source>
|
||||||
<translation>Адреса зон обновлены!</translation>
|
<translation>Адреса зон обновлены!</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1228,41 +1228,46 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="81"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="81"/>
|
||||||
|
<source>Store Text</source>
|
||||||
|
<translation>Сохранять текст</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../form/zone/zoneswindow.cpp" line="82"/>
|
||||||
<source>Custom URL</source>
|
<source>Custom URL</source>
|
||||||
<translation>Нестандартная ссылка</translation>
|
<translation>Нестандартная ссылка</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="82"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="83"/>
|
||||||
<source>URL:</source>
|
<source>URL:</source>
|
||||||
<translation>Ссылка:</translation>
|
<translation>Ссылка:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="83"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="84"/>
|
||||||
<source>Form Data:</source>
|
<source>Form Data:</source>
|
||||||
<translation>Данные формы:</translation>
|
<translation>Данные формы:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="84"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="85"/>
|
||||||
<source>OK</source>
|
<source>OK</source>
|
||||||
<translation>OK</translation>
|
<translation>OK</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="85"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="86"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation>Отмена</translation>
|
<translation>Отмена</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="87"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="88"/>
|
||||||
<source>Edit Zone</source>
|
<source>Edit Zone</source>
|
||||||
<translation>Редактирование зоны</translation>
|
<translation>Редактирование зоны</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="91"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="92"/>
|
||||||
<source>Zones</source>
|
<source>Zones</source>
|
||||||
<translation>Зоны</translation>
|
<translation>Зоны</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../form/zone/zoneswindow.cpp" line="245"/>
|
<location filename="../form/zone/zoneswindow.cpp" line="251"/>
|
||||||
<source>Are you sure to remove selected zone?</source>
|
<source>Are you sure to remove selected zone?</source>
|
||||||
<translation>Удалить выбранную зону?</translation>
|
<translation>Удалить выбранную зону?</translation>
|
||||||
</message>
|
</message>
|
||||||
|
BIN
src/ui/images/clock_stop.png
Normal file
BIN
src/ui/images/clock_stop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 922 B |
@ -90,7 +90,7 @@ QVariant AppListModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
case 0: return tr("Program");
|
case 0: return tr("Program");
|
||||||
case 1: return tr("Group");
|
case 1: return tr("Group");
|
||||||
case 2: return tr("State");
|
case 2: return tr("State");
|
||||||
case 3: return tr("End Time");
|
case 3: return tr("End");
|
||||||
case 4: return tr("Creation Time");
|
case 4: return tr("Creation Time");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,8 +132,8 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
|
|||||||
if (appRow.blocked) return tr("Block");
|
if (appRow.blocked) return tr("Block");
|
||||||
return tr("Allow");
|
return tr("Allow");
|
||||||
}
|
}
|
||||||
case 3: return appRow.endTime.isValid()
|
case 3: return (role == Qt::DisplayRole || appRow.endTime.isNull())
|
||||||
? appRow.endTime : QVariant();
|
? QVariant() : appRow.endTime;
|
||||||
case 4: return appRow.creatTime;
|
case 4: return appRow.creatTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
|
|||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
const int column = index.column();
|
const int column = index.column();
|
||||||
|
|
||||||
if (column == 0 || column == 2) {
|
if (column == 0 || column == 2 || column == 3) {
|
||||||
const int row = index.row();
|
const int row = index.row();
|
||||||
const auto appRow = appRowAt(row);
|
const auto appRow = appRowAt(row);
|
||||||
|
|
||||||
@ -162,6 +162,9 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
|
|||||||
case 2:
|
case 2:
|
||||||
return appRow.blocked ? QIcon(":/images/stop.png")
|
return appRow.blocked ? QIcon(":/images/stop.png")
|
||||||
: QIcon(":/images/arrow_switch.png");
|
: QIcon(":/images/arrow_switch.png");
|
||||||
|
case 3:
|
||||||
|
return appRow.endTime.isNull() ? QVariant()
|
||||||
|
: QIcon(":/images/clock_stop.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user