PIT type selection, CD-ROM model filtering by bus, and translation updates - closes #3354.

This commit is contained in:
OBattler
2023-08-16 05:23:03 +02:00
parent 21b8b992b5
commit 6fae975a72
28 changed files with 886 additions and 464 deletions

View File

@@ -1868,11 +1868,9 @@ cdrom_insert(uint8_t id)
{ {
cdrom_t *dev = &cdrom[id]; cdrom_t *dev = &cdrom[id];
if (dev->bus_type) { if (dev->bus_type && dev->insert)
if (dev->insert)
dev->insert(dev->priv); dev->insert(dev->priv);
} }
}
/* The mechanics of ejecting a CD-ROM from a drive. */ /* The mechanics of ejecting a CD-ROM from a drive. */
void void

View File

@@ -63,7 +63,8 @@ enum {
#define KNOWN_CDROM_DRIVE_TYPES 35 #define KNOWN_CDROM_DRIVE_TYPES 35
#define BUS_TYPE_IDE CDROM_BUS_ATAPI #define BUS_TYPE_IDE CDROM_BUS_ATAPI
#define BUS_TYPE_SCSI CDROM_BUS_SCSI #define BUS_TYPE_SCSI CDROM_BUS_SCSI
#define BUS_TYPE_BOTH -1 #define BUS_TYPE_BOTH -2
#define BUS_TYPE_NONE -1
static const struct static const struct
{ {
@@ -109,7 +110,7 @@ static const struct
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*33*/ { "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*33*/
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*34*/ { "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*34*/
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*35*/ { "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*35*/
{ "", "", "", "", "", -1 }, { "", "", "", "", "", BUS_TYPE_NONE },
}; };
/* To shut up the GCC compilers. */ /* To shut up the GCC compilers. */

View File

@@ -166,7 +166,7 @@ machine_common_init(UNUSED(const machine_t *model))
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253; int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
/* Select fast PIT if needed */ /* Select fast PIT if needed */
if ((pit_mode == -1 && is486) || pit_mode == 1) if (((pit_mode == -1) && is486) || (pit_mode == 1))
pit_type += 2; pit_type += 2;
pit_common_init(pit_type, pit_irq0_timer, NULL); pit_common_init(pit_type, pit_irq0_timer, NULL);

View File

@@ -656,7 +656,7 @@ msgid "(empty)"
msgstr "(prázdné)" msgstr "(prázdné)"
msgid "All files" msgid "All files"
msgstr "All files" msgstr "Všechny soubory"
msgid "Turbo" msgid "Turbo"
msgstr "Turbo" msgstr "Turbo"
@@ -932,10 +932,10 @@ msgid "Cartridge images"
msgstr "Obrazy cartridge" msgstr "Obrazy cartridge"
msgid "Error initializing renderer" msgid "Error initializing renderer"
msgstr "Error initializing renderer" msgstr "Chyba při inicializaci vykreslovače"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgstr "Vykreslovač OpenGL (3.0 Core) se nepodařilo inicializovat. Použijte jiný renderer."
msgid "Resume execution" msgid "Resume execution"
msgstr "Obnovit" msgstr "Obnovit"
@@ -1196,8 +1196,19 @@ msgid "(System Default)"
msgstr "(Výchozí nastavení systému)" msgstr "(Výchozí nastavení systému)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Nepodařilo se inicializovat síťový ovladač"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Konfigurace sítě bude přepnuta na nulový ovladač"
msgid "PIT mode:"
msgstr "Režim PIT:"
msgid "Auto"
msgstr "Automatický"
msgid "Slow"
msgstr "Pomalý"
msgid "Fast"
msgstr "Rychlý"

View File

@@ -98,7 +98,7 @@ msgid "Filter method"
msgstr "Filteringmethode" msgstr "Filteringmethode"
msgid "&Nearest" msgid "&Nearest"
msgstr "&Nearest" msgstr "&Nächst"
msgid "&Linear" msgid "&Linear"
msgstr "&Linear" msgstr "&Linear"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Systemstandard)" msgstr "(Systemstandard)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Netzwerktreiber konnte nicht initialisiert werden"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Die Netzwerkkonfiguration wird auf den Nulltreiber umgestellt"
msgid "PIT mode:"
msgstr "PIT-Modus:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Langsam"
msgid "Fast"
msgstr "Schnell"

View File

@@ -1201,3 +1201,15 @@ msgstr "Failed to initialize network driver"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "The network configuration will be switched to the null driver"
msgid "PIT mode:"
msgstr "PIT mode:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Slow"
msgid "Fast"
msgstr "Fast"

View File

@@ -1201,3 +1201,15 @@ msgstr "Failed to initialize network driver"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "The network configuration will be switched to the null driver"
msgid "PIT mode:"
msgstr "PIT mode:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Slow"
msgid "Fast"
msgstr "Fast"

View File

@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Imágenes de Cartucho" msgstr "Imágenes de Cartucho"
msgid "Error initializing renderer" msgid "Error initializing renderer"
msgstr "Error initializing renderer" msgstr "Error al inicializar el renderizador"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgstr "No se ha podido inicializar el renderizador OpenGL (3.0 Core). Utilice otro renderizador."
msgid "Resume execution" msgid "Resume execution"
msgstr "Resume execution" msgstr "Retomar la ejecución"
msgid "Pause execution" msgid "Pause execution"
msgstr "Pause execution" msgstr "Pausar la ejecución"
msgid "Press Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del" msgstr "Pulsar Ctrl+Alt+Supr"
msgid "Press Ctrl+Alt+Esc" msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc" msgstr "Pulsar Ctrl+Alt+Esc"
msgid "Hard reset" msgid "Hard reset"
msgstr "Hard reset" msgstr "Hard reset"
msgid "ACPI shutdown" msgid "ACPI shutdown"
msgstr "ACPI shutdown" msgstr "Parada ACPI"
msgid "Hard disk (%s)" msgid "Hard disk (%s)"
msgstr "Disco duro (%s)" msgstr "Disco duro (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Por defecto del sistema)" msgstr "(Por defecto del sistema)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Error al inicializar el controlador de red"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "La configuración de red se cambiará al controlador nulo"
msgid "PIT mode:"
msgstr "Modalidad PIT:"
msgid "Auto"
msgstr "Automática"
msgid "Slow"
msgstr "Lenta"
msgid "Fast"
msgstr "Rápida"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Järjestelmän oletus)" msgstr "(Järjestelmän oletus)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Verkkoajurin alustaminen epäonnistui"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Verkkokokoonpano vaihtuu nolla-ajuriin"
msgid "PIT mode:"
msgstr "PIT-tila:"
msgid "Auto"
msgstr "Automaattinen"
msgid "Slow"
msgstr "Hidas"
msgid "Fast"
msgstr "Nopea"

View File

@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Images cartouche" msgstr "Images cartouche"
msgid "Error initializing renderer" msgid "Error initializing renderer"
msgstr "Error initializing renderer" msgstr "Erreur d'initialisation du moteur de rendu"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgstr "Le moteur de rendu OpenGL (3.0 Core) n'a pas pu être initialisé. Utilisez un autre moteur de rendu."
msgid "Resume execution" msgid "Resume execution"
msgstr "Resume execution" msgstr "Reprendre l'exécution"
msgid "Pause execution" msgid "Pause execution"
msgstr "Pause execution" msgstr "Pause de l'exécution"
msgid "Press Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del" msgstr "Appuyer sur Ctrl+Alt+Suppr."
msgid "Press Ctrl+Alt+Esc" msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc" msgstr "Appuyer sur Ctrl+Alt+Esc"
msgid "Hard reset" msgid "Hard reset"
msgstr "Hard reset" msgstr "Hard reset"
msgid "ACPI shutdown" msgid "ACPI shutdown"
msgstr "ACPI shutdown" msgstr "Arrêt ACPI"
msgid "Hard disk (%s)" msgid "Hard disk (%s)"
msgstr "Disque dur (%s)" msgstr "Disque dur (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Défaut du système)" msgstr "(Défaut du système)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Échec de l'initialisation du pilote réseau"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "La configuration du réseau passera au pilote nul"
msgid "PIT mode:"
msgstr "Mode PIT:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Lent"
msgid "Fast"
msgstr "Rapide"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Zadana postavka operativnog sustava)" msgstr "(Zadana postavka operativnog sustava)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Neuspješno pokretanje mrežnog upravljačkog programa"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Konfiguracija mreže bit će prebačena na nulti upravljački program"
msgid "PIT mode:"
msgstr "PIT način:"
msgid "Auto"
msgstr "Auto"
msgid "Slow"
msgstr "Spori"
msgid "Fast"
msgstr "Brzi"

View File

@@ -938,22 +938,22 @@ msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer
msgstr "Az OpenGL (3.0 Core) megjelenítő-motort nem sikerült inicializálni. Kérem használjon másik renderelőt." msgstr "Az OpenGL (3.0 Core) megjelenítő-motort nem sikerült inicializálni. Kérem használjon másik renderelőt."
msgid "Resume execution" msgid "Resume execution"
msgstr "Resume execution" msgstr "Folytassa a végrehajtást"
msgid "Pause execution" msgid "Pause execution"
msgstr "Pause execution" msgstr "Kivitelezés szüneteltetése"
msgid "Press Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del" msgstr "Nyomja meg a Ctrl+Alt+Del"
msgid "Press Ctrl+Alt+Esc" msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc" msgstr "Nyomja meg a Ctrl+Alt+Esc"
msgid "Hard reset" msgid "Hard reset"
msgstr "Hard reset" msgstr "Hardveres újraindítás"
msgid "ACPI shutdown" msgid "ACPI shutdown"
msgstr "ACPI shutdown" msgstr "ACPI leállítás"
msgid "Hard disk (%s)" msgid "Hard disk (%s)"
msgstr "Merevlemez (%s)" msgstr "Merevlemez (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(A rendszer nyelve)" msgstr "(A rendszer nyelve)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Nem sikerült inicializálni a hálózati illesztőprogramot"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "A hálózati konfiguráció átvált a null illesztőprogramra"
msgid "PIT mode:"
msgstr "PIT üzemmód:"
msgid "Auto"
msgstr "Automatikus"
msgid "Slow"
msgstr "Lassú"
msgid "Fast"
msgstr "Gyors"

View File

@@ -866,7 +866,7 @@ msgid "libpcap"
msgstr "libpcap" msgstr "libpcap"
msgid "Make sure libpcap is installed and that you are on a libpcap-compatible network connection." msgid "Make sure libpcap is installed and that you are on a libpcap-compatible network connection."
msgstr "Controlla se libpcap è installato e che tu sia connesso ad una connessione libpcap compatibile." msgstr "Controllare se libpcap è installato e che tu sia connesso ad una connessione libpcap compatibile."
msgid "Invalid configuration" msgid "Invalid configuration"
msgstr "Configurazione invalida" msgstr "Configurazione invalida"
@@ -932,28 +932,28 @@ msgid "Cartridge images"
msgstr "Immagini cartuccia" msgstr "Immagini cartuccia"
msgid "Error initializing renderer" msgid "Error initializing renderer"
msgstr "Error initializing renderer" msgstr "Errore nell'inizializzazione del renderer"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." msgstr "Non è stato possibile inizializzare il renderer OpenGL (3.0 Core). Utilizzare un altro renderer."
msgid "Resume execution" msgid "Resume execution"
msgstr "Resume execution" msgstr "Riprendere l'esecuzione"
msgid "Pause execution" msgid "Pause execution"
msgstr "Pause execution" msgstr "Sospendere l'esecuzione"
msgid "Press Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del" msgstr "Premere Ctrl+Alt+Canc"
msgid "Press Ctrl+Alt+Esc" msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc" msgstr "Premere Ctrl+Alt+Esc"
msgid "Hard reset" msgid "Hard reset"
msgstr "Hard reset" msgstr "Riavvia"
msgid "ACPI shutdown" msgid "ACPI shutdown"
msgstr "ACPI shutdown" msgstr "Arresto ACPI"
msgid "Hard disk (%s)" msgid "Hard disk (%s)"
msgstr "Hard disk (%s)" msgstr "Hard disk (%s)"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Predefinito del sistema)" msgstr "(Predefinito del sistema)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Impossibile inizializzare il driver di rete"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "La configurazione di rete verrà commutata sul driver nullo"
msgid "PIT mode:"
msgstr "Modalità PIT:"
msgid "Auto"
msgstr "Automatica"
msgid "Slow"
msgstr "Lenta"
msgid "Fast"
msgstr "Veloce"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(システム既定値)" msgstr "(システム既定値)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "ネットワークドライバの初期化に失敗しました"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "ネットワーク設定がヌル・ドライバに切り替わる"
msgid "PIT mode:"
msgstr "PITモード:"
msgid "Auto"
msgstr "オート"
msgid "Slow"
msgstr "遅い"
msgid "Fast"
msgstr "速い"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(시스템 기본값)" msgstr "(시스템 기본값)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "네트워크 드라이버를 초기화하지 못했습니다"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "네트워크 구성이 널 드라이버로 전환됩니다"
msgid "PIT mode:"
msgstr "PIT 모드:"
msgid "Auto"
msgstr "자동"
msgid "Slow"
msgstr "느린"
msgid "Fast"
msgstr "빠른"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Domyślne ustawienie systemowe)" msgstr "(Domyślne ustawienie systemowe)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Nie udało się zainicjować sterownika sieciowego"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Konfiguracja sieci zostanie przełączona na sterownik null"
msgid "PIT mode:"
msgstr "Tryb PIT:"
msgid "Auto"
msgstr "Automatyczny"
msgid "Slow"
msgstr "Powolny"
msgid "Fast"
msgstr "Szybki"

View File

@@ -1201,3 +1201,15 @@ msgstr "Falha ao inicializar o driver de rede"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "A configuração de rede será alterada para o driver nulo" msgstr "A configuração de rede será alterada para o driver nulo"
msgid "PIT mode:"
msgstr "Modo PIT:"
msgid "Auto"
msgstr "Automático"
msgid "Slow"
msgstr "Lento"
msgid "Fast"
msgstr "Rápido"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Padrão do sistema)" msgstr "(Padrão do sistema)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Falha ao inicializar o driver de rede"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "A configuração da rede será alterada para o controlador nulo"
msgid "PIT mode:"
msgstr "Modo PIT:"
msgid "Auto"
msgstr "Automático"
msgid "Slow"
msgstr "Lento"
msgid "Fast"
msgstr "Rápido"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Системный)" msgstr "(Системный)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Не удалось инициализировать сетевой драйвер"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Сетевая конфигурация будет переключена на нулевой драйвер"
msgid "PIT mode:"
msgstr "Режим PIT:"
msgid "Auto"
msgstr "Авто"
msgid "Slow"
msgstr "Медленный"
msgid "Fast"
msgstr "Быстрый"

View File

@@ -944,10 +944,10 @@ msgid "Pause execution"
msgstr "Prekini izvajanje" msgstr "Prekini izvajanje"
msgid "Press Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Del"
msgstr "Press Ctrl+Alt+Del" msgstr "Pritisni Ctrl+Alt+Del"
msgid "Press Ctrl+Alt+Esc" msgid "Press Ctrl+Alt+Esc"
msgstr "Press Ctrl+Alt+Esc" msgstr "Pritisni Ctrl+Alt+Esc"
msgid "Hard reset" msgid "Hard reset"
msgstr "Ponovni zagon" msgstr "Ponovni zagon"
@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Sistemsko privzeto)" msgstr "(Sistemsko privzeto)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Ni uspelo inicializirati omrežnega gonilnika"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Omrežne nastavitve bodo preklopljene na ničelni gonilnik"
msgid "PIT mode:"
msgstr "Način PIT:"
msgid "Auto"
msgstr "Samodejni"
msgid "Slow"
msgstr "Počasni"
msgid "Fast"
msgstr "Hitri"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Sistem Varsayılanı)" msgstr "(Sistem Varsayılanı)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Ağ sürücüsü başlatılamadı"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Ağ yapılandırması null sürücüye geçirilecektir"
msgid "PIT mode:"
msgstr "PIT modu:"
msgid "Auto"
msgstr "Otomatik"
msgid "Slow"
msgstr "Yavaş"
msgid "Fast"
msgstr "Hızlı"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(Системний)" msgstr "(Системний)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "Не вдалося ініціалізувати мережевий драйвер"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "Конфігурацію мережі буде змінено на нульовий драйвер"
msgid "PIT mode:"
msgstr "Режим PIT:"
msgid "Auto"
msgstr "Авто"
msgid "Slow"
msgstr "Повільний"
msgid "Fast"
msgstr "Швидкий"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(系统默认)" msgstr "(系统默认)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "网络驱动程序初始化失败"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "网络配置将切换为空驱动程序"
msgid "PIT mode:"
msgstr "PIT 模式:"
msgid "Auto"
msgstr "汽车"
msgid "Slow"
msgstr "慢"
msgid "Fast"
msgstr "快速"

View File

@@ -1196,8 +1196,20 @@ msgid "(System Default)"
msgstr "(系統預設)" msgstr "(系統預設)"
msgid "Failed to initialize network driver" msgid "Failed to initialize network driver"
msgstr "Failed to initialize network driver" msgstr "初始化網絡驅動程序失敗"
msgid "The network configuration will be switched to the null driver" msgid "The network configuration will be switched to the null driver"
msgstr "The network configuration will be switched to the null driver" msgstr "網絡配置將切換為空驅動程序"
msgid "PIT mode:"
msgstr "點模式:"
msgid "Auto"
msgstr "汽車"
msgid "Slow"
msgstr "慢的"
msgid "Fast"
msgstr "快速地"

View File

@@ -45,13 +45,12 @@ static void
setFloppyType(QAbstractItemModel *model, const QModelIndex &idx, int type) setFloppyType(QAbstractItemModel *model, const QModelIndex &idx, int type)
{ {
QIcon icon; QIcon icon;
if (type == 0) { if (type == 0)
icon = ProgSettings::loadIcon("/floppy_disabled.ico"); icon = ProgSettings::loadIcon("/floppy_disabled.ico");
} else if (type >= 1 && type <= 6) { else if (type >= 1 && type <= 6)
icon = ProgSettings::loadIcon("/floppy_525.ico"); icon = ProgSettings::loadIcon("/floppy_525.ico");
} else { else
icon = ProgSettings::loadIcon("/floppy_35.ico"); icon = ProgSettings::loadIcon("/floppy_35.ico");
}
model->setData(idx, QObject::tr(fdd_getname(type))); model->setData(idx, QObject::tr(fdd_getname(type)));
model->setData(idx, type, Qt::UserRole); model->setData(idx, type, Qt::UserRole);
@@ -62,6 +61,7 @@ static void
setCDROMBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint8_t channel) setCDROMBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint8_t channel)
{ {
QIcon icon; QIcon icon;
switch (bus) { switch (bus) {
case CDROM_BUS_DISABLED: case CDROM_BUS_DISABLED:
icon = ProgSettings::loadIcon("/cdrom_disabled.ico"); icon = ProgSettings::loadIcon("/cdrom_disabled.ico");
@@ -94,11 +94,10 @@ static void
setCDROMType(QAbstractItemModel *model, const QModelIndex &idx, int type) setCDROMType(QAbstractItemModel *model, const QModelIndex &idx, int type)
{ {
auto i = idx.siblingAtColumn(2); auto i = idx.siblingAtColumn(2);
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == CDROM_BUS_DISABLED) { if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == CDROM_BUS_DISABLED)
model->setData(i, QCoreApplication::translate("", "None")); model->setData(i, QCoreApplication::translate("", "None"));
} else if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() != CDROM_BUS_MITSUMI) { else if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() != CDROM_BUS_MITSUMI)
model->setData(i, QObject::tr(cdrom_getname(type))); model->setData(i, QObject::tr(cdrom_getname(type)));
}
model->setData(i, type, Qt::UserRole); model->setData(i, type, Qt::UserRole);
} }
@@ -112,9 +111,8 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
int i = 0; int i = 0;
while (true) { while (true) {
QString name = tr(fdd_getname(i)); QString name = tr(fdd_getname(i));
if (name.isEmpty()) { if (name.isEmpty())
break; break;
}
Models::AddEntry(model, name, i); Models::AddEntry(model, name, i);
++i; ++i;
@@ -139,26 +137,27 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
ui->tableViewFloppy->resizeColumnsToContents(); ui->tableViewFloppy->resizeColumnsToContents();
ui->tableViewFloppy->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tableViewFloppy->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(ui->tableViewFloppy->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsFloppyCDROM::onFloppyRowChanged); connect(ui->tableViewFloppy->selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &SettingsFloppyCDROM::onFloppyRowChanged);
ui->tableViewFloppy->setCurrentIndex(model->index(0, 0)); ui->tableViewFloppy->setCurrentIndex(model->index(0, 0));
Harddrives::populateRemovableBuses(ui->comboBoxBus->model()); Harddrives::populateRemovableBuses(ui->comboBoxBus->model());
model = ui->comboBoxSpeed->model(); model = ui->comboBoxSpeed->model();
for (int i = 0; i < 72; i++) { for (int i = 0; i < 72; i++)
Models::AddEntry(model, QString("%1x").arg(i + 1), i + 1); Models::AddEntry(model, QString("%1x").arg(i + 1), i + 1);
}
#if 0
model = ui->comboBoxCDROMType->model(); model = ui->comboBoxCDROMType->model();
i = 0; i = 0;
while (true) { while (true) {
QString name = tr(cdrom_getname(i)); QString name = tr(cdrom_getname(i));
if (name.isEmpty()) { if (name.isEmpty())
break; break;
}
Models::AddEntry(model, name, i); Models::AddEntry(model, name, i);
++i; ++i;
} }
#endif
model = new QStandardItemModel(0, 3, this); model = new QStandardItemModel(0, 3, this);
ui->tableViewCDROM->setModel(model); ui->tableViewCDROM->setModel(model);
@@ -175,15 +174,43 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
if (cdrom[i].bus_type == CDROM_BUS_ATAPI) if (cdrom[i].bus_type == CDROM_BUS_ATAPI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].ide_channel); Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].ide_channel);
else if (cdrom[i].bus_type == CDROM_BUS_SCSI) else if (cdrom[i].bus_type == CDROM_BUS_SCSI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, cdrom[i].scsi_device_id); Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type,
cdrom[i].scsi_device_id);
else if (cdrom[i].bus_type == CDROM_BUS_MITSUMI) else if (cdrom[i].bus_type == CDROM_BUS_MITSUMI)
Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, 0); Harddrives::busTrackClass->device_track(1, DEV_CDROM, cdrom[i].bus_type, 0);
} }
ui->tableViewCDROM->resizeColumnsToContents(); ui->tableViewCDROM->resizeColumnsToContents();
ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tableViewCDROM->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(ui->tableViewCDROM->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &SettingsFloppyCDROM::onCDROMRowChanged); connect(ui->tableViewCDROM->selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &SettingsFloppyCDROM::onCDROMRowChanged);
ui->tableViewCDROM->setCurrentIndex(model->index(0, 0)); ui->tableViewCDROM->setCurrentIndex(model->index(0, 0));
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
auto *modelType = ui->comboBoxCDROMType->model();
int removeRows = modelType->rowCount();
int j = 0;
int selectedTypeRow = 0;
int eligibleRows = 0;
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
if (((bus_type == CDROM_BUS_ATAPI) || (bus_type == CDROM_BUS_SCSI)) &&
((cdrom_drive_types[j].bus_type == bus_type) ||
(cdrom_drive_types[j].bus_type == BUS_TYPE_BOTH))) {
QString name = tr(cdrom_getname(j));
Models::AddEntry(modelType, name, j);
if ((cdrom[cdromIdx].bus_type == bus_type) && (cdrom[cdromIdx].type == j))
selectedTypeRow = eligibleRows;
++eligibleRows;
}
++j;
}
modelType->removeRows(0, removeRows);
ui->comboBoxCDROMType->setEnabled(eligibleRows > 1);
ui->comboBoxCDROMType->setCurrentIndex(-1);
ui->comboBoxCDROMType->setCurrentIndex(selectedTypeRow);
} }
SettingsFloppyCDROM::~SettingsFloppyCDROM() SettingsFloppyCDROM::~SettingsFloppyCDROM()
@@ -239,15 +266,13 @@ SettingsFloppyCDROM::onCDROMRowChanged(const QModelIndex &current)
ui->comboBoxBus->setCurrentIndex(-1); ui->comboBoxBus->setCurrentIndex(-1);
auto* model = ui->comboBoxBus->model(); auto* model = ui->comboBoxBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus); auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (! match.isEmpty()) { if (! match.isEmpty())
ui->comboBoxBus->setCurrentIndex(match.first().row()); ui->comboBoxBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxChannel->model(); model = ui->comboBoxChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel); match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) { if (!match.isEmpty())
ui->comboBoxChannel->setCurrentIndex(match.first().row()); ui->comboBoxChannel->setCurrentIndex(match.first().row());
}
ui->comboBoxSpeed->setCurrentIndex(speed == 0 ? 7 : speed - 1); ui->comboBoxSpeed->setCurrentIndex(speed == 0 ? 7 : speed - 1);
ui->comboBoxCDROMType->setCurrentIndex(type); ui->comboBoxCDROMType->setCurrentIndex(type);
@@ -257,29 +282,29 @@ void
SettingsFloppyCDROM::on_checkBoxTurboTimings_stateChanged(int arg1) SettingsFloppyCDROM::on_checkBoxTurboTimings_stateChanged(int arg1)
{ {
auto idx = ui->tableViewFloppy->selectionModel()->currentIndex(); auto idx = ui->tableViewFloppy->selectionModel()->currentIndex();
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(1), arg1 == Qt::Checked ? tr("On") : tr("Off")); ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(1), arg1 == Qt::Checked ?
tr("On") : tr("Off"));
} }
void void
SettingsFloppyCDROM::on_checkBoxCheckBPB_stateChanged(int arg1) SettingsFloppyCDROM::on_checkBoxCheckBPB_stateChanged(int arg1)
{ {
auto idx = ui->tableViewFloppy->selectionModel()->currentIndex(); auto idx = ui->tableViewFloppy->selectionModel()->currentIndex();
ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(2), arg1 == Qt::Checked ? tr("On") : tr("Off")); ui->tableViewFloppy->model()->setData(idx.siblingAtColumn(2), arg1 == Qt::Checked ?
tr("On") : tr("Off"));
} }
void void
SettingsFloppyCDROM::on_comboBoxFloppyType_activated(int index) SettingsFloppyCDROM::on_comboBoxFloppyType_activated(int index)
{ {
setFloppyType(ui->tableViewFloppy->model(), ui->tableViewFloppy->selectionModel()->currentIndex(), index); setFloppyType(ui->tableViewFloppy->model(),
ui->tableViewFloppy->selectionModel()->currentIndex(), index);
} }
void void
SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index) SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
int bus = ui->comboBoxBus->currentData().toInt(); int bus = ui->comboBoxBus->currentData().toInt();
bool enabled = (bus != CDROM_BUS_DISABLED); bool enabled = (bus != CDROM_BUS_DISABLED);
ui->comboBoxChannel->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled); ui->comboBoxChannel->setEnabled((bus == CDROM_BUS_MITSUMI) ? 0 : enabled);
@@ -288,6 +313,7 @@ SettingsFloppyCDROM::on_comboBoxBus_currentIndexChanged(int index)
Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus); Harddrives::populateBusChannels(ui->comboBoxChannel->model(), bus);
} }
}
void void
SettingsFloppyCDROM::on_comboBoxSpeed_activated(int index) SettingsFloppyCDROM::on_comboBoxSpeed_activated(int index)
@@ -301,8 +327,11 @@ SettingsFloppyCDROM::on_comboBoxBus_activated(int)
{ {
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
uint8_t bus_type = ui->comboBoxBus->currentData().toUInt(); uint8_t bus_type = ui->comboBoxBus->currentData().toUInt();
int cdromIdx = ui->tableViewCDROM->selectionModel()->currentIndex().data().toInt();
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
if (bus_type == CDROM_BUS_ATAPI) if (bus_type == CDROM_BUS_ATAPI)
ui->comboBoxChannel->setCurrentIndex(Harddrives::busTrackClass->next_free_ide_channel()); ui->comboBoxChannel->setCurrentIndex(Harddrives::busTrackClass->next_free_ide_channel());
else if (bus_type == CDROM_BUS_SCSI) else if (bus_type == CDROM_BUS_SCSI)
@@ -310,36 +339,62 @@ SettingsFloppyCDROM::on_comboBoxBus_activated(int)
else if (bus_type == CDROM_BUS_MITSUMI) else if (bus_type == CDROM_BUS_MITSUMI)
ui->comboBoxChannel->setCurrentIndex(0); ui->comboBoxChannel->setCurrentIndex(0);
setCDROMBus( setCDROMBus(ui->tableViewCDROM->model(),
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(), ui->tableViewCDROM->selectionModel()->currentIndex(),
bus_type, bus_type,
ui->comboBoxChannel->currentData().toUInt()); ui->comboBoxChannel->currentData().toUInt());
setCDROMType( Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
ui->tableViewCDROM->model(), Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
auto *modelType = ui->comboBoxCDROMType->model();
int removeRows = modelType->rowCount();
int j = 0;
int selectedTypeRow = 0;
int eligibleRows = 0;
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
if (((bus_type == CDROM_BUS_ATAPI) || (bus_type == CDROM_BUS_SCSI)) &&
((cdrom_drive_types[j].bus_type == bus_type) ||
(cdrom_drive_types[j].bus_type == BUS_TYPE_BOTH))) {
QString name = tr(cdrom_getname(j));
Models::AddEntry(modelType, name, j);
if ((cdrom[cdromIdx].bus_type == bus_type) && (cdrom[cdromIdx].type == j))
selectedTypeRow = eligibleRows;
++eligibleRows;
}
++j;
}
modelType->removeRows(0, removeRows);
ui->comboBoxCDROMType->setEnabled(eligibleRows > 1);
ui->comboBoxCDROMType->setCurrentIndex(-1);
ui->comboBoxCDROMType->setCurrentIndex(selectedTypeRow);
setCDROMType(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(), ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt()); ui->comboBoxCDROMType->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt());
} }
void void
SettingsFloppyCDROM::on_comboBoxChannel_activated(int) SettingsFloppyCDROM::on_comboBoxChannel_activated(int)
{ {
auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewCDROM->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
setCDROMBus( Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
ui->tableViewCDROM->model(), Qt::UserRole + 1).toInt());
setCDROMBus(ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(), ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxBus->currentData().toUInt(), ui->comboBoxBus->currentData().toUInt(),
ui->comboBoxChannel->currentData().toUInt()); ui->comboBoxChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i, Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(1, DEV_CDROM, ui->tableViewCDROM->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewCDROM->model()->data(i,
Qt::UserRole + 1).toInt());
} }
void void
SettingsFloppyCDROM::on_comboBoxCDROMType_activated(int) SettingsFloppyCDROM::on_comboBoxCDROMType_activated(int)
{ {
setCDROMType( setCDROMType(ui->tableViewCDROM->model(),
ui->tableViewCDROM->model(),
ui->tableViewCDROM->selectionModel()->currentIndex(), ui->tableViewCDROM->selectionModel()->currentIndex(),
ui->comboBoxCDROMType->currentData().toUInt()); ui->comboBoxCDROMType->currentData().toUInt());
ui->tableViewCDROM->resizeColumnsToContents(); ui->tableViewCDROM->resizeColumnsToContents();

View File

@@ -72,6 +72,21 @@ SettingsMachine::SettingsMachine(QWidget *parent)
waitStatesModel->setData(idx, i + 1, Qt::UserRole); waitStatesModel->setData(idx, i + 1, Qt::UserRole);
} }
auto *pitModeModel = ui->comboBoxPitMode->model();
pitModeModel->insertRows(0, 3);
idx = pitModeModel->index(0, 0);
pitModeModel->setData(idx, tr("Auto"), Qt::DisplayRole);
pitModeModel->setData(idx, -1, Qt::UserRole);
idx = pitModeModel->index(1, 0);
pitModeModel->setData(idx, tr("Slow"), Qt::DisplayRole);
pitModeModel->setData(idx, 0, Qt::UserRole);
idx = pitModeModel->index(2, 0);
pitModeModel->setData(idx, tr("Fast"), Qt::DisplayRole);
pitModeModel->setData(idx, 1, Qt::UserRole);
ui->comboBoxPitMode->setCurrentIndex(-1);
ui->comboBoxPitMode->setCurrentIndex(pit_mode + 1);
int selectedMachineType = 0; int selectedMachineType = 0;
auto *machineTypesModel = ui->comboBoxMachineType->model(); auto *machineTypesModel = ui->comboBoxMachineType->model();
for (int i = 1; i < MACHINE_TYPE_MAX; ++i) { for (int i = 1; i < MACHINE_TYPE_MAX; ++i) {
@@ -79,9 +94,8 @@ SettingsMachine::SettingsMachine(QWidget *parent)
while (machine_get_internal_name_ex(j) != nullptr) { while (machine_get_internal_name_ex(j) != nullptr) {
if (machine_available(j) && (machine_get_type(j) == i)) { if (machine_available(j) && (machine_get_type(j) == i)) {
int row = Models::AddEntry(machineTypesModel, machine_types[i].name, machine_types[i].id); int row = Models::AddEntry(machineTypesModel, machine_types[i].name, machine_types[i].id);
if (machine_types[i].id == machine_get_type(machine)) { if (machine_types[i].id == machine_get_type(machine))
selectedMachineType = row; selectedMachineType = row;
}
break; break;
} }
j++; j++;
@@ -113,68 +127,60 @@ SettingsMachine::save()
fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0; fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0;
int64_t temp_mem_size; int64_t temp_mem_size;
if (machine_get_ram_granularity(machine) < 1024) { if (machine_get_ram_granularity(machine) < 1024)
temp_mem_size = ui->spinBoxRAM->value(); temp_mem_size = ui->spinBoxRAM->value();
} else { else
temp_mem_size = ui->spinBoxRAM->value() * 1024; temp_mem_size = ui->spinBoxRAM->value() * 1024;
}
temp_mem_size &= ~(machine_get_ram_granularity(machine) - 1); temp_mem_size &= ~(machine_get_ram_granularity(machine) - 1);
if (temp_mem_size < machine_get_min_ram(machine)) { if (temp_mem_size < machine_get_min_ram(machine))
temp_mem_size = machine_get_min_ram(machine); temp_mem_size = machine_get_min_ram(machine);
} else if (temp_mem_size > machine_get_max_ram(machine)) { else if (temp_mem_size > machine_get_max_ram(machine))
temp_mem_size = machine_get_max_ram(machine); temp_mem_size = machine_get_max_ram(machine);
}
mem_size = static_cast<uint32_t>(temp_mem_size); mem_size = static_cast<uint32_t>(temp_mem_size);
if (ui->comboBoxWaitStates->isEnabled()) { if (ui->comboBoxWaitStates->isEnabled())
cpu_waitstates = ui->comboBoxWaitStates->currentData().toInt(); cpu_waitstates = ui->comboBoxWaitStates->currentData().toInt();
} else { else
cpu_waitstates = 0; cpu_waitstates = 0;
}
pit_mode = ui->comboBoxPitMode->currentData().toInt();
time_sync = 0; time_sync = 0;
if (ui->radioButtonLocalTime->isChecked()) { if (ui->radioButtonLocalTime->isChecked())
time_sync = TIME_SYNC_ENABLED; time_sync = TIME_SYNC_ENABLED;
} if (ui->radioButtonUTC->isChecked())
if (ui->radioButtonUTC->isChecked()) {
time_sync = TIME_SYNC_ENABLED | TIME_SYNC_UTC; time_sync = TIME_SYNC_ENABLED | TIME_SYNC_UTC;
} }
}
void void
SettingsMachine::on_comboBoxMachineType_currentIndexChanged(int index) SettingsMachine::on_comboBoxMachineType_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
auto *model = ui->comboBoxMachine->model(); auto *model = ui->comboBoxMachine->model();
int removeRows = model->rowCount(); int removeRows = model->rowCount();
int selectedMachineRow = 0; int selectedMachineRow = 0;
for (int i = 0; i < machine_count(); ++i) { for (int i = 0; i < machine_count(); ++i) {
if ((machine_get_type(i) == ui->comboBoxMachineType->currentData().toInt()) && machine_available(i)) { if ((machine_get_type(i) == ui->comboBoxMachineType->currentData().toInt()) &&
machine_available(i)) {
int row = Models::AddEntry(model, machines[i].name, i); int row = Models::AddEntry(model, machines[i].name, i);
if (i == machine) { if (i == machine)
selectedMachineRow = row - removeRows; selectedMachineRow = row - removeRows;
} }
} }
}
model->removeRows(0, removeRows); model->removeRows(0, removeRows);
ui->comboBoxMachine->setCurrentIndex(-1); ui->comboBoxMachine->setCurrentIndex(-1);
ui->comboBoxMachine->setCurrentIndex(selectedMachineRow); ui->comboBoxMachine->setCurrentIndex(selectedMachineRow);
} }
}
void void
SettingsMachine::on_comboBoxMachine_currentIndexChanged(int index) SettingsMachine::on_comboBoxMachine_currentIndexChanged(int index)
{ {
// win_settings_machine_recalc_machine // win_settings_machine_recalc_machine
if (index < 0) { if (index >= 0) {
return;
}
int machineId = ui->comboBoxMachine->currentData().toInt(); int machineId = ui->comboBoxMachine->currentData().toInt();
const auto *device = machine_get_device(machineId); const auto *device = machine_get_device(machineId);
ui->pushButtonConfigure->setEnabled((device != nullptr) && (device->config != nullptr)); ui->pushButtonConfigure->setEnabled((device != nullptr) && (device->config != nullptr));
@@ -187,10 +193,10 @@ SettingsMachine::on_comboBoxMachine_currentIndexChanged(int index)
int selectedCpuFamilyRow = 0; int selectedCpuFamilyRow = 0;
while (cpu_families[i].package != 0) { while (cpu_families[i].package != 0) {
if (cpu_family_is_eligible(&cpu_families[i], machineId)) { if (cpu_family_is_eligible(&cpu_families[i], machineId)) {
Models::AddEntry(modelCpu, QString("%1 %2").arg(cpu_families[i].manufacturer, cpu_families[i].name), i); Models::AddEntry(modelCpu, QString("%1 %2").arg(cpu_families[i].manufacturer,
if (&cpu_families[i] == cpu_f) { cpu_families[i].name), i);
if (&cpu_families[i] == cpu_f)
selectedCpuFamilyRow = eligibleRows; selectedCpuFamilyRow = eligibleRows;
}
++eligibleRows; ++eligibleRows;
} }
++i; ++i;
@@ -216,14 +222,12 @@ SettingsMachine::on_comboBoxMachine_currentIndexChanged(int index)
emit currentMachineChanged(machineId); emit currentMachineChanged(machineId);
} }
}
void void
SettingsMachine::on_comboBoxCPU_currentIndexChanged(int index) SettingsMachine::on_comboBoxCPU_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
int machineId = ui->comboBoxMachine->currentData().toInt(); int machineId = ui->comboBoxMachine->currentData().toInt();
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt(); int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId]; const auto *cpuFamily = &cpu_families[cpuFamilyId];
@@ -238,9 +242,8 @@ SettingsMachine::on_comboBoxCPU_currentIndexChanged(int index)
while (cpuFamily->cpus[i].cpu_type != 0) { while (cpuFamily->cpus[i].cpu_type != 0) {
if (cpu_is_eligible(cpuFamily, i, machineId)) { if (cpu_is_eligible(cpuFamily, i, machineId)) {
Models::AddEntry(modelSpeed, QString("%1").arg(cpuFamily->cpus[i].name), i); Models::AddEntry(modelSpeed, QString("%1").arg(cpuFamily->cpus[i].name), i);
if (cpu == i) { if (cpu == i)
selectedSpeedRow = eligibleRows; selectedSpeedRow = eligibleRows;
}
++eligibleRows; ++eligibleRows;
} }
++i; ++i;
@@ -250,14 +253,12 @@ SettingsMachine::on_comboBoxCPU_currentIndexChanged(int index)
ui->comboBoxSpeed->setCurrentIndex(-1); ui->comboBoxSpeed->setCurrentIndex(-1);
ui->comboBoxSpeed->setCurrentIndex(selectedSpeedRow); ui->comboBoxSpeed->setCurrentIndex(selectedSpeedRow);
} }
}
void void
SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index) SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
// win_settings_machine_recalc_cpu // win_settings_machine_recalc_cpu
int cpuFamilyId = ui->comboBoxCPU->currentData().toInt(); int cpuFamilyId = ui->comboBoxCPU->currentData().toInt();
const auto *cpuFamily = &cpu_families[cpuFamilyId]; const auto *cpuFamily = &cpu_families[cpuFamilyId];
@@ -293,22 +294,24 @@ SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index)
int i = 0; int i = 0;
int selectedFpuRow = 0; int selectedFpuRow = 0;
for (const char *fpuName = fpu_get_name_from_index(cpuFamily, cpuId, i); fpuName != nullptr; fpuName = fpu_get_name_from_index(cpuFamily, cpuId, ++i)) { for (const char *fpuName = fpu_get_name_from_index(cpuFamily, cpuId, i);
fpuName != nullptr; fpuName = fpu_get_name_from_index(cpuFamily, cpuId, ++i)) {
auto fpuType = fpu_get_type_from_index(cpuFamily, cpuId, i); auto fpuType = fpu_get_type_from_index(cpuFamily, cpuId, i);
Models::AddEntry(modelFpu, QString("%1").arg(fpuName), fpuType); Models::AddEntry(modelFpu, QString("%1").arg(fpuName), fpuType);
if (fpu_type == fpuType) { if (fpu_type == fpuType)
selectedFpuRow = i; selectedFpuRow = i;
} }
}
modelFpu->removeRows(0, removeRows); modelFpu->removeRows(0, removeRows);
ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1); ui->comboBoxFPU->setEnabled(modelFpu->rowCount() > 1);
ui->comboBoxFPU->setCurrentIndex(-1); ui->comboBoxFPU->setCurrentIndex(-1);
ui->comboBoxFPU->setCurrentIndex(selectedFpuRow); ui->comboBoxFPU->setCurrentIndex(selectedFpuRow);
ui->checkBoxFPUSoftfloat->setChecked(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? true : fpu_softfloat); ui->checkBoxFPUSoftfloat->setChecked(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ?
ui->checkBoxFPUSoftfloat->setEnabled(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ? false : true); true : fpu_softfloat);
ui->checkBoxFPUSoftfloat->setEnabled(machine_has_flags(machineId, MACHINE_SOFTFLOAT_ONLY) ?
false : true);
}
} }
void void

View File

@@ -41,6 +41,192 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>CPU type:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxCPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Speed:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSpeed">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="1">
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxFPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Wait states:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxWaitStates">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>PIT mode:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="comboBoxPitMode">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxRAM">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxMachineType"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>FPU:</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
@@ -48,9 +234,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxMachineType"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
@@ -92,16 +275,12 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0"> </layout>
<widget class="QLabel" name="label_3">
<property name="text">
<string>CPU type:</string>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item>
<widget class="QWidget" name="widget_2" native="true"> <widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@@ -114,79 +293,6 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QComboBox" name="comboBoxCPU">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Speed:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxSpeed">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>FPU:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxFPU"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Wait states:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxWaitStates"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBoxRAM">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDynamicRecompiler"> <widget class="QCheckBox" name="checkBoxDynamicRecompiler">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -209,10 +315,13 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Softfloat FPU</string> <string>SoftFloat FPU</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy"> <property name="sizePolicy">

View File

@@ -36,7 +36,8 @@ extern "C" {
static QString static QString
moDriveTypeName(int i) 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);
} }
static void static void
@@ -64,11 +65,10 @@ static void
setMOType(QAbstractItemModel *model, const QModelIndex &idx, uint32_t type) setMOType(QAbstractItemModel *model, const QModelIndex &idx, uint32_t type)
{ {
auto i = idx.siblingAtColumn(1); auto i = idx.siblingAtColumn(1);
if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == MO_BUS_DISABLED) { if (idx.siblingAtColumn(0).data(Qt::UserRole).toUInt() == MO_BUS_DISABLED)
model->setData(i, QCoreApplication::translate("", "None")); model->setData(i, QCoreApplication::translate("", "None"));
} else { else
model->setData(i, moDriveTypeName(type)); model->setData(i, moDriveTypeName(type));
}
model->setData(i, type, Qt::UserRole); model->setData(i, type, Qt::UserRole);
} }
@@ -187,15 +187,13 @@ SettingsOtherRemovable::onMORowChanged(const QModelIndex &current)
ui->comboBoxMOBus->setCurrentIndex(-1); ui->comboBoxMOBus->setCurrentIndex(-1);
auto *model = ui->comboBoxMOBus->model(); auto *model = ui->comboBoxMOBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus); auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (!match.isEmpty()) { if (!match.isEmpty())
ui->comboBoxMOBus->setCurrentIndex(match.first().row()); ui->comboBoxMOBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxMOChannel->model(); model = ui->comboBoxMOChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel); match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) { if (!match.isEmpty())
ui->comboBoxMOChannel->setCurrentIndex(match.first().row()); ui->comboBoxMOChannel->setCurrentIndex(match.first().row());
}
ui->comboBoxMOType->setCurrentIndex(type); ui->comboBoxMOType->setCurrentIndex(type);
} }
@@ -209,71 +207,73 @@ SettingsOtherRemovable::onZIPRowChanged(const QModelIndex &current)
ui->comboBoxZIPBus->setCurrentIndex(-1); ui->comboBoxZIPBus->setCurrentIndex(-1);
auto *model = ui->comboBoxZIPBus->model(); auto *model = ui->comboBoxZIPBus->model();
auto match = model->match(model->index(0, 0), Qt::UserRole, bus); auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
if (!match.isEmpty()) { if (!match.isEmpty())
ui->comboBoxZIPBus->setCurrentIndex(match.first().row()); ui->comboBoxZIPBus->setCurrentIndex(match.first().row());
}
model = ui->comboBoxZIPChannel->model(); model = ui->comboBoxZIPChannel->model();
match = model->match(model->index(0, 0), Qt::UserRole, channel); match = model->match(model->index(0, 0), Qt::UserRole, channel);
if (!match.isEmpty()) { if (!match.isEmpty())
ui->comboBoxZIPChannel->setCurrentIndex(match.first().row()); ui->comboBoxZIPChannel->setCurrentIndex(match.first().row());
}
ui->checkBoxZIP250->setChecked(is250); ui->checkBoxZIP250->setChecked(is250);
} }
void void
SettingsOtherRemovable::on_comboBoxMOBus_currentIndexChanged(int index) SettingsOtherRemovable::on_comboBoxMOBus_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
int bus = ui->comboBoxMOBus->currentData().toInt(); int bus = ui->comboBoxMOBus->currentData().toInt();
bool enabled = (bus != MO_BUS_DISABLED); bool enabled = (bus != MO_BUS_DISABLED);
ui->comboBoxMOChannel->setEnabled(enabled); ui->comboBoxMOChannel->setEnabled(enabled);
ui->comboBoxMOType->setEnabled(enabled); ui->comboBoxMOType->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxMOChannel->model(), bus); Harddrives::populateBusChannels(ui->comboBoxMOChannel->model(), bus);
} }
}
void void
SettingsOtherRemovable::on_comboBoxMOBus_activated(int) SettingsOtherRemovable::on_comboBoxMOBus_activated(int)
{ {
auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i,
ui->comboBoxMOChannel->setCurrentIndex(ui->comboBoxMOBus->currentData().toUInt() == MO_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() : Harddrives::busTrackClass->next_free_scsi_id()); Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
ui->comboBoxMOChannel->setCurrentIndex(ui->comboBoxMOBus->currentData().toUInt() ==
MO_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() :
Harddrives::busTrackClass->next_free_scsi_id());
ui->tableViewMO->model()->data(i, Qt::UserRole + 1); ui->tableViewMO->model()->data(i, Qt::UserRole + 1);
setMOBus( setMOBus(ui->tableViewMO->model(),
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(), ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(), ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt()); ui->comboBoxMOChannel->currentData().toUInt());
setMOType( setMOType(ui->tableViewMO->model(),
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(), ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt()); ui->comboBoxMOType->currentData().toUInt());
ui->tableViewMO->resizeColumnsToContents(); ui->tableViewMO->resizeColumnsToContents();
ui->tableViewMO->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); ui->tableViewMO->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
} }
void void
SettingsOtherRemovable::on_comboBoxMOChannel_activated(int) SettingsOtherRemovable::on_comboBoxMOChannel_activated(int)
{ {
auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewMO->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_MO, ui->tableViewMO->model()->data(i,
setMOBus( Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
ui->tableViewMO->model(), Qt::UserRole + 1).toInt());
setMOBus(ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(), ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOBus->currentData().toUInt(), ui->comboBoxMOBus->currentData().toUInt(),
ui->comboBoxMOChannel->currentData().toUInt()); ui->comboBoxMOChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i, Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(1, DEV_MO, ui->tableViewMO->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewMO->model()->data(i,
Qt::UserRole + 1).toInt());
} }
void void
SettingsOtherRemovable::on_comboBoxMOType_activated(int) SettingsOtherRemovable::on_comboBoxMOType_activated(int)
{ {
setMOType( setMOType(ui->tableViewMO->model(),
ui->tableViewMO->model(),
ui->tableViewMO->selectionModel()->currentIndex(), ui->tableViewMO->selectionModel()->currentIndex(),
ui->comboBoxMOType->currentData().toUInt()); ui->comboBoxMOType->currentData().toUInt());
ui->tableViewMO->resizeColumnsToContents(); ui->tableViewMO->resizeColumnsToContents();
@@ -283,49 +283,54 @@ SettingsOtherRemovable::on_comboBoxMOType_activated(int)
void void
SettingsOtherRemovable::on_comboBoxZIPBus_currentIndexChanged(int index) SettingsOtherRemovable::on_comboBoxZIPBus_currentIndexChanged(int index)
{ {
if (index < 0) { if (index >= 0) {
return;
}
int bus = ui->comboBoxZIPBus->currentData().toInt(); int bus = ui->comboBoxZIPBus->currentData().toInt();
bool enabled = (bus != ZIP_BUS_DISABLED); bool enabled = (bus != ZIP_BUS_DISABLED);
ui->comboBoxZIPChannel->setEnabled(enabled); ui->comboBoxZIPChannel->setEnabled(enabled);
ui->checkBoxZIP250->setEnabled(enabled); ui->checkBoxZIP250->setEnabled(enabled);
Harddrives::populateBusChannels(ui->comboBoxZIPChannel->model(), bus); Harddrives::populateBusChannels(ui->comboBoxZIPChannel->model(), bus);
} }
}
void void
SettingsOtherRemovable::on_comboBoxZIPBus_activated(int) SettingsOtherRemovable::on_comboBoxZIPBus_activated(int)
{ {
auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i,
ui->comboBoxZIPChannel->setCurrentIndex(ui->comboBoxZIPBus->currentData().toUInt() == ZIP_BUS_ATAPI ? Harddrives::busTrackClass->next_free_ide_channel() : Harddrives::busTrackClass->next_free_scsi_id()); Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
setZIPBus( Qt::UserRole + 1).toInt());
ui->tableViewZIP->model(), ui->comboBoxZIPChannel->setCurrentIndex(ui->comboBoxZIPBus->currentData().toUInt() == ZIP_BUS_ATAPI ?
Harddrives::busTrackClass->next_free_ide_channel() :
Harddrives::busTrackClass->next_free_scsi_id());
setZIPBus(ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(), ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(), ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt()); ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
Qt::UserRole + 1).toInt());
} }
void void
SettingsOtherRemovable::on_comboBoxZIPChannel_activated(int) SettingsOtherRemovable::on_comboBoxZIPChannel_activated(int)
{ {
auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0); auto i = ui->tableViewZIP->selectionModel()->currentIndex().siblingAtColumn(0);
Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(0, DEV_ZIP, ui->tableViewZIP->model()->data(i,
setZIPBus( Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i,
ui->tableViewZIP->model(), Qt::UserRole + 1).toInt());
setZIPBus(ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(), ui->tableViewZIP->selectionModel()->currentIndex(),
ui->comboBoxZIPBus->currentData().toUInt(), ui->comboBoxZIPBus->currentData().toUInt(),
ui->comboBoxZIPChannel->currentData().toUInt()); ui->comboBoxZIPChannel->currentData().toUInt());
Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i, Qt::UserRole).toInt(), ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt()); Harddrives::busTrackClass->device_track(1, DEV_ZIP, ui->tableViewZIP->model()->data(i,
Qt::UserRole).toInt(),
ui->tableViewZIP->model()->data(i, Qt::UserRole + 1).toInt());
} }
void void
SettingsOtherRemovable::on_checkBoxZIP250_stateChanged(int state) SettingsOtherRemovable::on_checkBoxZIP250_stateChanged(int state)
{ {
setZIPType( setZIPType(ui->tableViewZIP->model(),
ui->tableViewZIP->model(),
ui->tableViewZIP->selectionModel()->currentIndex(), ui->tableViewZIP->selectionModel()->currentIndex(),
state == Qt::Checked); state == Qt::Checked);
} }