Skip to content

Commit

Permalink
dev name is now mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
lumiscosity committed Dec 30, 2024
1 parent 2b049ba commit 6221e76
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: 'Linux/Flatpak'
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-6.8
image: bilelmoussaoui/flatpak-github-actions:kde-6.7
options: --privileged
steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 10 additions & 2 deletions src/directorydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ void DirectoryDialog::on_origPushButton_clicked() {
QString path = QFileDialog::getExistingDirectory(this, "Select the original copy directory");
if (!path.isEmpty()){
ui->origLabel->setText(path);
ui->buttonBox->buttons()[0]->setEnabled(path != ui->workLabel->text() && ui->workLabel->text() != "...");
ui->buttonBox->buttons()[0]->setEnabled(path != ui->workLabel->text() && ui->workLabel->text() != "..." && !ui->nameLineEdit->text().isEmpty());
}
}

void DirectoryDialog::on_workPushButton_clicked() {
QString path = QFileDialog::getExistingDirectory(this, "Select the work copy directory");
if (!path.isEmpty()){
ui->workLabel->setText(path);
ui->buttonBox->buttons()[0]->setEnabled(path != ui->origLabel->text() && ui->origLabel->text() != "...");
ui->buttonBox->buttons()[0]->setEnabled(path != ui->origLabel->text() && ui->origLabel->text() != "..." && !ui->nameLineEdit->text().isEmpty());
}
}

void DirectoryDialog::on_nameLineEdit_textChanged(const QString &text) {
ui->buttonBox->buttons()[0]->setEnabled(ui->workLabel->text() != ui->origLabel->text() && ui->origLabel->text() != "..." && ui->workLabel->text() != "..." && !text.isEmpty());
}

QString DirectoryDialog::orig() {
return ui->origLabel->text();
}
Expand Down Expand Up @@ -86,3 +90,7 @@ std::string DirectoryDialog::encoding() {
return "UTF-8";
}
}

QString DirectoryDialog::dev_name() {
return ui->nameLineEdit->text();
}
4 changes: 2 additions & 2 deletions src/directorydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#pragma once

#include "lcf/saveopt.h"
#include <QDialog>

namespace Ui {
Expand All @@ -34,10 +33,11 @@ class DirectoryDialog : public QDialog {
QString orig();
QString work();
std::string encoding();
lcf::EngineVersion engine();
QString dev_name();
private slots:
void on_origPushButton_clicked();
void on_workPushButton_clicked();
void on_nameLineEdit_textChanged(const QString &text);

private:
Ui::DirectoryDialog *ui;
Expand Down
12 changes: 11 additions & 1 deletion src/directorydialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>423</width>
<height>223</height>
<height>264</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -128,6 +128,16 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>Developer name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="nameLineEdit"/>
</item>
<item>
<widget class="QLabel" name="encodingLabel">
<property name="text">
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) {
p.gendiff(d.orig(), d.work(), d.encoding());
if (p.exec()) {
ChangelogWidget c(d.work());
c.set_text(p.genlog(d.orig(), d.work(), d.encoding()));
c.set_text(p.genlog(d.orig(), d.work(), d.encoding(), d.dev_name()));
c.show();
a.exec();
}
Expand Down
4 changes: 2 additions & 2 deletions src/pickerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ void PickerWidget::gendiff(QString orig_path, QString work_path, std::string enc
}
}

QString PickerWidget::genlog(QString orig_path, QString work_path, std::string encoding) {
QString PickerWidget::genlog(QString orig_path, QString work_path, std::string encoding, QString dev_name) {
// create log header
QStringList log;
std::unique_ptr<lcf::rpg::TreeMap> maptree = lcf::LMT_Reader::Load(QString(work_path + "/RPG_RT.lmt").toUtf8().data(), encoding);
log.append("|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|=|");
log.append("");
log.append("Developer:");
log.append("Developer: " + dev_name);
log.append("Date: " + QDate::currentDate().toString("dd/MMM/yyyy"));
log.append("");
log.append("---------------------------------------------------");
Expand Down
2 changes: 1 addition & 1 deletion src/pickerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PickerWidget : public QDialog {

void addModelItem(QString folder, QString name, QString type, int id = 0);
void gendiff(QString orig_path, QString work_path, std::string encoding);
QString genlog(QString orig_path, QString work_path, std::string encoding);
QString genlog(QString orig_path, QString work_path, std::string encoding, QString dev_name);
void genmapmeta(QStringList &bgm, QStringList &connections, QString path, int id, std::string encoding);
private:
Ui::PickerWidget *ui;
Expand Down

0 comments on commit 6221e76

Please sign in to comment.