mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
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).
52 lines
1.1 KiB
C++
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
|