Permalink
Browse files

Qt/NetPlayDialog: Add splitter

  • Loading branch information...
spycrab committed May 10, 2018
1 parent 6ea2b2e commit 0ee7bddd4f2c4932757c36429b0b2b4cd6972646
Showing with 20 additions and 2 deletions.
  1. +17 −2 Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
  2. +3 −0 Source/Core/DolphinQt2/NetPlay/NetPlayDialog.h
@@ -18,6 +18,7 @@
#include <QProgressDialog>
#include <QPushButton>
#include <QSpinBox>
#include <QSplitter>
#include <QTextBrowser>
#include <sstream>
@@ -52,6 +53,17 @@ NetPlayDialog::NetPlayDialog(QWidget* parent)
CreatePlayersLayout();
CreateMainLayout();
ConnectWidgets();
auto& settings = Settings::Instance().GetQSettings();
m_splitter->restoreState(settings.value(QStringLiteral("netplaydialog/splitter")).toByteArray());
}
NetPlayDialog::~NetPlayDialog()
{
auto& settings = Settings::Instance().GetQSettings();
settings.setValue(QStringLiteral("netplaydialog/splitter"), m_splitter->saveState());
}
void NetPlayDialog::CreateMainLayout()
@@ -66,6 +78,7 @@ void NetPlayDialog::CreateMainLayout()
m_record_input_box = new QCheckBox(tr("Record inputs"));
m_buffer_label = new QLabel(tr("Buffer:"));
m_quit_button = new QPushButton(tr("Quit"));
m_splitter = new QSplitter(Qt::Horizontal);
m_game_button->setDefault(false);
m_game_button->setAutoDefault(false);
@@ -76,8 +89,10 @@ void NetPlayDialog::CreateMainLayout()
m_main_layout->addWidget(m_game_button, 0, 0);
m_main_layout->addWidget(m_md5_box, 0, 1);
m_main_layout->addWidget(m_chat_box, 1, 0);
m_main_layout->addWidget(m_players_box, 1, 1);
m_main_layout->addWidget(m_splitter, 1, 0, 1, -1);
m_splitter->addWidget(m_chat_box);
m_splitter->addWidget(m_players_box);
auto* options_widget = new QHBoxLayout;
@@ -22,13 +22,15 @@ class QLineEdit;
class QListWidget;
class QPushButton;
class QSpinBox;
class QSplitter;
class QTextEdit;
class NetPlayDialog : public QDialog, public NetPlayUI
{
Q_OBJECT
public:
NetPlayDialog(QWidget* parent);
~NetPlayDialog();
void show(std::string nickname, bool use_traversal);
void reject() override;
@@ -97,6 +99,7 @@ class NetPlayDialog : public QDialog, public NetPlayUI
QCheckBox* m_load_wii_box;
QCheckBox* m_record_input_box;
QPushButton* m_quit_button;
QSplitter* m_splitter;
QGridLayout* m_main_layout;
MD5Dialog* m_md5_dialog;

0 comments on commit 0ee7bdd

Please sign in to comment.