PreferencesDialog: initial draft

Here's an initial draft for the new preferences dialog. The basics of
the GUI are done, however there's absolutely no functionality yet.
This commit is contained in:
Tobias Doerffel
2009-11-14 00:32:54 +01:00
parent b7e73fbe0c
commit 58f53d9f5b
11 changed files with 899 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -12,6 +12,17 @@ automationEditor {
background-color: rgb(0, 0, 0);
}
#PreferencesDialog QListView::item:selected {
background: qlineargradient(x1: 0, y1:0, x2:0,y2:1, stop:0 rgb(84,87,96), stop:1 rgb(54,57,66));
border-radius: 8px;
color: white;
}
#PreferencesDialog QListView::item:hover:!selected {
background: qlineargradient(x1: 0, y1:0, x2:0,y2:1, stop:0 rgb(104,107,116), stop:1 rgb(94,97,106));
border-radius: 8px;
}
#WelcomeFrame {
border: 2px solid rgb(32,32,32);
border-radius: 8px;

View File

@@ -125,6 +125,7 @@ public slots:
bool saveProject();
bool saveProjectAs();
void showSettingsDialog();
void showPreferencesDialog();
void aboutLMMS();
void help();
void toggleAutomationEditorWin();

View File

@@ -0,0 +1,43 @@
/*
* PreferencesDialog.h - declaration of class PreferencesDialog
*
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef _PREFERENCES_DIALOG_H
#define _PREFERENCES_DIALOG_H
#include <QtGui/QDialog>
namespace Ui { class PreferencesDialog; }
class PreferencesDialog : public QDialog
{
public:
PreferencesDialog();
private:
Ui::PreferencesDialog * ui;
} ;
#endif

View File

@@ -0,0 +1,776 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PreferencesDialog</class>
<widget class="QDialog" name="PreferencesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>577</width>
<height>478</height>
</rect>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
<property name="styleSheet">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" rowspan="3">
<widget class="QListWidget" name="configPageSelector">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>101</width>
<height>470</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>101</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">::item { width:87; }
</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="spacing">
<number>4</number>
</property>
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="currentRow">
<number>-1</number>
</property>
<item>
<property name="text">
<string>General</string>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Directories</string>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Audio</string>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>MIDI</string>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
<item>
<property name="text">
<string>Plugins</string>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled</set>
</property>
</item>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QStackedWidget" name="configPages">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="generalSettingsPage">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>16</number>
</property>
<item>
<widget class="QLabel" name="generalTitleLabel">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>General settings</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>User interface</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QCheckBox" name="enableToolTips">
<property name="text">
<string>Enable tooltips</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="showVolumeAsDBV">
<property name="text">
<string>Show volume as dbV</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="showWelcomeScreen">
<property name="text">
<string>Show welcome screen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Online resources</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="horizontalSpacing">
<number>10</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="enableOnlineResourcesCheckBox">
<property name="text">
<string>Enable online resources</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="enableUploadsCheckBox">
<property name="text">
<string>Enable uploads</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Username</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="usernameEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="passwordEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="directorySettingsPage"/>
<widget class="QWidget" name="audioSettingsPage">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>16</number>
</property>
<item>
<widget class="QLabel" name="generalTitleLabel_2">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Audio settings</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>General</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>10</number>
</property>
<property name="horizontalSpacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Buffer size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Sample rate</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="sampleRate">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>44100 Hz</string>
</property>
</item>
<item>
<property name="text">
<string>48000 Hz</string>
</property>
</item>
<item>
<property name="text">
<string>88200 Hz</string>
</property>
</item>
<item>
<property name="text">
<string>96000 Hz</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="bufferSize">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>3</number>
</property>
<item>
<property name="text">
<string>32</string>
</property>
</item>
<item>
<property name="text">
<string>64</string>
</property>
</item>
<item>
<property name="text">
<string>128</string>
</property>
</item>
<item>
<property name="text">
<string>256 (default)</string>
</property>
</item>
<item>
<property name="text">
<string>512</string>
</property>
</item>
<item>
<property name="text">
<string>1024</string>
</property>
</item>
<item>
<property name="text">
<string>2048</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Audio engine</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>10</number>
</property>
<property name="horizontalSpacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Audio engine</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="audioEngine">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Device</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="audioDevice">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="midiSettingsPage">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>16</number>
</property>
<item>
<widget class="QLabel" name="generalTitleLabel_3">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>MIDI settings</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>MIDI engine</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="leftMargin">
<number>10</number>
</property>
<property name="horizontalSpacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>MIDI engine</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="midiEngine">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Device</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="midiDevice">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="midiRemoteControl">
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="title">
<string>MIDI remote control</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="pluginsSettingsPage">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>16</number>
</property>
<item>
<widget class="QLabel" name="generalTitleLabel_4">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Plugins settings</string>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string/>
</attribute>
<layout class="QGridLayout" name="gridLayout_7"/>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PreferencesDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PreferencesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>enableUploadsCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>usernameEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>336</x>
<y>283</y>
</hint>
</hints>
</connection>
<connection>
<sender>enableUploadsCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>passwordEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>336</x>
<y>317</y>
</hint>
</hints>
</connection>
<connection>
<sender>enableOnlineResourcesCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>enableUploadsCheckBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>226</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>253</y>
</hint>
</hints>
</connection>
<connection>
<sender>configPageSelector</sender>
<signal>currentRowChanged(int)</signal>
<receiver>configPages</receiver>
<slot>setCurrentIndex(int)</slot>
<hints>
<hint type="sourcelabel">
<x>54</x>
<y>238</y>
</hint>
<hint type="destinationlabel">
<x>340</x>
<y>224</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -51,6 +51,7 @@
#include "engine.h"
#include "FxMixerView.h"
#include "AboutDialog.h"
#include "PreferencesDialog.h"
#include "ControllerRackView.h"
#include "plugin_browser.h"
#include "SideBar.h"
@@ -257,6 +258,10 @@ void MainWindow::finalize()
edit_menu->addAction( embed::getIconPixmap( "setup_general" ),
tr( "Settings" ),
this, SLOT( showSettingsDialog() ) );
edit_menu->addSeparator();
edit_menu->addAction( embed::getIconPixmap( "setup_general" ),
tr( "Preferences (premature dialog)" ),
this, SLOT( showPreferencesDialog() ) );
m_toolsMenu = new QMenu( this );
@@ -1050,6 +1055,14 @@ void MainWindow::showSettingsDialog()
void MainWindow::showPreferencesDialog()
{
PreferencesDialog().exec();
}
void MainWindow::aboutLMMS()
{
AboutDialog().exec();

View File

@@ -0,0 +1,55 @@
/*
* PreferencesDialog.cpp - implementation of PreferencesDialog
*
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "PreferencesDialog.h"
#include "embed.h"
#include "engine.h"
#include "MainWindow.h"
#include "ui_PreferencesDialog.h"
PreferencesDialog::PreferencesDialog() :
QDialog( engine::mainWindow() ),
ui( new Ui::PreferencesDialog )
{
ui->setupUi( this );
// set up icons in page selector view on the left side
static const char * icons[] = {
"preferences-system",
"folder-64",
"preferences-desktop-sound",
"setup-midi",
"setup-plugins"
} ;
for( int i = 0; i < qMin<int>( sizeof( icons ),
ui->configPageSelector->count() ); ++i )
{
ui->configPageSelector->item( i )->setIcon(
embed::getIconPixmap( icons[i] ) );
}
}