Files
archived-Reclass/src/processpicker.h
IChooseYou ba1c2f8e5a refactor: process picker themed styling, context menu, auto-select
Extract shared init into initUi(). Apply dark theme styling from global
palette to table, header, filter, and buttons. Add right-click context
menu with Copy PID/Name/Path. Auto-select last attached process on open.
Remove duplicate attach->accept() connection from .ui (handled in code).
2026-03-02 08:24:39 -07:00

52 lines
1.1 KiB
C++

#ifndef PROCESSPICKER_H
#define PROCESSPICKER_H
#include <QDialog>
#include <QIcon>
#include <cstdint>
namespace Ui {
class ProcessPicker;
}
struct ProcessInfo {
uint32_t pid;
QString name;
QString path;
QIcon icon;
bool is32Bit = false;
};
class ProcessPicker : public QDialog
{
Q_OBJECT
public:
explicit ProcessPicker(QWidget *parent = nullptr);
explicit ProcessPicker(const QList<ProcessInfo>& customProcesses, QWidget *parent = nullptr);
~ProcessPicker();
uint32_t selectedProcessId() const;
QString selectedProcessName() const;
private slots:
void refreshProcessList();
void onProcessSelected();
void filterProcesses(const QString& text);
private:
void initUi();
void enumerateProcesses();
void populateTable(const QList<ProcessInfo>& processes);
void applyFilter();
void selectPreferredProcess();
Ui::ProcessPicker *ui;
uint32_t m_selectedPid = 0;
QString m_selectedName;
QList<ProcessInfo> m_allProcesses;
bool m_useCustomList = false;
};
#endif // PROCESSPICKER_H