You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.0 KiB
82 lines
2.0 KiB
#include "settings-window.hpp"
|
|
|
|
SettingsWindow::SettingsWindow(OBSManager* obs)
|
|
: mBox(Gtk::Orientation::ORIENTATION_VERTICAL, 2),
|
|
mBoxSettings(Gtk::Orientation::ORIENTATION_VERTICAL, 2),
|
|
mBoxPluginDir(Gtk::Orientation::ORIENTATION_HORIZONTAL, 2),
|
|
mLabelPluginDir("Plugin Dir: "),
|
|
mBoxOutputDir(Gtk::Orientation::ORIENTATION_HORIZONTAL, 2),
|
|
mLabelOutputDir("Saved Files Dir: "),
|
|
mButtonClose("Close"),
|
|
mButtonSave("Save")
|
|
{
|
|
set_title("Settings");
|
|
set_default_size(640, 480);
|
|
set_border_width(10);
|
|
set_modal(true);
|
|
set_type_hint(Gdk::WindowTypeHint::WINDOW_TYPE_HINT_DIALOG);
|
|
|
|
signal_key_press_event().connect(
|
|
sigc::mem_fun(*this, &SettingsWindow::onKeyPressed));
|
|
|
|
mButtonClose.signal_clicked().connect(
|
|
sigc::mem_fun(*this, &SettingsWindow::onClosePressed));
|
|
mButtonSave.signal_clicked().connect(
|
|
sigc::mem_fun(*this, &SettingsWindow::onSavePressed));
|
|
|
|
mBoxSettings.set_border_width(10);
|
|
|
|
mEntryPluginDir.set_hexpand(true);
|
|
mEntryPluginDir.set_text(obs->GetPluginDir().c_str());
|
|
|
|
mBoxPluginDir.set_border_width(10);
|
|
mBoxPluginDir.add(mLabelPluginDir);
|
|
mBoxPluginDir.add(mEntryPluginDir);
|
|
|
|
mEntryOutputDir.set_hexpand(true);
|
|
|
|
mBoxOutputDir.set_border_width(10);
|
|
mBoxOutputDir.add(mLabelOutputDir);
|
|
mBoxOutputDir.add(mEntryOutputDir);
|
|
|
|
mBoxSettings.add(mBoxPluginDir);
|
|
mBoxSettings.add(mBoxOutputDir);
|
|
|
|
mFrameSettings.set_label("Settings");
|
|
mFrameSettings.set_border_width(10);
|
|
mFrameSettings.add(mBoxSettings);
|
|
|
|
mActionBar.pack_end(mButtonClose);
|
|
mActionBar.pack_end(mButtonSave);
|
|
|
|
mBox.add(mFrameSettings);
|
|
mBox.add(mActionBar);
|
|
|
|
mBox.show_all();
|
|
add(mBox);
|
|
}
|
|
|
|
SettingsWindow::~SettingsWindow()
|
|
{
|
|
}
|
|
|
|
bool SettingsWindow::onKeyPressed(GdkEventKey *event)
|
|
{
|
|
if (event->keyval == GDK_KEY_Escape)
|
|
{
|
|
close();
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void SettingsWindow::onClosePressed()
|
|
{
|
|
close();
|
|
}
|
|
|
|
void SettingsWindow::onSavePressed()
|
|
{
|
|
}
|
|
|