WSF
ChangeHistory.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef CHANGEHISTORY_HPP
13#define CHANGEHISTORY_HPP
14
15#include <memory>
16
17#include <QDialog>
18
19#include "UtPath.hpp"
20#include "ui_ChangeHistory.h"
21
22class QDateTime;
23class QListWidgetItem;
24
25namespace wizard
26{
27class RevisionStore;
28
31class ChangeHistory : public QDialog
32{
33 Q_OBJECT
34public:
35 explicit ChangeHistory(RevisionStore& aRevisionStore, const UtPath& aProjectDir, QWidget* aParent = nullptr);
36 ChangeHistory(const ChangeHistory&) = delete;
40 ~ChangeHistory() override = default;
41
42public slots:
45 void DeleteAllRevisions();
46 void UpdateWidgets();
47 void UpdateDiff();
48 void NavigateDiff();
49
50private:
51 QString Anchor(size_t listIndex);
52 int SelectedRevNo() const;
53 bool IsRevSelected() const;
54 bool RestoreConfirmation();
55 bool DeleteAllConfirmation();
56 void SetDiffTabWidth();
57 void PopulateRevisions();
58
59 QString GetWorkingDirChangesHtml(int aRevNo);
60 QString GetStartupFilesChangesHtml(int aRevNo);
61 QString GetFileDiffsHtml(int aRevNo);
62
63 QString GetAbsoluteDateTimeText(const QDateTime& time);
64 QString GetDateTimeText(const QDateTime& time);
65
66 bool IsYesterday(const QDateTime& time) const;
67 int SecondsAgo(const QDateTime& time) const;
68 int MinutesAgo(const QDateTime& time) const;
69 int HoursAgo(const QDateTime& time) const;
70 int DaysAgo(const QDateTime& time) const;
71
72 RevisionStore& mRevisionStore;
73 UtPath mProjectDir;
74 Ui::ChangeHistory mUi;
75};
76} // namespace wizard
77
78#endif // CHANGEHISTORY_HPP
void DeleteAllRevisions()
Prompts the user and deletes all existing revisions from the database.
Definition ChangeHistory.cpp:82
ChangeHistory(const ChangeHistory &)=delete
void UpdateDiff()
Updates the diff file list and the diff itself.
Definition ChangeHistory.cpp:114
void ExportSelectedRevision()
Definition ChangeHistory.cpp:75
ChangeHistory(RevisionStore &aRevisionStore, const UtPath &aProjectDir, QWidget *aParent=nullptr)
Definition ChangeHistory.cpp:28
ChangeHistory & operator=(ChangeHistory &&)=default
ChangeHistory & operator=(const ChangeHistory &)=delete
ChangeHistory(ChangeHistory &&)=default
void NavigateDiff()
Definition ChangeHistory.cpp:140
void RestoreSelectedRevision()
Definition ChangeHistory.cpp:54
~ChangeHistory() override=default
void UpdateWidgets()
Updates the state/content of all widgets.
Definition ChangeHistory.cpp:171
A high-level interface into the Change History database.
Definition RevisionStore.hpp:38
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved