Browse Source

Fix/update forms for main and settings window

- Had the wrong names set for the up/down widgets for sources/scenes

- Updated the settings dialog and gave most of the widgets actual object
  names

- Added code for the settings window.  Settings window should now at
  least display.
jp9000 11 years ago
parent
commit
092f36fac4

+ 8 - 8
obs/forms/OBSBasic.ui

@@ -166,8 +166,8 @@
               <addaction name="actionRemoveScene"/>
               <addaction name="actionRemoveScene"/>
               <addaction name="actionSceneProperties"/>
               <addaction name="actionSceneProperties"/>
               <addaction name="separator"/>
               <addaction name="separator"/>
-              <addaction name="actionSceneMoveUp"/>
-              <addaction name="actionSceneMoveDown"/>
+              <addaction name="actionSceneUp"/>
+              <addaction name="actionSceneDown"/>
              </widget>
              </widget>
             </item>
             </item>
            </layout>
            </layout>
@@ -236,8 +236,8 @@
               <addaction name="actionRemoveSource"/>
               <addaction name="actionRemoveSource"/>
               <addaction name="actionSourceProperties"/>
               <addaction name="actionSourceProperties"/>
               <addaction name="separator"/>
               <addaction name="separator"/>
-              <addaction name="actionSourceMoveUp"/>
-              <addaction name="actionSourceMoveDown"/>
+              <addaction name="actionSourceUp"/>
+              <addaction name="actionSourceDown"/>
              </widget>
              </widget>
             </item>
             </item>
            </layout>
            </layout>
@@ -438,7 +438,7 @@
     <string>SourceProperties</string>
     <string>SourceProperties</string>
    </property>
    </property>
   </action>
   </action>
-  <action name="actionSceneMoveUp">
+  <action name="actionSceneUp">
    <property name="icon">
    <property name="icon">
     <iconset resource="obs.qrc">
     <iconset resource="obs.qrc">
      <normaloff>:/res/images/up.ico</normaloff>:/res/images/up.ico</iconset>
      <normaloff>:/res/images/up.ico</normaloff>:/res/images/up.ico</iconset>
@@ -447,7 +447,7 @@
     <string>SceneMoveUp</string>
     <string>SceneMoveUp</string>
    </property>
    </property>
   </action>
   </action>
-  <action name="actionSourceMoveUp">
+  <action name="actionSourceUp">
    <property name="icon">
    <property name="icon">
     <iconset resource="obs.qrc">
     <iconset resource="obs.qrc">
      <normaloff>:/res/images/up.ico</normaloff>:/res/images/up.ico</iconset>
      <normaloff>:/res/images/up.ico</normaloff>:/res/images/up.ico</iconset>
@@ -456,7 +456,7 @@
     <string>SourceMoveUp</string>
     <string>SourceMoveUp</string>
    </property>
    </property>
   </action>
   </action>
-  <action name="actionSceneMoveDown">
+  <action name="actionSceneDown">
    <property name="icon">
    <property name="icon">
     <iconset resource="obs.qrc">
     <iconset resource="obs.qrc">
      <normaloff>:/res/images/down.ico</normaloff>:/res/images/down.ico</iconset>
      <normaloff>:/res/images/down.ico</normaloff>:/res/images/down.ico</iconset>
@@ -465,7 +465,7 @@
     <string>SceneMoveDown</string>
     <string>SceneMoveDown</string>
    </property>
    </property>
   </action>
   </action>
-  <action name="actionSourceMoveDown">
+  <action name="actionSourceDown">
    <property name="icon">
    <property name="icon">
     <iconset resource="obs.qrc">
     <iconset resource="obs.qrc">
      <normaloff>:/res/images/down.ico</normaloff>:/res/images/down.ico</iconset>
      <normaloff>:/res/images/down.ico</normaloff>:/res/images/down.ico</iconset>

+ 116 - 16
obs/forms/OBSBasicSettings.ui

@@ -170,7 +170,7 @@
          <item row="2" column="0">
          <item row="2" column="0">
           <widget class="QLabel" name="label_4">
           <widget class="QLabel" name="label_4">
            <property name="text">
            <property name="text">
-            <string>Aux Audio Device 1:</string>
+            <string>Mic/Aux Audio Device 1:</string>
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
@@ -184,7 +184,7 @@
          <item row="3" column="0">
          <item row="3" column="0">
           <widget class="QLabel" name="label_5">
           <widget class="QLabel" name="label_5">
            <property name="text">
            <property name="text">
-            <string>Aux Audio Device 2:</string>
+            <string>Mic/Aux Audio Device 2:</string>
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
@@ -198,7 +198,7 @@
          <item row="4" column="0">
          <item row="4" column="0">
           <widget class="QLabel" name="label_6">
           <widget class="QLabel" name="label_6">
            <property name="text">
            <property name="text">
-            <string>Aux Audio Device 3:</string>
+            <string>Mic/Aux Audio Device 3:</string>
            </property>
            </property>
           </widget>
           </widget>
          </item>
          </item>
@@ -224,7 +224,7 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="0" column="1">
          <item row="0" column="1">
-          <widget class="QComboBox" name="comboBox_2">
+          <widget class="QComboBox" name="renderer">
            <property name="currentText">
            <property name="currentText">
             <string notr="true"/>
             <string notr="true"/>
            </property>
            </property>
@@ -247,7 +247,10 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="1" column="1">
          <item row="1" column="1">
-          <widget class="QComboBox" name="comboBox">
+          <widget class="QComboBox" name="adapter">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
            <property name="currentText">
            <property name="currentText">
             <string notr="true"/>
             <string notr="true"/>
            </property>
            </property>
@@ -261,7 +264,7 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="2" column="1">
          <item row="2" column="1">
-          <widget class="QComboBox" name="comboBox_3">
+          <widget class="QComboBox" name="baseResolution">
            <property name="editable">
            <property name="editable">
             <bool>true</bool>
             <bool>true</bool>
            </property>
            </property>
@@ -284,7 +287,7 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="3" column="1">
          <item row="3" column="1">
-          <widget class="QComboBox" name="comboBox_4">
+          <widget class="QComboBox" name="outputResolution">
            <property name="editable">
            <property name="editable">
             <bool>true</bool>
             <bool>true</bool>
            </property>
            </property>
@@ -294,7 +297,11 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="4" column="1">
          <item row="4" column="1">
-          <widget class="QComboBox" name="comboBox_5"/>
+          <widget class="QComboBox" name="downscaleFilter">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+          </widget>
          </item>
          </item>
          <item row="4" column="0">
          <item row="4" column="0">
           <widget class="QLabel" name="label_11">
           <widget class="QLabel" name="label_11">
@@ -304,7 +311,7 @@
           </widget>
           </widget>
          </item>
          </item>
          <item row="5" column="0">
          <item row="5" column="0">
-          <widget class="QComboBox" name="comboBox_6">
+          <widget class="QComboBox" name="fpsType">
            <property name="sizePolicy">
            <property name="sizePolicy">
             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <horstretch>0</horstretch>
@@ -312,25 +319,33 @@
             </sizepolicy>
             </sizepolicy>
            </property>
            </property>
            <property name="currentText">
            <property name="currentText">
-            <string>Common FPS</string>
+            <string>FPS (Common)</string>
            </property>
            </property>
            <property name="sizeAdjustPolicy">
            <property name="sizeAdjustPolicy">
             <enum>QComboBox::AdjustToContents</enum>
             <enum>QComboBox::AdjustToContents</enum>
            </property>
            </property>
            <item>
            <item>
             <property name="text">
             <property name="text">
-             <string>Common FPS</string>
+             <string>FPS (Common)</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>FPS (Integer)</string>
             </property>
             </property>
            </item>
            </item>
            <item>
            <item>
             <property name="text">
             <property name="text">
-             <string>Fractional FPS (Advanced)</string>
+             <string>FPS (Fractional)</string>
             </property>
             </property>
            </item>
            </item>
           </widget>
           </widget>
          </item>
          </item>
          <item row="5" column="1">
          <item row="5" column="1">
           <widget class="QStackedWidget" name="stackedWidget">
           <widget class="QStackedWidget" name="stackedWidget">
+           <property name="currentIndex">
+            <number>0</number>
+           </property>
            <widget class="QWidget" name="page">
            <widget class="QWidget" name="page">
             <layout class="QHBoxLayout" name="horizontalLayout_2">
             <layout class="QHBoxLayout" name="horizontalLayout_2">
              <property name="leftMargin">
              <property name="leftMargin">
@@ -346,7 +361,75 @@
               <number>0</number>
               <number>0</number>
              </property>
              </property>
              <item alignment="Qt::AlignTop">
              <item alignment="Qt::AlignTop">
-              <widget class="QComboBox" name="comboBox_7"/>
+              <widget class="QComboBox" name="fpsCommon">
+               <property name="currentText">
+                <string notr="true">30</string>
+               </property>
+               <item>
+                <property name="text">
+                 <string notr="true">10</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">20</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">29.97</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">30</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">48</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">59.94</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string notr="true">60</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+           <widget class="QWidget" name="page_3">
+            <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 alignment="Qt::AlignTop">
+              <widget class="QSpinBox" name="fpsInteger">
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>120</number>
+               </property>
+               <property name="value">
+                <number>30</number>
+               </property>
+              </widget>
              </item>
              </item>
             </layout>
             </layout>
            </widget>
            </widget>
@@ -368,10 +451,27 @@
               <number>0</number>
               <number>0</number>
              </property>
              </property>
              <item row="0" column="1">
              <item row="0" column="1">
-              <widget class="QSpinBox" name="spinBox_2"/>
+              <widget class="QSpinBox" name="fpsNumerator">
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000000</number>
+               </property>
+               <property name="value">
+                <number>30</number>
+               </property>
+              </widget>
              </item>
              </item>
              <item row="1" column="1">
              <item row="1" column="1">
-              <widget class="QSpinBox" name="spinBox"/>
+              <widget class="QSpinBox" name="fpsDenominator">
+               <property name="minimum">
+                <number>1</number>
+               </property>
+               <property name="maximum">
+                <number>1000000</number>
+               </property>
+              </widget>
              </item>
              </item>
              <item row="0" column="0">
              <item row="0" column="0">
               <widget class="QLabel" name="label_12">
               <widget class="QLabel" name="label_12">
@@ -432,7 +532,7 @@
    </hints>
    </hints>
   </connection>
   </connection>
   <connection>
   <connection>
-   <sender>comboBox_6</sender>
+   <sender>fpsType</sender>
    <signal>currentIndexChanged(int)</signal>
    <signal>currentIndexChanged(int)</signal>
    <receiver>stackedWidget</receiver>
    <receiver>stackedWidget</receiver>
    <slot>setCurrentIndex(int)</slot>
    <slot>setCurrentIndex(int)</slot>

+ 3 - 1
obs/window-basic-main.cpp

@@ -20,7 +20,7 @@
 #include <QMessageBox>
 #include <QMessageBox>
 
 
 #include "obs-app.hpp"
 #include "obs-app.hpp"
-//#include "window-basic-settings.hpp"
+#include "window-basic-settings.hpp"
 #include "window-namedialog.hpp"
 #include "window-namedialog.hpp"
 #include "window-basic-main.hpp"
 #include "window-basic-main.hpp"
 #include "qt-wrappers.hpp"
 #include "qt-wrappers.hpp"
@@ -521,4 +521,6 @@ void OBSBasic::on_actionSourceDown_triggered()
 
 
 void OBSBasic::on_settingsButton_clicked()
 void OBSBasic::on_settingsButton_clicked()
 {
 {
+	OBSBasicSettings settings(this);
+	settings.exec();
 }
 }

+ 7 - 70
obs/window-basic-settings.cpp

@@ -15,86 +15,23 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
 
 
-#include <wx/msgdlg.h>
 #include "window-basic-settings.hpp"
 #include "window-basic-settings.hpp"
-using namespace std;
 
 
-OBSBasicSettings::OBSBasicSettings(wxWindow *parent)
-	: OBSBasicSettingsBase(parent)
+OBSBasicSettings::OBSBasicSettings(QWidget *parent)
+	: QDialog (parent),
+	  ui      (new Ui::OBSBasicSettings)
 {
 {
-	unique_ptr<BasicSettingsData> data(CreateBasicGeneralSettings(this));
-	settings = move(data);
+	ui->setupUi(this);
 }
 }
 
 
-void OBSBasicSettings::PageChanged(wxListbookEvent &event)
+void OBSBasicSettings::closeEvent(QCloseEvent *event)
 {
 {
-	wxWindow *curPage = settingsList->GetCurrentPage();
-	if (!curPage)
-		return;
-
-	int id = curPage->GetId();
-
-	BasicSettingsData *ptr = NULL;
-
-	switch (id) {
-	case ID_SETTINGS_GENERAL:
-		ptr = CreateBasicGeneralSettings(this);
-		break;
-	case ID_SETTINGS_VIDEO:
-		ptr = CreateBasicVideoSettings(this);
-		break;
-	}
-
-	settings = move(unique_ptr<BasicSettingsData>(ptr));
-}
-
-bool OBSBasicSettings::ConfirmChanges()
-{
-	if (settings && settings->DataChanged()) {
-		int confirm = wxMessageBox(WXStr("Settings.Confirm"),
-				WXStr("Settings.ConfirmTitle"),
-				wxYES_NO | wxCANCEL);
-
-		if (confirm == wxCANCEL) {
-			return false;
-		} else if (confirm == wxYES) {
-			settings->Apply();
-			return true;
-		}
-	}
-
-	return true;
-}
-
-void OBSBasicSettings::PageChanging(wxListbookEvent &event)
-{
-	if (!ConfirmChanges())
-		event.Veto();
-}
-
-void OBSBasicSettings::OnClose(wxCloseEvent &event)
-{
-	if (!ConfirmChanges())
-		event.Veto();
-	else
-		EndModal(0);
-}
-
-void OBSBasicSettings::OKClicked(wxCommandEvent &event)
-{
-	if (settings && settings->DataChanged())
-		settings->Apply();
-
-	EndModal(0);
 }
 }
 
 
-void OBSBasicSettings::CancelClicked(wxCommandEvent &event)
+void OBSBasicSettings::on_listWidget_currentRowChanged(int row)
 {
 {
-	EndModal(0);
 }
 }
 
 
-void OBSBasicSettings::ApplyClicked(wxCommandEvent &event)
+void OBSBasicSettings::on_buttonBox_clicked(QAbstractButton *button)
 {
 {
-	if (settings && settings->DataChanged())
-		settings->Apply();
 }
 }

+ 15 - 14
obs/window-basic-settings.hpp

@@ -17,25 +17,26 @@
 
 
 #pragma once
 #pragma once
 
 
-#include "forms/OBSWindows.h"
-#include "settings-basic.hpp"
-
+#include <QDialog>
 #include <memory>
 #include <memory>
 
 
-class OBSBasicSettings : public OBSBasicSettingsBase {
-protected:
-	std::unique_ptr<BasicSettingsData> settings;
+class QAbstractButton;
+
+#include "ui_OBSBasicSettings.h"
 
 
-	virtual void PageChanged(wxListbookEvent &event);
-	virtual void PageChanging(wxListbookEvent &event);
-	virtual void OnClose(wxCloseEvent &event);
+class OBSBasicSettings : public QDialog {
+	Q_OBJECT
 
 
-	bool ConfirmChanges();
+private:
+	std::unique_ptr<Ui::OBSBasicSettings> ui;
 
 
-	virtual void OKClicked(wxCommandEvent &event);
-	virtual void CancelClicked(wxCommandEvent &event);
-	virtual void ApplyClicked(wxCommandEvent &event);
+private slots:
+	void on_listWidget_currentRowChanged(int row);
+	void on_buttonBox_clicked(QAbstractButton *button);
+
+protected:
+	virtual void closeEvent(QCloseEvent *event);
 
 
 public:
 public:
-	OBSBasicSettings(wxWindow *parent);
+	OBSBasicSettings(QWidget *parent);
 };
 };