Merge pull request #7134 from spycrab/qt_housekeep

Qt: Basic housekeeping
This commit is contained in:
spycrab 2018-06-21 14:24:53 +02:00 committed by GitHub
commit 77f6e50493
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 15 deletions

View File

@ -285,6 +285,7 @@ void FilesystemWidget::ExtractDirectory(const DiscIO::Partition& partition, cons
u32 size = info->GetTotalChildren(); u32 size = info->GetTotalChildren();
QProgressDialog* dialog = new QProgressDialog(this); QProgressDialog* dialog = new QProgressDialog(this);
dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog->setMinimum(0); dialog->setMinimum(0);
dialog->setMaximum(size); dialog->setMaximum(size);
dialog->show(); dialog->show();

View File

@ -35,14 +35,8 @@ void GCKeyboardEmu::CreateMainLayout()
CreateGroupBox(QStringLiteral(""), Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb4x))); CreateGroupBox(QStringLiteral(""), Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb4x)));
auto* vbox_layout = new QVBoxLayout(); auto* vbox_layout = new QVBoxLayout();
auto* options_box =
CreateGroupBox(tr("Options"), Keyboard::GetGroup(GetPort(), KeyboardGroup::Options));
options_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
vbox_layout->addWidget( vbox_layout->addWidget(
CreateGroupBox(QStringLiteral(""), Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb5x))); CreateGroupBox(QStringLiteral(""), Keyboard::GetGroup(GetPort(), KeyboardGroup::Kb5x)));
vbox_layout->addWidget(options_box);
m_main_layout->addLayout(vbox_layout); m_main_layout->addLayout(vbox_layout);

View File

@ -13,6 +13,7 @@
#include "Core/HW/GCPadEmu.h" #include "Core/HW/GCPadEmu.h"
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h" #include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
#include "InputCommon/InputConfig.h" #include "InputCommon/InputConfig.h"
GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window) GCPadEmu::GCPadEmu(MappingWindow* window) : MappingWidget(window)
@ -43,10 +44,14 @@ void GCPadEmu::CreateMainLayout()
// TODO: Get rid of this garbage once wx is removed // TODO: Get rid of this garbage once wx is removed
// Remove "Iterative Input" // Remove "Iterative Input"
auto* options_group = Pad::GetGroup(GetPort(), PadGroup::Options); auto* options_group = Pad::GetGroup(GetPort(), PadGroup::Options);
auto& bools = options_group->boolean_settings;
bools.erase(bools.end() - 1);
hbox_layout->addWidget(CreateGroupBox(tr("Options"), options_group)); auto& bools = options_group->boolean_settings;
if (bools.size() > 1 || !options_group->numeric_settings.empty())
{
bools.pop_back();
hbox_layout->addWidget(CreateGroupBox(tr("Options"), options_group));
}
setLayout(m_main_layout); setLayout(m_main_layout);
} }

View File

@ -16,6 +16,7 @@
#include "DolphinQt2/Config/Mapping/WiimoteEmuExtension.h" #include "DolphinQt2/Config/Mapping/WiimoteEmuExtension.h"
#include "InputCommon/ControllerEmu/ControlGroup/Extension.h" #include "InputCommon/ControllerEmu/ControlGroup/Extension.h"
#include "InputCommon/ControllerEmu/Setting/BooleanSetting.h"
#include "InputCommon/InputConfig.h" #include "InputCommon/InputConfig.h"
WiimoteEmuGeneral::WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension* extension) WiimoteEmuGeneral::WiimoteEmuGeneral(MappingWindow* window, WiimoteEmuExtension* extension)
@ -56,8 +57,13 @@ void WiimoteEmuGeneral::CreateMainLayout()
vbox_layout->addWidget(extension); vbox_layout->addWidget(extension);
vbox_layout->addWidget(CreateGroupBox( vbox_layout->addWidget(CreateGroupBox(
tr("Rumble"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Rumble))); tr("Rumble"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Rumble)));
vbox_layout->addWidget(CreateGroupBox(
tr("Options"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Options))); // TODO: Get rid of this garbage once wx is removed
// Remove "Iterative Input"
auto* options_group = Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Options);
options_group->boolean_settings.pop_back();
vbox_layout->addWidget(CreateGroupBox(tr("Options"), options_group));
m_main_layout->addLayout(vbox_layout); m_main_layout->addLayout(vbox_layout);

View File

@ -212,6 +212,10 @@ void GCMemcardManager::UpdateSlotTable(int slot)
table->setItem(i, 5, create_item(block_count)); table->setItem(i, 5, create_item(block_count));
table->resizeRowToContents(i); table->resizeRowToContents(i);
} }
m_slot_stat_label[slot]->setText(tr("%1 Free Blocks; %2 Free Dir Entries")
.arg(memcard->GetFreeBlocks())
.arg(DIRLEN - memcard->GetNumFiles()));
} }
void GCMemcardManager::UpdateActions() void GCMemcardManager::UpdateActions()
@ -236,10 +240,6 @@ void GCMemcardManager::SetSlotFile(int slot, QString path)
if (!memcard->IsValid()) if (!memcard->IsValid())
return; return;
m_slot_stat_label[slot]->setText(tr("%1 Free Blocks; %2 Free Dir Entries")
.arg(memcard->GetFreeBlocks())
.arg(DIRLEN - memcard->GetNumFiles()));
m_slot_file_edit[slot]->setText(path); m_slot_file_edit[slot]->setText(path);
m_slot_memcard[slot] = std::move(memcard); m_slot_memcard[slot] = std::move(memcard);