Implement Preferences dialog (except language setting)
This commit is contained in:
@@ -103,6 +103,9 @@ add_library(ui STATIC
|
|||||||
|
|
||||||
qt_styleoverride.cpp
|
qt_styleoverride.cpp
|
||||||
qt_styleoverride.hpp
|
qt_styleoverride.hpp
|
||||||
|
qt_progsettings.hpp
|
||||||
|
qt_progsettings.cpp
|
||||||
|
qt_progsettings.ui
|
||||||
|
|
||||||
../qt_resources.qrc
|
../qt_resources.qrc
|
||||||
)
|
)
|
||||||
|
@@ -33,6 +33,7 @@ extern uint64_t tsc;
|
|||||||
#include "qt_mediamenu.hpp"
|
#include "qt_mediamenu.hpp"
|
||||||
#include "qt_mainwindow.hpp"
|
#include "qt_mainwindow.hpp"
|
||||||
#include "qt_soundgain.hpp"
|
#include "qt_soundgain.hpp"
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
@@ -152,20 +153,20 @@ struct MachineStatus::States {
|
|||||||
Pixmaps pixmaps;
|
Pixmaps pixmaps;
|
||||||
|
|
||||||
States(QObject* parent) {
|
States(QObject* parent) {
|
||||||
pixmaps.cartridge.load(":/settings/win/icons/cartridge%1.ico");
|
pixmaps.cartridge.load(ProgSettings::getIconSetPath() + "/cartridge%1.ico");
|
||||||
pixmaps.cassette.load(":/settings/win/icons/cassette%1.ico");
|
pixmaps.cassette.load(ProgSettings::getIconSetPath() + "/cassette%1.ico");
|
||||||
pixmaps.floppy_disabled.normal = QIcon(QStringLiteral(":/settings/win/icons/floppy_disabled.ico")).pixmap(pixmap_size);
|
pixmaps.floppy_disabled.normal = QIcon(ProgSettings::getIconSetPath() + QStringLiteral("/floppy_disabled.ico")).pixmap(pixmap_size);
|
||||||
pixmaps.floppy_disabled.active = pixmaps.floppy_disabled.normal;
|
pixmaps.floppy_disabled.active = pixmaps.floppy_disabled.normal;
|
||||||
pixmaps.floppy_disabled.empty = pixmaps.floppy_disabled.normal;
|
pixmaps.floppy_disabled.empty = pixmaps.floppy_disabled.normal;
|
||||||
pixmaps.floppy_disabled.empty_active = pixmaps.floppy_disabled.normal;
|
pixmaps.floppy_disabled.empty_active = pixmaps.floppy_disabled.normal;
|
||||||
pixmaps.floppy_525.load(":/settings/win/icons/floppy_525%1.ico");
|
pixmaps.floppy_525.load(ProgSettings::getIconSetPath() + "/floppy_525%1.ico");
|
||||||
pixmaps.floppy_35.load(":/settings/win/icons/floppy_35%1.ico");
|
pixmaps.floppy_35.load(ProgSettings::getIconSetPath() + "/floppy_35%1.ico");
|
||||||
pixmaps.cdrom.load(":/settings/win/icons/cdrom%1.ico");
|
pixmaps.cdrom.load(ProgSettings::getIconSetPath() + "/cdrom%1.ico");
|
||||||
pixmaps.zip.load(":/settings/win/icons/zip%1.ico");
|
pixmaps.zip.load(ProgSettings::getIconSetPath() + "/zip%1.ico");
|
||||||
pixmaps.mo.load(":/settings/win/icons/mo%1.ico");
|
pixmaps.mo.load(ProgSettings::getIconSetPath() + "/mo%1.ico");
|
||||||
pixmaps.hd.load(":/settings/win/icons/hard_disk%1.ico");
|
pixmaps.hd.load(ProgSettings::getIconSetPath() + "/hard_disk%1.ico");
|
||||||
pixmaps.net.load(":/settings/win/icons/network%1.ico");
|
pixmaps.net.load(ProgSettings::getIconSetPath() + "/network%1.ico");
|
||||||
pixmaps.sound = QIcon(":/settings/win/icons/sound.ico").pixmap(pixmap_size);
|
pixmaps.sound = QIcon(ProgSettings::getIconSetPath() + "/sound.ico").pixmap(pixmap_size);
|
||||||
|
|
||||||
cartridge[0].pixmaps = &pixmaps.cartridge;
|
cartridge[0].pixmaps = &pixmaps.cartridge;
|
||||||
cartridge[1].pixmaps = &pixmaps.cartridge;
|
cartridge[1].pixmaps = &pixmaps.cartridge;
|
||||||
@@ -531,6 +532,10 @@ void MachineStatus::message(const QString &msg) {
|
|||||||
d->text->setText(msg);
|
d->text->setText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MachineStatus::getMessage() {
|
||||||
|
return d->text->text();
|
||||||
|
}
|
||||||
|
|
||||||
void MachineStatus::updateTip(int tag)
|
void MachineStatus::updateTip(int tag)
|
||||||
{
|
{
|
||||||
int category = tag & 0xfffffff0;
|
int category = tag & 0xfffffff0;
|
||||||
|
@@ -40,6 +40,8 @@ public:
|
|||||||
static void iterateCDROM(const std::function<void(int i)>& cb);
|
static void iterateCDROM(const std::function<void(int i)>& cb);
|
||||||
static void iterateZIP(const std::function<void(int i)>& cb);
|
static void iterateZIP(const std::function<void(int i)>& cb);
|
||||||
static void iterateMO(const std::function<void(int i)>& cb);
|
static void iterateMO(const std::function<void(int i)>& cb);
|
||||||
|
|
||||||
|
QString getMessage();
|
||||||
public slots:
|
public slots:
|
||||||
void refresh(QStatusBar* sbar);
|
void refresh(QStatusBar* sbar);
|
||||||
void setActivity(int tag, bool active);
|
void setActivity(int tag, bool active);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "qt_specifydimensions.h"
|
#include "qt_specifydimensions.h"
|
||||||
#include "qt_soundgain.hpp"
|
#include "qt_soundgain.hpp"
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
#include "qt_rendererstack.hpp"
|
#include "qt_rendererstack.hpp"
|
||||||
#include "qt_renderercomon.hpp"
|
#include "qt_renderercomon.hpp"
|
||||||
@@ -1368,3 +1369,10 @@ void MainWindow::on_actionOpenGL_3_0_Core_triggered()
|
|||||||
ui->actionOpenGL_3_0_Core->setChecked(true);
|
ui->actionOpenGL_3_0_Core->setChecked(true);
|
||||||
vid_api = 3;
|
vid_api = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionPreferences_triggered()
|
||||||
|
{
|
||||||
|
ProgSettings progsettings(this);
|
||||||
|
progsettings.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -101,6 +101,8 @@ private slots:
|
|||||||
|
|
||||||
void on_actionOpenGL_3_0_Core_triggered();
|
void on_actionOpenGL_3_0_Core_triggered();
|
||||||
|
|
||||||
|
void on_actionPreferences_triggered();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent* event) override;
|
void keyPressEvent(QKeyEvent* event) override;
|
||||||
void keyReleaseEvent(QKeyEvent* event) override;
|
void keyReleaseEvent(QKeyEvent* event) override;
|
||||||
@@ -120,6 +122,7 @@ private:
|
|||||||
bool shownonce = false;
|
bool shownonce = false;
|
||||||
|
|
||||||
friend class SpecifyDimensions;
|
friend class SpecifyDimensions;
|
||||||
|
friend class ProgSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_MAINWINDOW_HPP
|
#endif // QT_MAINWINDOW_HPP
|
||||||
|
@@ -75,6 +75,8 @@
|
|||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionTake_screenshot"/>
|
<addaction name="actionTake_screenshot"/>
|
||||||
<addaction name="actionSound_gain"/>
|
<addaction name="actionSound_gain"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionPreferences"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -520,6 +522,11 @@
|
|||||||
<string>OpenGL 3.0 Core</string>
|
<string>OpenGL 3.0 Core</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionPreferences">
|
||||||
|
<property name="text">
|
||||||
|
<string>Preferences</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
94
src/qt/qt_progsettings.cpp
Normal file
94
src/qt/qt_progsettings.cpp
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
#include "ui_qt_progsettings.h"
|
||||||
|
#include "qt_mainwindow.hpp"
|
||||||
|
#include "ui_qt_mainwindow.h"
|
||||||
|
#include "qt_machinestatus.hpp"
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#include <86box/86box.h>
|
||||||
|
#include <86box/config.h>
|
||||||
|
#include <86box/plat.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static QMap<QString, QString> iconset_to_qt;
|
||||||
|
extern MainWindow* main_window;
|
||||||
|
|
||||||
|
QString ProgSettings::getIconSetPath()
|
||||||
|
{
|
||||||
|
QString roms_root;
|
||||||
|
if (rom_path[0])
|
||||||
|
roms_root = rom_path;
|
||||||
|
else {
|
||||||
|
roms_root = QString("%1/roms").arg(exe_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iconset_to_qt.isEmpty())
|
||||||
|
{
|
||||||
|
iconset_to_qt.insert("", ":/settings/win/icons");
|
||||||
|
QDir dir(roms_root + "/icons/");
|
||||||
|
if (dir.isReadable())
|
||||||
|
{
|
||||||
|
auto dirList = dir.entryList(QDir::AllDirs | QDir::Executable | QDir::Readable);
|
||||||
|
for (auto &curIconSet : dirList)
|
||||||
|
{
|
||||||
|
if (curIconSet == "." || curIconSet == "..") continue;
|
||||||
|
iconset_to_qt.insert(curIconSet, (dir.canonicalPath() + '/') + curIconSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return iconset_to_qt[icon_set];
|
||||||
|
}
|
||||||
|
|
||||||
|
ProgSettings::ProgSettings(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::ProgSettings)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
(void)getIconSetPath();
|
||||||
|
ui->comboBox->setItemData(0, "");
|
||||||
|
ui->comboBox->setCurrentIndex(0);
|
||||||
|
for (auto i = iconset_to_qt.begin(); i != iconset_to_qt.end(); i++)
|
||||||
|
{
|
||||||
|
if (i.key() == "") continue;
|
||||||
|
QFile iconfile(i.value() + "/iconinfo.txt");
|
||||||
|
iconfile.open(QFile::ReadOnly);
|
||||||
|
QString friendlyName;
|
||||||
|
QString iconsetinfo(iconfile.readAll());
|
||||||
|
iconfile.close();
|
||||||
|
if (iconsetinfo.isEmpty()) friendlyName = i.key();
|
||||||
|
else friendlyName = iconsetinfo.split('\n')[0];
|
||||||
|
ui->comboBox->addItem(friendlyName, i.key());
|
||||||
|
if (strcmp(icon_set, i.key().toUtf8().data()) == 0)
|
||||||
|
{
|
||||||
|
ui->comboBox->setCurrentIndex(ui->comboBox->findData(i.key()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProgSettings::accept()
|
||||||
|
{
|
||||||
|
strcpy(icon_set, ui->comboBox->currentData().toString().toUtf8().data());
|
||||||
|
|
||||||
|
QString msg = main_window->status->getMessage();
|
||||||
|
main_window->status.reset(new MachineStatus(main_window));
|
||||||
|
main_window->refreshMediaMenu();
|
||||||
|
main_window->status->message(msg);
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
ProgSettings::~ProgSettings()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProgSettings::on_pushButton_released()
|
||||||
|
{
|
||||||
|
ui->comboBox->setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
|
30
src/qt/qt_progsettings.hpp
Normal file
30
src/qt/qt_progsettings.hpp
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef QT_PROGSETTINGS_HPP
|
||||||
|
#define QT_PROGSETTINGS_HPP
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ProgSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ProgSettings : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ProgSettings(QWidget *parent = nullptr);
|
||||||
|
~ProgSettings();
|
||||||
|
static QString getIconSetPath();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void accept() override;
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_released();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ProgSettings *ui;
|
||||||
|
|
||||||
|
friend class MainWindow;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QT_PROGSETTINGS_HPP
|
112
src/qt/qt_progsettings.ui
Normal file
112
src/qt/qt_progsettings.ui
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ProgSettings</class>
|
||||||
|
<widget class="QDialog" name="ProgSettings">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Preferences</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>341</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox" name="comboBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>351</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>(Default)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>54</width>
|
||||||
|
<height>17</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Icon set:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>290</x>
|
||||||
|
<y>110</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>25</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>ProgSettings</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>ProgSettings</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
@@ -13,6 +13,8 @@
|
|||||||
#include "qt_settingsotherremovable.hpp"
|
#include "qt_settingsotherremovable.hpp"
|
||||||
#include "qt_settingsotherperipherals.hpp"
|
#include "qt_settingsotherperipherals.hpp"
|
||||||
|
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
@@ -64,7 +66,7 @@ QVariant SettingsModel::data(const QModelIndex &index, int role) const {
|
|||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return pages.at(index.row());
|
return pages.at(index.row());
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
return QIcon(QString(":/settings/win/icons/%1.ico").arg(page_icons[index.row()]));
|
return QIcon(QString("%1/%2.ico").arg(ProgSettings::getIconSetPath(), page_icons[index.row()]));
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@@ -11,15 +11,16 @@ extern "C" {
|
|||||||
|
|
||||||
#include "qt_models_common.hpp"
|
#include "qt_models_common.hpp"
|
||||||
#include "qt_harddrive_common.hpp"
|
#include "qt_harddrive_common.hpp"
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
static void setFloppyType(QAbstractItemModel* model, const QModelIndex& idx, int type) {
|
static void setFloppyType(QAbstractItemModel* model, const QModelIndex& idx, int type) {
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
icon = QIcon(":/settings/win/icons/floppy_disabled.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/floppy_disabled.ico");
|
||||||
} else if (type >= 1 && type <= 6) {
|
} else if (type >= 1 && type <= 6) {
|
||||||
icon = QIcon(":/settings/win/icons/floppy_525.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/floppy_525.ico");
|
||||||
} else {
|
} else {
|
||||||
icon = QIcon(":/settings/win/icons/floppy_35.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/floppy_35.ico");
|
||||||
}
|
}
|
||||||
|
|
||||||
model->setData(idx, fdd_getname(type));
|
model->setData(idx, fdd_getname(type));
|
||||||
@@ -31,11 +32,11 @@ static void setCDROMBus(QAbstractItemModel* model, const QModelIndex& idx, uint8
|
|||||||
QIcon icon;
|
QIcon icon;
|
||||||
switch (bus) {
|
switch (bus) {
|
||||||
case CDROM_BUS_DISABLED:
|
case CDROM_BUS_DISABLED:
|
||||||
icon = QIcon(":/settings/win/icons/cdrom_disabled.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/cdrom_disabled.ico");
|
||||||
break;
|
break;
|
||||||
case CDROM_BUS_ATAPI:
|
case CDROM_BUS_ATAPI:
|
||||||
case CDROM_BUS_SCSI:
|
case CDROM_BUS_SCSI:
|
||||||
icon = QIcon(":/settings/win/icons/cdrom.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/cdrom.ico");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include "qt_harddiskdialog.hpp"
|
#include "qt_harddiskdialog.hpp"
|
||||||
#include "qt_harddrive_common.hpp"
|
#include "qt_harddrive_common.hpp"
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
const int ColumnBus = 0;
|
const int ColumnBus = 0;
|
||||||
const int ColumnFilename = 1;
|
const int ColumnFilename = 1;
|
||||||
@@ -54,7 +55,7 @@ static void addRow(QAbstractItemModel* model, hard_disk_t* hd) {
|
|||||||
|
|
||||||
QString busName = Harddrives::BusChannelName(hd->bus, hd->channel);
|
QString busName = Harddrives::BusChannelName(hd->bus, hd->channel);
|
||||||
model->setData(model->index(row, ColumnBus), busName);
|
model->setData(model->index(row, ColumnBus), busName);
|
||||||
model->setData(model->index(row, ColumnBus), QIcon(":/settings/win/icons/hard_disk.ico"), Qt::DecorationRole);
|
model->setData(model->index(row, ColumnBus), QIcon(ProgSettings::getIconSetPath() + "/hard_disk.ico"), Qt::DecorationRole);
|
||||||
model->setData(model->index(row, ColumnBus), hd->bus, DataBus);
|
model->setData(model->index(row, ColumnBus), hd->bus, DataBus);
|
||||||
model->setData(model->index(row, ColumnBus), hd->channel, DataBusChannel);
|
model->setData(model->index(row, ColumnBus), hd->channel, DataBusChannel);
|
||||||
QString fileName = hd->fn;
|
QString fileName = hd->fn;
|
||||||
|
@@ -12,6 +12,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include "qt_models_common.hpp"
|
#include "qt_models_common.hpp"
|
||||||
#include "qt_harddrive_common.hpp"
|
#include "qt_harddrive_common.hpp"
|
||||||
|
#include "qt_progsettings.hpp"
|
||||||
|
|
||||||
static QString moDriveTypeName(int i) {
|
static QString moDriveTypeName(int i) {
|
||||||
return QString("%1 %2 %3").arg(mo_drive_types[i].vendor, mo_drive_types[i].model, mo_drive_types[i].revision);
|
return QString("%1 %2 %3").arg(mo_drive_types[i].vendor, mo_drive_types[i].model, mo_drive_types[i].revision);
|
||||||
@@ -21,11 +22,11 @@ static void setMOBus(QAbstractItemModel* model, const QModelIndex& idx, uint8_t
|
|||||||
QIcon icon;
|
QIcon icon;
|
||||||
switch (bus) {
|
switch (bus) {
|
||||||
case MO_BUS_DISABLED:
|
case MO_BUS_DISABLED:
|
||||||
icon = QIcon(":/settings/win/icons/mo_disabled.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/mo_disabled.ico");
|
||||||
break;
|
break;
|
||||||
case MO_BUS_ATAPI:
|
case MO_BUS_ATAPI:
|
||||||
case MO_BUS_SCSI:
|
case MO_BUS_SCSI:
|
||||||
icon = QIcon(":/settings/win/icons/mo.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/mo.ico");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,11 +51,11 @@ static void setZIPBus(QAbstractItemModel* model, const QModelIndex& idx, uint8_t
|
|||||||
QIcon icon;
|
QIcon icon;
|
||||||
switch (bus) {
|
switch (bus) {
|
||||||
case ZIP_BUS_DISABLED:
|
case ZIP_BUS_DISABLED:
|
||||||
icon = QIcon(":/settings/win/icons/zip_disabled.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/zip_disabled.ico");
|
||||||
break;
|
break;
|
||||||
case ZIP_BUS_ATAPI:
|
case ZIP_BUS_ATAPI:
|
||||||
case ZIP_BUS_SCSI:
|
case ZIP_BUS_SCSI:
|
||||||
icon = QIcon(":/settings/win/icons/zip.ico");
|
icon = QIcon(ProgSettings::getIconSetPath() + "/zip.ico");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user