added name dialog code, moved 'using namespace std;' out of headers and into source files
This commit is contained in:
@@ -43,6 +43,7 @@ endif()
|
||||
add_executable(obs
|
||||
window-basic-main.cpp
|
||||
window-basic-settings.cpp
|
||||
window-namedialog.cpp
|
||||
settings-basic.cpp
|
||||
settings-basic-general.cpp
|
||||
settings-basic-video.cpp
|
||||
|
@@ -15,6 +15,7 @@ obs_PROGRAMS = obs
|
||||
obs_LDADD = $(top_srcdir)/libobs/libobs.la
|
||||
obs_SOURCES = window-basic-main.cpp \
|
||||
window-basic-settings.cpp \
|
||||
window-namedialog.cpp \
|
||||
settings-basic.cpp \
|
||||
settings-basic-general.cpp \
|
||||
settings-basic-video.cpp \
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <sstream>
|
||||
#include "platform.hpp"
|
||||
using namespace std;
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <sstream>
|
||||
#include "platform.hpp"
|
||||
using namespace std;
|
||||
|
||||
#include <util/platform.h>
|
||||
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <sstream>
|
||||
#include "platform.hpp"
|
||||
using namespace std;
|
||||
|
||||
bool GetDataFilePath(const char *data, string &output)
|
||||
{
|
||||
|
@@ -21,7 +21,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
struct MonitorInfo {
|
||||
int32_t x, y;
|
||||
@@ -32,5 +31,5 @@ struct MonitorInfo {
|
||||
};
|
||||
|
||||
/* Gets the path of obs-studio specific data files (such as locale) */
|
||||
bool GetDataFilePath(const char *data, string &path);
|
||||
void GetMonitors(vector<MonitorInfo> &monitors);
|
||||
bool GetDataFilePath(const char *data, std::string &path);
|
||||
void GetMonitors(std::vector<MonitorInfo> &monitors);
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "window-basic-settings.hpp"
|
||||
#include "wx-wrappers.hpp"
|
||||
#include "platform.hpp"
|
||||
using namespace std;
|
||||
|
||||
class BasicGenData : public BasicSettingsData {
|
||||
ConfigFile localeIni;
|
||||
|
@@ -21,9 +21,6 @@
|
||||
|
||||
#include <obs.hpp>
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
class OBSBasic : public OBSBasicBase {
|
||||
void SceneAdded(obs_source_t scene);
|
||||
void SceneRemoved(obs_source_t scene);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <wx/msgdlg.h>
|
||||
#include "window-basic-settings.hpp"
|
||||
using namespace std;
|
||||
|
||||
OBSBasicSettings::OBSBasicSettings(wxWindow *parent)
|
||||
: OBSBasicSettingsBase(parent)
|
||||
|
@@ -21,11 +21,10 @@
|
||||
#include "settings-basic.hpp"
|
||||
|
||||
#include <memory>
|
||||
using namespace std;
|
||||
|
||||
class OBSBasicSettings : public OBSBasicSettingsBase {
|
||||
protected:
|
||||
unique_ptr<BasicSettingsData> settings;
|
||||
std::unique_ptr<BasicSettingsData> settings;
|
||||
|
||||
virtual void PageChanged(wxListbookEvent &event);
|
||||
virtual void PageChanging(wxListbookEvent &event);
|
||||
|
48
obs/window-namedialog.cpp
Normal file
48
obs/window-namedialog.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/******************************************************************************
|
||||
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "window-namedialog.hpp"
|
||||
using namespace std;
|
||||
|
||||
void NameDialog::OnClose(wxCommandEvent &event)
|
||||
{
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
void NameDialog::OKPressed(wxCommandEvent &event)
|
||||
{
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
|
||||
void NameDialog::CancelPressed(wxCommandEvent &event)
|
||||
{
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
int NameDialog::AskForName(wxWindow *parent, const char *title,
|
||||
const char *text, string &str)
|
||||
{
|
||||
NameDialog *dialog = new NameDialog(parent);
|
||||
dialog->SetTitle(wxString(title, wxConvUTF8));
|
||||
dialog->questionText->SetLabel(wxString(text, wxConvUTF8));
|
||||
|
||||
int ret = dialog->ShowModal();
|
||||
str = dialog->nameEdit->GetValue().ToUTF8().data();
|
||||
return ret;
|
||||
}
|
38
obs/window-namedialog.hpp
Normal file
38
obs/window-namedialog.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "forms/OBSWindows.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class NameDialog : public NameDialogBase {
|
||||
protected:
|
||||
virtual void OnClose(wxCommandEvent &event);
|
||||
virtual void OKPressed(wxCommandEvent &event);
|
||||
virtual void CancelPressed(wxCommandEvent &event);
|
||||
|
||||
public:
|
||||
inline NameDialog(wxWindow *parent)
|
||||
: NameDialogBase(parent)
|
||||
{
|
||||
}
|
||||
|
||||
static int AskForName(wxWindow *parent, const char *title,
|
||||
const char *text, std::string &str);
|
||||
};
|
Reference in New Issue
Block a user