blob: 618050688b30fe104c8e03dd263655fc9736809c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#include "forcedloaddialogwidget.h"
#include "ui_forcedloaddialogwidget.h"
#include <QFileDialog>
#include "executableinfo.h"
ForcedLoadDialogWidget::ForcedLoadDialogWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::ForcedLoadDialogWidget)
{
ui->setupUi(this);
}
ForcedLoadDialogWidget::~ForcedLoadDialogWidget()
{
delete ui;
}
bool ForcedLoadDialogWidget::getEnabled()
{
return ui->enabledBox->isChecked();
}
bool ForcedLoadDialogWidget::getForced()
{
return m_Forced;
}
QString ForcedLoadDialogWidget::getLibraryPath()
{
return ui->libraryPathEdit->text();
}
QString ForcedLoadDialogWidget::getProcess()
{
return ui->processEdit->text();
}
void ForcedLoadDialogWidget::setEnabled(bool enabled)
{
ui->enabledBox->setChecked(enabled);
}
void ForcedLoadDialogWidget::setForced(bool forced)
{
m_Forced = forced;
ui->libraryPathBrowseButton->setEnabled(!forced);
ui->libraryPathEdit->setEnabled(!forced);
ui->processBrowseButton->setEnabled(!forced);
ui->processEdit->setEnabled(!forced);
}
void ForcedLoadDialogWidget::setLibraryPath(QString &path)
{
ui->libraryPathEdit->setText(path);
}
void ForcedLoadDialogWidget::setProcess(QString &name)
{
ui->processEdit->setText(name);
}
void ForcedLoadDialogWidget::on_enabledBox_toggled()
{
// anything to do?
}
void ForcedLoadDialogWidget::on_libraryPathBrowseButton_clicked()
{
QDir gameDir("D:/Games/Steam Library/steamapps/common/Fallout 4");
QString startPath = gameDir.absolutePath();
QString result = QFileDialog::getOpenFileName(nullptr, "Select a library...", startPath, "Dynamic link library (*.dll)", nullptr, QFileDialog::ReadOnly);
if (!result.isEmpty()) {
ui->libraryPathEdit->setText(result);
}
}
void ForcedLoadDialogWidget::on_processBrowseButton_clicked()
{
QDir gameDir("D:/Games/Steam Library/steamapps/common/Fallout 4");
QString startPath = gameDir.absolutePath();
QString result = QFileDialog::getOpenFileName(nullptr, "Select a process...", startPath, "Executable (*.exe)", nullptr, QFileDialog::ReadOnly);
if (!result.isEmpty()) {
ui->processEdit->setText(QFile(result).fileName());
}
}
|