[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [artikulate] src: Create new config dialog for sound devices.
From: Andreas Cord-Landwehr <cordlandwehr () kde ! org>
Date: 2013-05-25 11:52:24
Message-ID: 20130525115224.76055A605B () git ! kde ! org
[Download RAW message or body]
Git commit 42a443a4e23c72d9e5f97501573b0de2d0df820e by Andreas Cord-Landwehr.
Committed on 23/05/2013 at 20:17.
Pushed by cordlandwehr into branch 'master'.
Create new config dialog for sound devices.
Not connected to anything yet.
M +6 -2 src/CMakeLists.txt
M +11 -2 src/mainwindow.cpp
M +1 -0 src/mainwindow.h
A +43 -0 src/ui/sounddevicedialog.cpp [License: GPL (v2/3)]
A +40 -0 src/ui/sounddevicedialog.h [License: GPL (v2/3)]
A +191 -0 src/ui/sounddevicedialog.ui
http://commits.kde.org/artikulate/42a443a4e23c72d9e5f97501573b0de2d0df820e
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 13e1f60..25bf0b4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -56,8 +56,7 @@ set(artikulateCore_SRCS
ui/newcoursedialog.cpp
)
kde4_add_ui_files(artikulateCore_SRCS
- ui/newcoursedialog.ui
- ui/resourcesdialog.ui
+ ui/sounddevicedialog.ui
)
kde4_add_kcfg_files(artikulateCore_SRCS settings.kcfgc)
kde4_add_library(artikulatecore SHARED ${artikulateCore_SRCS})
@@ -96,10 +95,15 @@ set(artikulate_SRCS
models/phonemeunitmodel.cpp
models/skeletonmodel.cpp
+ ui/sounddevicedialog.cpp
ui/resourcesdialog.cpp
declarativeitems/applicationbackground.cpp
)
+kde4_add_ui_files(artikulate_SRCS
+ ui/resourcesdialog.ui
+ ui/sounddevicedialog.ui
+)
kde4_add_kcfg_files(artikulate_SRCS settings.kcfgc)
kde4_add_executable(artikulate ${artikulate_SRCS})
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 63627c1..bd00058 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -20,6 +20,7 @@
#include "mainwindow.h"
#include "ui/resourcesdialog.h"
+#include "ui/sounddevicedialog.h"
#include "core/resourcemanager.h"
#include "core/profile.h"
#include "models/languagemodel.h"
@@ -75,12 +76,15 @@ MainWindow::MainWindow()
m_actionCollection->addAction("editor", editorAction);
m_menu->addAction(editorAction);
- KAction *settingsAction = new KAction(i18n("Settings"), this);
+ KAction *settingsAction = new KAction(i18n("Course Settings"), this);
connect(settingsAction, SIGNAL(triggered()), SLOT(showSettingsDialog()));
m_actionCollection->addAction("settings", settingsAction);
m_menu->addAction(settingsAction);
-
+ KAction *settingsSoundAction = new KAction(i18n("Sound Settings"), this);
+ connect(settingsSoundAction, SIGNAL(triggered()), SLOT(showSettingsSoundDialog()));
+ m_actionCollection->addAction("settingsSound", settingsSoundAction);
+ m_menu->addAction(settingsSoundAction);
m_menu->addSeparator();
@@ -136,3 +140,8 @@ void MainWindow::showSettingsDialog()
dialog->exec();
}
+void MainWindow::showSettingsSoundDialog()
+{
+ QPointer<SoundDeviceDialog> dialog = new SoundDeviceDialog();
+ dialog->exec();
+}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 9a780c0..0532f73 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -60,6 +60,7 @@ public slots:
void showCourseEditor();
void closeCourseEditor();
void showSettingsDialog();
+ void showSettingsSoundDialog();
private:
QDeclarativeView *m_view;
diff --git a/src/ui/sounddevicedialog.cpp b/src/ui/sounddevicedialog.cpp
new file mode 100644
index 0000000..e5a34dc
--- /dev/null
+++ b/src/ui/sounddevicedialog.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
+ *
+ * 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) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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/>.
+ */
+
+#include "sounddevicedialog.h"
+
+#include <KLocale>
+#include <QUuid>
+
+SoundDeviceDialog::SoundDeviceDialog()
+ : KDialog(0)
+{
+ setPlainCaption(i18n("Sound Device Settings"));
+ setButtons(KDialog::Ok | KDialog::Cancel);
+ setDefaultButton(KDialog::Ok);
+
+ QWidget *widget = new QWidget(this);
+ ui = new Ui::SoundDeviceDialog;
+
+ ui->setupUi(widget);
+ setMainWidget(widget);
+}
+
+SoundDeviceDialog::~SoundDeviceDialog()
+{
+ delete ui;
+}
diff --git a/src/ui/sounddevicedialog.h b/src/ui/sounddevicedialog.h
new file mode 100644
index 0000000..8fd9616
--- /dev/null
+++ b/src/ui/sounddevicedialog.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
+ *
+ * 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) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * 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/>.
+ */
+
+#ifndef SOUNDDEVICEDIALOG_H
+#define SOUNDDEVICEDIALOG_H
+
+#include "ui_sounddevicedialog.h"
+#include <KDialog>
+
+class SoundDeviceDialog :
+ public KDialog
+{
+ Q_OBJECT
+
+public:
+ SoundDeviceDialog();
+ ~SoundDeviceDialog();
+
+private:
+ Ui::SoundDeviceDialog *ui;
+};
+
+#endif
diff --git a/src/ui/sounddevicedialog.ui b/src/ui/sounddevicedialog.ui
new file mode 100644
index 0000000..4c75383
--- /dev/null
+++ b/src/ui/sounddevicedialog.ui
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SoundDeviceDialog</class>
+ <widget class="QWidget" name="SoundDeviceDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>325</width>
+ <height>275</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="boxMicrophone">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Microphone</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelInputDevice">
+ <property name="text">
+ <string>Input Device</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KComboBox" name="kcfg_inputDevice">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="labelVolume">
+ <property name="text">
+ <string>Volume</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSlider" name="kcfg_inputVolume">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="boxSpeakers">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Speakers</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="1" column="0">
+ <widget class="QLabel" name="labelOutputDevice">
+ <property name="text">
+ <string>Output Device</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="kcfg_outputDevice">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="labelOutputVolume">
+ <property name="text">
+ <string>Volume</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QSlider" name="kcfg_outputVolume">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="1" column="2">
+ <widget class="QToolButton" name="buttonRecordTestSound">
+ <property name="toolTip">
+ <string>Record test sound.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="labelPlayTestSound">
+ <property name="text">
+ <string>Play Test Sound</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QToolButton" name="buttonPlayTestSound">
+ <property name="toolTip">
+ <string>Play test sound.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="labelRecordTestSound">
+ <property name="text">
+ <string>Record Test Sound</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QToolButton" name="buttonPlayRecordedTestSound">
+ <property name="toolTip">
+ <string>Play recorded test sound.</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="labelTestSoundSettings">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Test Sound Settings</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KComboBox</class>
+ <extends>QComboBox</extends>
+ <header>kcombobox.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic