Added a settings page to the launcher
|
@ -5,6 +5,7 @@ set(LAUNCHER
|
|||
maindialog.cpp
|
||||
playpage.cpp
|
||||
textslotmsgbox.cpp
|
||||
settingspage.cpp
|
||||
|
||||
settings/graphicssettings.cpp
|
||||
|
||||
|
@ -25,6 +26,7 @@ set(LAUNCHER_HEADER
|
|||
maindialog.hpp
|
||||
playpage.hpp
|
||||
textslotmsgbox.hpp
|
||||
settingspage.hpp
|
||||
|
||||
settings/graphicssettings.hpp
|
||||
|
||||
|
@ -45,6 +47,7 @@ set(LAUNCHER_HEADER_MOC
|
|||
maindialog.hpp
|
||||
playpage.hpp
|
||||
textslotmsgbox.hpp
|
||||
settingspage.hpp
|
||||
|
||||
utils/textinputdialog.hpp
|
||||
utils/checkablemessagebox.hpp
|
||||
|
@ -64,6 +67,7 @@ set(LAUNCHER_UI
|
|||
${CMAKE_SOURCE_DIR}/files/ui/mainwindow.ui
|
||||
${CMAKE_SOURCE_DIR}/files/ui/playpage.ui
|
||||
${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
|
||||
${CMAKE_SOURCE_DIR}/files/ui/settingspage.ui
|
||||
)
|
||||
|
||||
source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER})
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "playpage.hpp"
|
||||
#include "graphicspage.hpp"
|
||||
#include "datafilespage.hpp"
|
||||
#include "settingspage.hpp"
|
||||
|
||||
Launcher::MainDialog::MainDialog(QWidget *parent)
|
||||
: mGameSettings(mCfgMgr), QMainWindow (parent)
|
||||
|
@ -75,27 +76,30 @@ void Launcher::MainDialog::createIcons()
|
|||
if (!QIcon::hasThemeIcon("document-new"))
|
||||
QIcon::setThemeName("tango");
|
||||
|
||||
// We create a fallback icon because the default fallback doesn't work
|
||||
QIcon graphicsIcon = QIcon(":/icons/tango/video-display.png");
|
||||
|
||||
QListWidgetItem *playButton = new QListWidgetItem(iconWidget);
|
||||
playButton->setIcon(QIcon(":/images/openmw.png"));
|
||||
playButton->setText(tr("Play"));
|
||||
playButton->setTextAlignment(Qt::AlignCenter);
|
||||
playButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
QListWidgetItem *graphicsButton = new QListWidgetItem(iconWidget);
|
||||
graphicsButton->setIcon(QIcon::fromTheme("video-display", graphicsIcon));
|
||||
graphicsButton->setText(tr("Graphics"));
|
||||
graphicsButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom | Qt::AlignAbsolute);
|
||||
graphicsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
QListWidgetItem *dataFilesButton = new QListWidgetItem(iconWidget);
|
||||
dataFilesButton->setIcon(QIcon(":/images/openmw-plugin.png"));
|
||||
dataFilesButton->setText(tr("Data Files"));
|
||||
dataFilesButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
||||
dataFilesButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
QListWidgetItem *graphicsButton = new QListWidgetItem(iconWidget);
|
||||
graphicsButton->setIcon(QIcon::fromTheme("video-display"));
|
||||
graphicsButton->setText(tr("Graphics"));
|
||||
graphicsButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom | Qt::AlignAbsolute);
|
||||
graphicsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
QListWidgetItem *settingsButton = new QListWidgetItem(iconWidget);
|
||||
settingsButton->setIcon(QIcon::fromTheme("preferences-system"));
|
||||
settingsButton->setText(tr("Settings"));
|
||||
settingsButton->setTextAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
||||
settingsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||
|
||||
connect(iconWidget,
|
||||
SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
|
||||
this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
|
||||
|
@ -105,8 +109,9 @@ void Launcher::MainDialog::createIcons()
|
|||
void Launcher::MainDialog::createPages()
|
||||
{
|
||||
mPlayPage = new PlayPage(this);
|
||||
mGraphicsPage = new GraphicsPage(mCfgMgr, mGraphicsSettings, this);
|
||||
mDataFilesPage = new DataFilesPage(mCfgMgr, mGameSettings, mLauncherSettings, this);
|
||||
mGraphicsPage = new GraphicsPage(mCfgMgr, mGraphicsSettings, this);
|
||||
mSettingsPage = new SettingsPage(this);
|
||||
|
||||
// Set the combobox of the play page to imitate the combobox on the datafilespage
|
||||
mPlayPage->setProfilesModel(mDataFilesPage->profilesModel());
|
||||
|
@ -114,8 +119,9 @@ void Launcher::MainDialog::createPages()
|
|||
|
||||
// Add the pages to the stacked widget
|
||||
pagesWidget->addWidget(mPlayPage);
|
||||
pagesWidget->addWidget(mGraphicsPage);
|
||||
pagesWidget->addWidget(mDataFilesPage);
|
||||
pagesWidget->addWidget(mGraphicsPage);
|
||||
pagesWidget->addWidget(mSettingsPage);
|
||||
|
||||
// Select the first page
|
||||
iconWidget->setCurrentItem(iconWidget->item(0), QItemSelectionModel::Select);
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
#include "ui_mainwindow.h"
|
||||
|
||||
class QListWidgetItem;
|
||||
class QStackedWidget;
|
||||
class QStringList;
|
||||
class QStringListModel;
|
||||
class QString;
|
||||
|
||||
namespace Launcher
|
||||
{
|
||||
|
@ -20,6 +24,7 @@ namespace Launcher
|
|||
class GraphicsPage;
|
||||
class DataFilesPage;
|
||||
class UnshieldThread;
|
||||
class SettingsPage;
|
||||
|
||||
#ifndef WIN32
|
||||
bool expansions(Launcher::UnshieldThread& cd);
|
||||
|
@ -58,6 +63,8 @@ namespace Launcher
|
|||
PlayPage *mPlayPage;
|
||||
GraphicsPage *mGraphicsPage;
|
||||
DataFilesPage *mDataFilesPage;
|
||||
SettingsPage *mSettingsPage;
|
||||
|
||||
|
||||
Files::ConfigurationManager mCfgMgr;
|
||||
|
||||
|
|
18
apps/launcher/settingspage.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "settingspage.hpp"
|
||||
|
||||
Launcher::SettingsPage::SettingsPage(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
QStringList languages;
|
||||
languages << "English"
|
||||
<< "French"
|
||||
<< "German"
|
||||
<< "Italian"
|
||||
<< "Polish"
|
||||
<< "Russian"
|
||||
<< "Spanish";
|
||||
|
||||
languageComboBox->addItems(languages);
|
||||
}
|
||||
|
20
apps/launcher/settingspage.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef SETTINGSPAGE_HPP
|
||||
#define SETTINGSPAGE_HPP
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui_settingspage.h"
|
||||
|
||||
namespace Launcher
|
||||
{
|
||||
|
||||
class SettingsPage : public QWidget, private Ui::SettingsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SettingsPage(QWidget *parent = 0);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // SETTINGSPAGE_HPP
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 793 B After Width: | Height: | Size: 793 B |
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 652 B |
BIN
files/launcher/icons/tango/48x48/preferences-system.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
@ -2,7 +2,10 @@
|
|||
Name=Tango
|
||||
Comment=Tango Theme
|
||||
Inherits=default
|
||||
Directories=16x16
|
||||
Directories=16x16,48x48
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
|
||||
[48x48]
|
||||
Size=48
|
|
@ -9,13 +9,14 @@
|
|||
</qresource>
|
||||
<qresource prefix="icons/tango">
|
||||
<file alias="index.theme">icons/tango/index.theme</file>
|
||||
<file alias="video-display.png">icons/tango/video-display.png</file>
|
||||
<file alias="16x16/document-new.png">icons/tango/document-new.png</file>
|
||||
<file alias="16x16/edit-copy.png">icons/tango/edit-copy.png</file>
|
||||
<file alias="16x16/edit-delete.png">icons/tango/edit-delete.png</file>
|
||||
<file alias="16x16/go-bottom.png">icons/tango/go-bottom.png</file>
|
||||
<file alias="16x16/go-down.png">icons/tango/go-down.png</file>
|
||||
<file alias="16x16/go-top.png">icons/tango/go-top.png</file>
|
||||
<file alias="16x16/go-up.png">icons/tango/go-up.png</file>
|
||||
<file alias="48x48/video-display.png">icons/tango/48x48/video-display.png</file>
|
||||
<file alias="48x48/preferences-system.png">icons/tango/48x48/preferences-system.png</file>
|
||||
<file alias="16x16/document-new.png">icons/tango/16x16/document-new.png</file>
|
||||
<file alias="16x16/edit-copy.png">icons/tango/16x16/edit-copy.png</file>
|
||||
<file alias="16x16/edit-delete.png">icons/tango/16x16/edit-delete.png</file>
|
||||
<file alias="16x16/go-bottom.png">icons/tango/16x16/go-bottom.png</file>
|
||||
<file alias="16x16/go-down.png">icons/tango/16x16/go-down.png</file>
|
||||
<file alias="16x16/go-top.png">icons/tango/16x16/go-top.png</file>
|
||||
<file alias="16x16/go-up.png">icons/tango/16x16/go-up.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -2,9 +2,17 @@
|
|||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>575</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>575</width>
|
||||
<width>635</width>
|
||||
<height>535</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
159
files/ui/settingspage.ui
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SettingsPage</class>
|
||||
<widget class="QWidget" name="SettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>518</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="generalGroup">
|
||||
<property name="title">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="languageLabel">
|
||||
<property name="text">
|
||||
<string>Morrowind installation language:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="languageComboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="wizardGroup">
|
||||
<property name="title">
|
||||
<string>Morrowind Installation Wizard</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3" columnstretch="1,1">
|
||||
<item row="1" column="1">
|
||||
<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>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="wizardButton">
|
||||
<property name="text">
|
||||
<string>Run &Installation Wizard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="importerGroup">
|
||||
<property name="title">
|
||||
<string>Morrowind Settings Importer</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0" columnstretch="1,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="importerLabel">
|
||||
<property name="text">
|
||||
<string>File to import settings from:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="fileComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>/home/user/.local/share/openmw/data/Morrowind.ini</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="browseButton">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="addonsCheckBox">
|
||||
<property name="text">
|
||||
<string>Import previously selected add-ons (creates a new Content List)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,1">
|
||||
<item row="2" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="importerButton">
|
||||
<property name="text">
|
||||
<string>Run &Settings Importer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|