Merge pull request #5 from jpcy/misc-fixes

Misc fixes
This commit is contained in:
Zachary J. Slater 2014-05-08 10:20:58 -07:00
commit 633e2fbd6c
5 changed files with 10 additions and 9 deletions

BIN
iolico.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -26,3 +26,5 @@ OTHER_FILES += \
RESOURCES += \ RESOURCES += \
imgs.qrc imgs.qrc
RC_FILE = launch.rc

1
launch.rc Normal file
View file

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "iolico.ico"

View file

@ -1,9 +1,11 @@
#include <QProcess>
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
ioLaunch::ioLaunch(QWidget *parent) : ioLaunch::ioLaunch(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
ui(new Ui::ioLaunch) ui(new Ui::ioLaunch),
ioWidth(0), ioHeight(0), ioWedited(false), ioHedited(false)
{ {
ui->setupUi(this); ui->setupUi(this);
resOption = ""; resOption = "";
@ -24,8 +26,7 @@ void ioLaunch::on_btnLaunch_clicked()
msg.setText("Please select your Quake3 directory"); msg.setText("Please select your Quake3 directory");
msg.exec(); msg.exec();
QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory.path()); QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory.path());
path.replace(" ", "\" \""); ioq3 = QString("\"") + path + QDir::separator() + "ioquake3.x86.exe\" +set r_mode -1";
ioq3 = path + "\\ioquake3.x86.exe +set r_mode -1";
} }
#elif defined Q_OS_MAC #elif defined Q_OS_MAC
ioq3 = "open -a ioquake3 --args +set r_mode -1"; ioq3 = "open -a ioquake3 --args +set r_mode -1";
@ -51,15 +52,14 @@ void ioLaunch::on_btnLaunch_clicked()
screenOption = ""; screenOption = "";
} }
myProcess.start(ioq3+resOption+screenOption); if(!QProcess::startDetached(ioq3+resOption+screenOption))
if(!myProcess.waitForStarted())
{ {
ioq3Failed.setText("ioquake3 failed to start!\nIs it installed?\n"); ioq3Failed.setText("ioquake3 failed to start!\nIs it installed?\n");
ioq3Failed.exec(); ioq3Failed.exec();
} }
} }
void ioLaunch::on_cbResolution_highlighted(int index) void ioLaunch::on_cbResolution_highlighted(int /*index*/)
{ {
ioWedited = false; ioWedited = false;
ioHedited = false; ioHedited = false;
@ -116,7 +116,7 @@ void ioLaunch::on_cbResolution_currentIndexChanged(int index)
} }
case 8: case 8:
{ {
resOption = " +set r_customwidth 1024 +set r_customheight 3768"; resOption = " +set r_customwidth 1024 +set r_customheight 768";
break; break;
} }
case 9: case 9:

View file

@ -4,7 +4,6 @@
#include <QMainWindow> #include <QMainWindow>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QMessageBox> #include <QMessageBox>
#include <QProcess>
#include <QString> #include <QString>
#include <QtGlobal> #include <QtGlobal>
#include <QFileDialog> #include <QFileDialog>
@ -42,7 +41,6 @@ private slots:
private: private:
Ui::ioLaunch *ui; Ui::ioLaunch *ui;
QProcess myProcess;
QString ioq3; QString ioq3;
QString resOption; QString resOption;
QString screenOption; QString screenOption;