From 802448b217477578a20d5543194623455b45c1b2 Mon Sep 17 00:00:00 2001 From: pvdk Date: Mon, 27 Jan 2014 20:14:02 +0100 Subject: [PATCH] Added a settings page to the launcher --- apps/launcher/CMakeLists.txt | 4 + apps/launcher/maindialog.cpp | 28 +-- apps/launcher/maindialog.hpp | 7 + apps/launcher/settingspage.cpp | 18 ++ apps/launcher/settingspage.hpp | 20 +++ .../icons/tango/{ => 16x16}/document-new.png | Bin .../icons/tango/{ => 16x16}/edit-copy.png | Bin .../icons/tango/{ => 16x16}/edit-delete.png | Bin .../icons/tango/{ => 16x16}/go-bottom.png | Bin .../icons/tango/{ => 16x16}/go-down.png | Bin .../icons/tango/{ => 16x16}/go-top.png | Bin .../icons/tango/{ => 16x16}/go-up.png | Bin .../icons/tango/48x48/preferences-system.png | Bin 0 -> 3718 bytes .../icons/tango/{ => 48x48}/video-display.png | Bin files/launcher/icons/tango/index.theme | 7 +- files/launcher/launcher.qrc | 17 +- files/ui/mainwindow.ui | 10 +- files/ui/settingspage.ui | 159 ++++++++++++++++++ 18 files changed, 248 insertions(+), 22 deletions(-) create mode 100644 apps/launcher/settingspage.cpp create mode 100644 apps/launcher/settingspage.hpp rename files/launcher/icons/tango/{ => 16x16}/document-new.png (100%) rename files/launcher/icons/tango/{ => 16x16}/edit-copy.png (100%) rename files/launcher/icons/tango/{ => 16x16}/edit-delete.png (100%) rename files/launcher/icons/tango/{ => 16x16}/go-bottom.png (100%) rename files/launcher/icons/tango/{ => 16x16}/go-down.png (100%) rename files/launcher/icons/tango/{ => 16x16}/go-top.png (100%) rename files/launcher/icons/tango/{ => 16x16}/go-up.png (100%) create mode 100644 files/launcher/icons/tango/48x48/preferences-system.png rename files/launcher/icons/tango/{ => 48x48}/video-display.png (100%) create mode 100644 files/ui/settingspage.ui diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt index 279474406..d24c8e377 100644 --- a/apps/launcher/CMakeLists.txt +++ b/apps/launcher/CMakeLists.txt @@ -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}) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 4012a1fbd..f81d15e9c 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -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); diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index a4fb4cd9a..718acb5a9 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -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; diff --git a/apps/launcher/settingspage.cpp b/apps/launcher/settingspage.cpp new file mode 100644 index 000000000..96dd6e529 --- /dev/null +++ b/apps/launcher/settingspage.cpp @@ -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); +} + diff --git a/apps/launcher/settingspage.hpp b/apps/launcher/settingspage.hpp new file mode 100644 index 000000000..c87f6e46f --- /dev/null +++ b/apps/launcher/settingspage.hpp @@ -0,0 +1,20 @@ +#ifndef SETTINGSPAGE_HPP +#define SETTINGSPAGE_HPP + +#include + +#include "ui_settingspage.h" + +namespace Launcher +{ + + class SettingsPage : public QWidget, private Ui::SettingsPage + { + Q_OBJECT + public: + SettingsPage(QWidget *parent = 0); + + }; +} + +#endif // SETTINGSPAGE_HPP diff --git a/files/launcher/icons/tango/document-new.png b/files/launcher/icons/tango/16x16/document-new.png similarity index 100% rename from files/launcher/icons/tango/document-new.png rename to files/launcher/icons/tango/16x16/document-new.png diff --git a/files/launcher/icons/tango/edit-copy.png b/files/launcher/icons/tango/16x16/edit-copy.png similarity index 100% rename from files/launcher/icons/tango/edit-copy.png rename to files/launcher/icons/tango/16x16/edit-copy.png diff --git a/files/launcher/icons/tango/edit-delete.png b/files/launcher/icons/tango/16x16/edit-delete.png similarity index 100% rename from files/launcher/icons/tango/edit-delete.png rename to files/launcher/icons/tango/16x16/edit-delete.png diff --git a/files/launcher/icons/tango/go-bottom.png b/files/launcher/icons/tango/16x16/go-bottom.png similarity index 100% rename from files/launcher/icons/tango/go-bottom.png rename to files/launcher/icons/tango/16x16/go-bottom.png diff --git a/files/launcher/icons/tango/go-down.png b/files/launcher/icons/tango/16x16/go-down.png similarity index 100% rename from files/launcher/icons/tango/go-down.png rename to files/launcher/icons/tango/16x16/go-down.png diff --git a/files/launcher/icons/tango/go-top.png b/files/launcher/icons/tango/16x16/go-top.png similarity index 100% rename from files/launcher/icons/tango/go-top.png rename to files/launcher/icons/tango/16x16/go-top.png diff --git a/files/launcher/icons/tango/go-up.png b/files/launcher/icons/tango/16x16/go-up.png similarity index 100% rename from files/launcher/icons/tango/go-up.png rename to files/launcher/icons/tango/16x16/go-up.png diff --git a/files/launcher/icons/tango/48x48/preferences-system.png b/files/launcher/icons/tango/48x48/preferences-system.png new file mode 100644 index 0000000000000000000000000000000000000000..a1620e991663d37d6e95ed11be7abb9927d73dfc GIT binary patch literal 3718 zcmV;14tep3P)6vTpS#__4QVLzy5efxS zd#NVY{B@(wID7oLjaxswUErK^vg^Qae#trCOa*e9N6q^-ZF=IGPNBDBKsVX8D_457 z-rinrnkEv71nhPPmM^K zBZ^SHpnOmHT#?g{?peLYnVz0OBasLIz-F@{6bhp9!w&|*V*Y2I3G_}l zW%mDSvP7k0o-|KE(X{C*C&TbM+S<(4=H?L7*{aPOpQ!rQ5deTK8@HTgW@72FKOGrp zZEZ2_b~^|mh(sbtNlC@@X~hbtb=ySs?Rx3;DH64u$@XPWDV{lF3_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lq3=Mz|ATjbB?XwZ#Nquo# zgv2CrBXA`qbhIDsuI^M){heI{dTE;1DSF*D$chziryUl7;9_-6 ze4y#`t+AfkmTM>;HJBJ@+)SDq<_OTy?-L^uzlJlerP}~tCQmGJT>gpx#K{YOw#qum zUv5(si_LBm^+W=}(4Y~yTK{~{>DP`Yd23X0vOzsb_=rwAF4ahqeDl`*o6$4JMdmMd zVwyxi_=c#eIBDkk8G@Xe!%b}<_|*shqiJ2nH4K>72sNL;nf!VL_)W&&uofaoUJ|Zh kgpbQ@HW7p0w{h)%0mM^)Wv7^EY5)KL07*qoM6N<$f}t=W#Q*>R literal 0 HcmV?d00001 diff --git a/files/launcher/icons/tango/video-display.png b/files/launcher/icons/tango/48x48/video-display.png similarity index 100% rename from files/launcher/icons/tango/video-display.png rename to files/launcher/icons/tango/48x48/video-display.png diff --git a/files/launcher/icons/tango/index.theme b/files/launcher/icons/tango/index.theme index 1f54489eb..8ec560f85 100644 --- a/files/launcher/icons/tango/index.theme +++ b/files/launcher/icons/tango/index.theme @@ -2,7 +2,10 @@ Name=Tango Comment=Tango Theme Inherits=default -Directories=16x16 +Directories=16x16,48x48 [16x16] -Size=16 \ No newline at end of file +Size=16 + +[48x48] +Size=48 \ No newline at end of file diff --git a/files/launcher/launcher.qrc b/files/launcher/launcher.qrc index 19b1c5a6f..4f55fccd5 100644 --- a/files/launcher/launcher.qrc +++ b/files/launcher/launcher.qrc @@ -9,13 +9,14 @@ icons/tango/index.theme - icons/tango/video-display.png - icons/tango/document-new.png - icons/tango/edit-copy.png - icons/tango/edit-delete.png - icons/tango/go-bottom.png - icons/tango/go-down.png - icons/tango/go-top.png - icons/tango/go-up.png + icons/tango/48x48/video-display.png + icons/tango/48x48/preferences-system.png + icons/tango/16x16/document-new.png + icons/tango/16x16/edit-copy.png + icons/tango/16x16/edit-delete.png + icons/tango/16x16/go-bottom.png + icons/tango/16x16/go-down.png + icons/tango/16x16/go-top.png + icons/tango/16x16/go-up.png diff --git a/files/ui/mainwindow.ui b/files/ui/mainwindow.ui index a1dfb172b..368e5cc5f 100644 --- a/files/ui/mainwindow.ui +++ b/files/ui/mainwindow.ui @@ -2,9 +2,17 @@ MainWindow + + + 0 + 0 + 635 + 575 + + - 575 + 635 535 diff --git a/files/ui/settingspage.ui b/files/ui/settingspage.ui new file mode 100644 index 000000000..95b62761e --- /dev/null +++ b/files/ui/settingspage.ui @@ -0,0 +1,159 @@ + + + SettingsPage + + + + 0 + 0 + 518 + 401 + + + + Form + + + + + + General + + + + + + Morrowind installation language: + + + + + + + + 250 + 0 + + + + + + + + + + + Morrowind Installation Wizard + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Run &Installation Wizard + + + + + + + + + + Morrowind Settings Importer + + + + + + + + File to import settings from: + + + + + + + + /home/user/.local/share/openmw/data/Morrowind.ini + + + + + + + + Browse... + + + + + + + + + Import previously selected add-ons (creates a new Content List) + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Run &Settings Importer + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + +