From 3c88b11e5df33116580ac008e36092775df66135 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 13 Mar 2026 12:24:18 -0700 Subject: [WARP] Improved UX and API - Exposes WARP type objects directly - Adds processor API (for generating warp files directly) - Adds file and chunk API - Misc cleanup - Simplified the amount of commands - Replaced the "Create" commands with a purpose built processor dialog - Added a native QT viewer for WARP files - Simplified committing to a remote with a purpose built commit dialog --- plugins/warp/ui/containers.h | 94 +------------------------------------------- 1 file changed, 2 insertions(+), 92 deletions(-) (limited to 'plugins/warp/ui/containers.h') diff --git a/plugins/warp/ui/containers.h b/plugins/warp/ui/containers.h index b95c32db..935b552e 100644 --- a/plugins/warp/ui/containers.h +++ b/plugins/warp/ui/containers.h @@ -1,8 +1,5 @@ #pragma once -#include -#include -#include #include #include #include @@ -11,93 +8,7 @@ #include "theme.h" #include "warp.h" #include "../../../../ui/mainwindow.h" - -class WarpSourcesModel final : public QAbstractTableModel -{ - Q_OBJECT - -public: - enum Columns : int - { - GuidCol = 0, - PathCol, - WritableCol, - UncommittedCol, - ColumnCount - }; - - explicit WarpSourcesModel(QObject* parent = nullptr) : QAbstractTableModel(parent) {} - - void setContainer(Warp::Ref container) - { - m_container = std::move(container); - reload(); - } - - void reload() - { - // Fetch synchronously (can be adapted to async if needed) - beginResetModel(); - m_rows.clear(); - for (const auto& src : m_container->GetSources()) - { - QString guid = QString::fromStdString(src.ToString()); - QString path = QString::fromStdString(m_container->SourcePath(src).value_or(std::string {})); - bool writable = m_container->IsSourceWritable(src); - bool uncommitted = m_container->IsSourceUncommitted(src); - m_rows.push_back({guid, path, writable, uncommitted}); - } - endResetModel(); - } - - int rowCount(const QModelIndex& parent = QModelIndex()) const override - { - if (parent.isValid()) - return 0; - return static_cast(m_rows.size()); - } - - int columnCount(const QModelIndex& parent = QModelIndex()) const override - { - Q_UNUSED(parent); - return ColumnCount; - } - - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - - QVariant headerData(int section, Qt::Orientation orientation, int role) const override - { - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) - { - switch (section) - { - case GuidCol: - return "Source GUID"; - case PathCol: - return "Path"; - case WritableCol: - return "Writable"; - case UncommittedCol: - return "Uncommitted"; - default: - return {}; - } - } - return {}; - } - -private: - struct Row - { - QString guid; - QString path; - bool writable; - bool uncommitted; - }; - - std::vector m_rows; - Warp::Ref m_container; -}; +#include "shared/source.h" class WarpContainerWidget : public QWidget { @@ -112,8 +23,7 @@ private: QTabWidget* m_tabs = nullptr; // Sources - QTableView* m_sourcesView = nullptr; - WarpSourcesModel* m_sourcesModel = nullptr; + WarpSourcesView* m_sourcesView = nullptr; QWidget* m_sourcesPage = nullptr; QTimer* m_refreshTimer = nullptr; -- cgit v1.3.1