Skip to content

Commit

Permalink
Merge pull request #32 from Admiral-Fish/develop
Browse files Browse the repository at this point in the history
v1.1.1
  • Loading branch information
Admiral-Fish authored Nov 13, 2017
2 parents f942771 + 194f083 commit f4fb246
Show file tree
Hide file tree
Showing 34 changed files with 177 additions and 123 deletions.
5 changes: 2 additions & 3 deletions .travis/before_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash

if [ $TRAVIS_OS_NAME = linux ]; then
zip PokeFinder-linux.zip PokeFinder
zip PokeFinder-linux.zip PokeFinder languages
else
/usr/local/Cellar/qt/5.9.1/bin/macdeployqt PokeFinder.app -dmg -verbose=2
mv PokeFinder.dmg PokeFinder-macOS.dmg
zip -r PokeFinder-macOS.zip PokeFinder.app languages
fi
2 changes: 1 addition & 1 deletion .travis/file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if [ $TRAVIS_OS_NAME = linux ]; then
echo PokeFinder-linux.zip
else
echo PokeFinder-macOS.dmg
echo PokeFinder-macOS.zip
fi
2 changes: 1 addition & 1 deletion Forms/ProfileManager/ProfileManagerGen3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void ProfileManagerGen3::on_pushButtonNew_clicked()
dialog->exec();
}

void ProfileManagerGen3::updateTable(std::vector<QList<QStandardItem *>> rows)
void ProfileManagerGen3::updateTable(vector<QList<QStandardItem *>> rows)
{
QStandardItemModel *model = new QStandardItemModel(this);
model->setHorizontalHeaderLabels({tr("Profile Name"), tr("Version"), tr("Language"), tr("TID"), tr("SID"), tr("Dead Battery")});
Expand Down
26 changes: 24 additions & 2 deletions Forms/ProfileManager/ProfileManagerGen3.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* This file is part of PokéFinder
* Copyright (C) 2017 by Admiral_Fish and bumba
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef PROFILEMANAGERGEN3_HPP
#define PROFILEMANAGERGEN3_HPP

Expand All @@ -8,6 +27,9 @@
#include <QObject>
#include <libPokeFinder/Gen3/ProfileGen3.hpp>

using namespace std;
typedef uint32_t u32;

namespace Ui {
class ProfileManagerGen3;
}
Expand All @@ -28,7 +50,7 @@ private slots:

void on_pushButtonOk_clicked();

void registerProfile(QString profileName, int version, int language, uint32_t tid, uint32_t sid, bool deadBattery);
void registerProfile(QString profileName, int version, int language, u32 tid, u32 sid, bool deadBattery);

void on_pushButtonEdit_clicked();

Expand All @@ -37,7 +59,7 @@ private slots:
private:
Ui::ProfileManagerGen3 *ui;

void updateTable(std::vector<QList<QStandardItem *>> rows);
void updateTable(vector<QList<QStandardItem *>> rows);
};

#endif // PROFILEMANAGERGEN3_HPP
7 changes: 3 additions & 4 deletions Forms/ProfileManager/ProfileManagerGen3NewEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ProfileManagerGen3NewEdit::ProfileManagerGen3NewEdit(QWidget *parent) :
ui->setupUi(this);
}

ProfileManagerGen3NewEdit::ProfileManagerGen3NewEdit(QString profileName, int version, int language, uint32_t tid, uint32_t sid, bool deadBattery, QWidget *parent) : QDialog(parent), ui(new Ui::ProfileManagerGen3NewEdit)
ProfileManagerGen3NewEdit::ProfileManagerGen3NewEdit(QString profileName, int version, int language, u32 tid, u32 sid, bool deadBattery, QWidget *parent) : QDialog(parent), ui(new Ui::ProfileManagerGen3NewEdit)
{
ui->setupUi(this);
ui->lineEditProfile->setText(profileName);
Expand All @@ -17,7 +17,6 @@ ProfileManagerGen3NewEdit::ProfileManagerGen3NewEdit(QString profileName, int ve
ui->lineEditTID->setText(QString::number(tid));
ui->lineEditSID->setText(QString::number(sid));
ui->checkBoxDeadBattery->setChecked(deadBattery);

}

ProfileManagerGen3NewEdit::~ProfileManagerGen3NewEdit()
Expand All @@ -42,7 +41,7 @@ void ProfileManagerGen3NewEdit::on_pushButtonAccept_clicked()
input = ui->lineEditTID->text().trimmed();
if (input != "")
{
uint32_t tid = input.toUInt(&pass, 10);
u32 tid = input.toUInt(&pass, 10);
if (!pass)
{
error.setText(tr("Please enter Trainer ID in valid decimal format."));
Expand All @@ -60,7 +59,7 @@ void ProfileManagerGen3NewEdit::on_pushButtonAccept_clicked()
input = ui->lineEditSID->text().trimmed();
if (input != "")
{
uint32_t sid = input.toUInt(&pass, 10);
u32 sid = input.toUInt(&pass, 10);
if (!pass)
{
error.setText(tr("Please enter Trainer SID in valid decimal format."));
Expand Down
25 changes: 23 additions & 2 deletions Forms/ProfileManager/ProfileManagerGen3NewEdit.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* This file is part of PokéFinder
* Copyright (C) 2017 by Admiral_Fish and bumba
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef PROFILEMANAGERGEN3NEWEDIT_HPP
#define PROFILEMANAGERGEN3NEWEDIT_HPP

Expand All @@ -8,6 +27,8 @@
#include <QStandardItemModel>
#include <QList>

typedef uint32_t u32;

namespace Ui {
class ProfileManagerGen3NewEdit;
}
Expand All @@ -17,11 +38,11 @@ class ProfileManagerGen3NewEdit : public QDialog
Q_OBJECT

signals:
void newProfile(QString, int, int, uint32_t, uint32_t, bool);
void newProfile(QString, int, int, u32, u32, bool);

public:
explicit ProfileManagerGen3NewEdit(QWidget *parent = 0);
explicit ProfileManagerGen3NewEdit(QString profileName, int version, int language, uint32_t tid, uint32_t sid, bool deadBattery, QWidget *parent = 0);
explicit ProfileManagerGen3NewEdit(QString profileName, int version, int language, u32 tid, u32 sid, bool deadBattery, QWidget *parent = 0);
~ProfileManagerGen3NewEdit();

private slots:
Expand Down
18 changes: 9 additions & 9 deletions Forms/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ void MainWindow::loadLanguage(const QString& rLanguage)

void MainWindow::on_generate_clicked()
{
uint32_t seed = ui->initialSeed->text().toUInt(NULL, 16);
uint32_t startingFrame = ui->startingFrame->text().toUInt(NULL, 10);
uint32_t maxResults = ui->maxResults->text().toUInt(NULL, 10);
uint32_t tid = ui->id->text().toUInt(NULL, 10);
uint32_t sid = ui->sid->text().toUInt(NULL, 10);
uint32_t offset = ui->delay->text().toUInt(NULL, 10);
u32 seed = ui->initialSeed->text().toUInt(NULL, 16);
u32 startingFrame = ui->startingFrame->text().toUInt(NULL, 10);
u32 maxResults = ui->maxResults->text().toUInt(NULL, 10);
u32 tid = ui->id->text().toUInt(NULL, 10);
u32 sid = ui->sid->text().toUInt(NULL, 10);
u32 offset = ui->delay->text().toUInt(NULL, 10);

// Force early garbage collection
QStandardItemModel *model = new QStandardItemModel(this);
Expand All @@ -165,7 +165,7 @@ void MainWindow::on_generate_clicked()
else
generator.frameType = Channel;

std::vector<FrameGen3> frames = generator.Generate(compare);
vector<FrameGen3> frames = generator.Generate(compare);
int size = frames.size();

for (int i = 0; i < size; i++)
Expand Down Expand Up @@ -243,7 +243,7 @@ void MainWindow::createProfileXml()
void MainWindow::setupModels()
{
QStandardItemModel *natures = new QStandardItemModel(26, 1, this);
std::vector<QString> natureList = Nature::GetNatures();
vector<QString> natureList = Nature::GetNatures();
QStandardItem* firstNature = new QStandardItem(tr("Any"));
natures->setItem(0, firstNature);
for(int i = 0; i < 25; i++)
Expand All @@ -258,7 +258,7 @@ void MainWindow::setupModels()
connect(ui->comboBoxNature->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex, QVector<int>)), this, SLOT(natureItemCheck(QModelIndex, QModelIndex)));

QStandardItemModel *hidden = new QStandardItemModel(17, 1, this);
std::vector<QString> powerList = Power::GetPowers();
vector<QString> powerList = Power::GetPowers();
QStandardItem* firstPower = new QStandardItem(tr("Any"));
hidden->setItem(0, firstPower);
for(int i = 0; i < 16; i++)
Expand Down
5 changes: 4 additions & 1 deletion Forms/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
#include <Util/Validators/SeedValidator.hpp>
#include <Util/Validators/FrameValidator.hpp>

using namespace std;
typedef uint32_t u32;

namespace Ui {
class MainWindow;
}
Expand Down Expand Up @@ -95,7 +98,7 @@ private slots:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

std::vector<ProfileGen3> profiles;
vector<ProfileGen3> profiles;

QValidator *idVal;
QValidator *seedVal;
Expand Down
2 changes: 1 addition & 1 deletion Forms/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>PokéFinder 1.1.0</string>
<string>PokéFinder 1.1.1</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QTabWidget" name="tabRNGSelector">
Expand Down
26 changes: 15 additions & 11 deletions PokeFinder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = PokeFinder
TEMPLATE = app
VERSION = 1.1.0
VERSION = 1.1.1
QMAKE_TARGET_DESCRIPTION = PokeFinder
QMAKE_TARGET_COPYRIGHT = Admiral_Fish

Expand Down Expand Up @@ -47,14 +47,14 @@ macx {
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

TRANSLATIONS += \
languages/PokeFinder_en.ts \
languages/PokeFinder_fr.ts \
languages/PokeFinder_es.ts \
languages/PokeFinder_de.ts \
languages/PokeFinder_it.ts \
languages/PokeFinder_ja.ts \
languages/PokeFinder_ko.ts \
languages/PokeFinder_zh_Hans_CN.ts
languages/PokeFinder_en.ts \
languages/PokeFinder_fr.ts \
languages/PokeFinder_es.ts \
languages/PokeFinder_de.ts \
languages/PokeFinder_it.ts \
languages/PokeFinder_ja.ts \
languages/PokeFinder_ko.ts \
languages/PokeFinder_zh_Hans_CN.ts

SOURCES += \
Forms/ProfileManager/ProfileManagerGen3.cpp \
Expand All @@ -80,7 +80,8 @@ SOURCES += \
Util/Validators/FrameValidator.cpp \
Util/Validators/IDValidator.cpp \
Util/Validators/SeedValidator.cpp \
main.cpp
main.cpp \
libPokeFinder/RNG/SFMT.cpp

HEADERS += \
Forms/ProfileManager/ProfileManagerGen3.hpp \
Expand Down Expand Up @@ -111,7 +112,10 @@ HEADERS += \
libPokeFinder/RNG/TinyMT.hpp \
Util/Validators/FrameValidator.hpp \
Util/Validators/IDValidator.hpp \
Util/Validators/SeedValidator.hpp
Util/Validators/SeedValidator.hpp \
libPokeFinder/RNG/IRNG.hpp \
libPokeFinder/RNG/SFMT.hpp \
libPokeFinder/RNG/IRNG64.hpp

FORMS += \
Forms/ProfileManager/ProfileManagerGen3.ui \
Expand Down
4 changes: 2 additions & 2 deletions Util/Validators/FrameValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FrameValidator::FrameValidator(QObject *parent) : QValidator(parent)
void FrameValidator::fixup(QString & input) const
{
input.remove(QRegExp("[^0-9]"));
uint32_t temp = input.toUInt(NULL, 10);
u32 temp = input.toUInt(NULL, 10);
if(temp > UINT32_MAX)
{
input.remove(input.length() - 1, 1);
Expand All @@ -18,7 +18,7 @@ void FrameValidator::fixup(QString & input) const
QValidator::State FrameValidator::validate(QString & input, int & pos) const
{
bool pass;
uint32_t frame = input.toUInt(&pass, 10);
u32 frame = input.toUInt(&pass, 10);
(void) pos;

if (input == "")
Expand Down
2 changes: 2 additions & 0 deletions Util/Validators/FrameValidator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <QValidator>

typedef uint32_t u32;

class FrameValidator : public QValidator
{
public:
Expand Down
4 changes: 2 additions & 2 deletions Util/Validators/IDValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IDValidator::IDValidator(QObject *parent) : QValidator(parent)
void IDValidator::fixup(QString & input) const
{
input.remove(QRegExp("[^0-9]"));
uint32_t temp = input.toUInt(NULL, 10);
u32 temp = input.toUInt(NULL, 10);
if(temp > 0xffff)
{
input.remove(input.length() - 1, 1);
Expand All @@ -18,7 +18,7 @@ void IDValidator::fixup(QString & input) const
QValidator::State IDValidator::validate(QString & input, int & pos) const
{
bool pass;
uint32_t tid = input.toUInt(&pass, 10);
u32 tid = input.toUInt(&pass, 10);
(void) pos;

if (input == "")
Expand Down
2 changes: 2 additions & 0 deletions Util/Validators/IDValidator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <QValidator>

typedef uint32_t u32;

class IDValidator : public QValidator
{
public:
Expand Down
4 changes: 2 additions & 2 deletions Util/Validators/SeedValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SeedValidator::SeedValidator(QObject *parent) : QValidator(parent)
void SeedValidator::fixup(QString & input) const
{
input.remove(QRegExp("[^0-9A-F]"));
uint32_t temp = input.toUInt(NULL, 16);
u32 temp = input.toUInt(NULL, 16);
if(temp > 0xffffffff)
{
input.remove(input.length() - 1, 1);
Expand All @@ -18,7 +18,7 @@ void SeedValidator::fixup(QString & input) const
QValidator::State SeedValidator::validate(QString & input, int & pos) const
{
bool pass;
uint32_t seed = input.toUInt(&pass, 16);;
u32 seed = input.toUInt(&pass, 16);;
(void) pos;

if (input == "")
Expand Down
2 changes: 2 additions & 0 deletions Util/Validators/SeedValidator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <QValidator>

typedef uint32_t u32;

class SeedValidator : public QValidator
{
public:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.1.0.{build}
version: 1.1.1.{build}

environment:
matrix:
Expand Down
Binary file modified languages/PokeFinder_de.qm
Binary file not shown.
Loading

0 comments on commit f4fb246

Please sign in to comment.