Merge pull request #10 from zturtleman/improvements

Improve settings UI and use install wizard destination as fs_basepath on Mac/Linux
This commit is contained in:
Zachary J. Slater 2015-01-05 15:44:34 -08:00
commit d20e1ed621
5 changed files with 217 additions and 215 deletions

View file

@ -46,6 +46,7 @@ InstallWizard::InstallWizard(QWidget *parent, Settings *settings) :
ui->setupUi(this);
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
connect(this, SIGNAL(finished(int)), this, SLOT(finished(int)));
setPage(Page_Setup, new InstallWizard_Setup(this, settings));
setPage(Page_Eula, new InstallWizard_Eula(this));
@ -111,14 +112,10 @@ void InstallWizard::cancel()
reject();
}
void InstallWizard::on_InstallWizard_finished(int result)
void InstallWizard::finished(int result)
{
#ifdef Q_OS_WIN32
if (result == QDialog::Accepted)
{
settings->setQuakePath(quakePath);
}
#else
result = result; // Silence warning.
#endif
}

View file

@ -62,7 +62,7 @@ public:
private slots:
void cancel();
void on_InstallWizard_finished(int result);
void finished(int result);
private:
Ui::InstallWizard *ui;

View file

@ -43,12 +43,6 @@ InstallWizard_Setup::InstallWizard_Setup(QWidget *parent, Settings *settings) :
{
ui->setupUi(this);
#ifndef Q_OS_WIN32
ui->rbLocate->setEnabled(false);
ui->rbInstall->setChecked(true);
ui->stackPages->setCurrentIndex(Page_Install);
#endif
// Populate drives list.
QFileInfoList drives = QDir::drives();
int selectIndex = -1;
@ -169,7 +163,6 @@ bool InstallWizard_Setup::validatePage()
iw->setQuakePath(ui->txtInstallSteamDest->text());
}
#ifdef Q_OS_WIN32
else if (ui->stackPages->currentIndex() == Page_Locate)
{
if (ui->txtLocatePath->text().isEmpty())
@ -205,7 +198,6 @@ bool InstallWizard_Setup::validatePage()
iw->setIsQuake3PatchRequired(hash != "48911719d91be25adb957f2d325db4a0");
iw->setQuakePath(ui->txtLocatePath->text());
}
#endif
return true;
}
@ -220,12 +212,10 @@ bool InstallWizard_Setup::isComplete() const
{
return !ui->txtInstallSteamSource->text().isEmpty() && !ui->txtInstallSteamDest->text().isEmpty();
}
#ifdef Q_OS_WIN32
else if (ui->stackPages->currentIndex() == Page_Locate)
{
return !ui->txtLocatePath->text().isEmpty();
}
#endif
return true;
}
@ -236,7 +226,6 @@ int InstallWizard_Setup::nextId() const
{
return InstallWizard::Page_Eula;
}
#ifdef Q_OS_WIN32
else if (ui->stackPages->currentIndex() == Page_Locate)
{
if (((InstallWizard *)wizard())->getIsQuake3PatchRequired())
@ -248,7 +237,6 @@ int InstallWizard_Setup::nextId() const
return InstallWizard::Page_Finished;
}
}
#endif
// Shouldn't happen.
Q_ASSERT(false);

View file

@ -102,7 +102,9 @@ void ioLaunch::on_btnLaunch_clicked()
}
ioq3 = QString("\"") + settings.getQuakePath() + "/ioquake3.x86.exe\"";
#elif defined Q_OS_MAC
#else
#if defined Q_OS_MAC
ioq3 = "open -a ioquake3 --args";
#elif defined Q_OS_UNIX
ioq3 = "ioquake3";
@ -110,6 +112,13 @@ void ioLaunch::on_btnLaunch_clicked()
#error "Unsupported platform"
#endif
QString quakePath = settings.getQuakePath();
if ( !quakePath.isEmpty() )
{
ioq3 += QString(" +set fs_basepath \"%1\"").arg(quakePath);
}
#endif
int r_mode = settings.getResolutionMode();
int r_width = settings.getResolutionWidth();
int r_height = settings.getResolutionHeight();

View file

@ -137,220 +137,228 @@ QTabWidget::tab-bar{
<attribute name="title">
<string>Settings</string>
</attribute>
<widget class="QComboBox" name="cbResolution">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>141</width>
<height>24</height>
</rect>
</property>
<item>
<property name="text">
<string>Native</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
<item>
<property name="text">
<string>320x240</string>
</property>
</item>
<item>
<property name="text">
<string>400x300</string>
</property>
</item>
<item>
<property name="text">
<string>512x384</string>
</property>
</item>
<item>
<property name="text">
<string>640x480</string>
</property>
</item>
<item>
<property name="text">
<string>800x600</string>
</property>
</item>
<item>
<property name="text">
<string>960x720</string>
</property>
</item>
<item>
<property name="text">
<string>1024x768</string>
</property>
</item>
<item>
<property name="text">
<string>1152x864</string>
</property>
</item>
<item>
<property name="text">
<string>1280x1024</string>
</property>
</item>
<item>
<property name="text">
<string>1600x1200</string>
</property>
</item>
<item>
<property name="text">
<string>2048x1536</string>
</property>
</item>
<item>
<property name="text">
<string>856x480(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x720(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1920x1080(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x800(16:10)</string>
</property>
</item>
</widget>
<widget class="QSpinBox" name="sbHeight">
<property name="geometry">
<rect>
<x>350</x>
<y>10</y>
<width>61</width>
<height>25</height>
</rect>
</property>
<property name="maximum">
<number>100000</number>
</property>
</widget>
<widget class="QRadioButton" name="rbWin">
<property name="geometry">
<rect>
<x>200</x>
<y>40</y>
<width>121</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Windowed</string>
</property>
</widget>
<widget class="QSpinBox" name="sbWidth">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>61</width>
<height>25</height>
</rect>
</property>
<property name="maximum">
<number>100000</number>
</property>
</widget>
<widget class="QLabel" name="label_6">
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>81</width>
<height>21</height>
<y>40</y>
<width>441</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Resolution</string>
</property>
<layout class="QHBoxLayout" name="screenModeLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Screen Mode:</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbFull">
<property name="text">
<string>Full Screen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbWin">
<property name="text">
<string>Windowed</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_2">
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>34</y>
<width>111</width>
<height>31</height>
<y>0</y>
<width>441</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Screen Mode</string>
</property>
<layout class="QHBoxLayout" name="resolutionLayout">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Resolution:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbResolution">
<item>
<property name="text">
<string>Native</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
<item>
<property name="text">
<string>320x240</string>
</property>
</item>
<item>
<property name="text">
<string>400x300</string>
</property>
</item>
<item>
<property name="text">
<string>512x384</string>
</property>
</item>
<item>
<property name="text">
<string>640x480</string>
</property>
</item>
<item>
<property name="text">
<string>800x600</string>
</property>
</item>
<item>
<property name="text">
<string>960x720</string>
</property>
</item>
<item>
<property name="text">
<string>1024x768</string>
</property>
</item>
<item>
<property name="text">
<string>1152x864</string>
</property>
</item>
<item>
<property name="text">
<string>1280x1024</string>
</property>
</item>
<item>
<property name="text">
<string>1600x1200</string>
</property>
</item>
<item>
<property name="text">
<string>2048x1536</string>
</property>
</item>
<item>
<property name="text">
<string>856x480(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x720(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1920x1080(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x800(16:10)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>W</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbWidth">
<property name="maximum">
<number>100000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>H</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbHeight">
<property name="maximum">
<number>100000</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>240</x>
<y>10</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>W</string>
</property>
</widget>
<widget class="QRadioButton" name="rbFull">
<property name="geometry">
<rect>
<x>90</x>
<y>40</y>
<width>111</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FullScreen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>330</x>
<y>10</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>H</string>
</property>
</widget>
<widget class="QPushButton" name="btnRunInstallWizard">
<widget class="QWidget" name="horizontalLayoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>101</width>
<height>23</height>
<width>441</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Run Install Wizard</string>
</property>
<layout class="QHBoxLayout" name="installWizardLayout">
<item>
<widget class="QPushButton" name="btnRunInstallWizard">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Run Install Wizard</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tabRend2">