Remove the library config dialog and make it show the page in the settings dialog instead

This commit is contained in:
David Sansome 2010-06-08 23:06:29 +00:00
parent 8c7aaeb29d
commit f1fb9ab6b9
32 changed files with 83 additions and 253 deletions

View File

@ -50,7 +50,6 @@ set(SOURCES
library/library.cpp
library/librarybackend.cpp
library/libraryconfig.cpp
library/libraryconfigdialog.cpp
library/librarydirectorymodel.cpp
library/libraryfilterwidget.cpp
library/librarymodel.cpp
@ -161,7 +160,6 @@ set(HEADERS
library/library.h
library/librarybackend.h
library/libraryconfig.h
library/libraryconfigdialog.h
library/librarydirectorymodel.h
library/libraryfilterwidget.h
library/librarymodel.h
@ -239,7 +237,6 @@ set(HEADERS
set(UI
library/groupbydialog.ui
library/libraryconfig.ui
library/libraryconfigdialog.ui
library/libraryfilterwidget.ui
playlist/playlistcontainer.ui

View File

@ -1,41 +0,0 @@
/* This file is part of Clementine.
Clementine 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 3 of the License, or
(at your option) any later version.
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "libraryconfigdialog.h"
#include "ui_libraryconfigdialog.h"
#include "ui/iconloader.h"
LibraryConfigDialog::LibraryConfigDialog(QWidget *parent)
: QDialog(parent),
ui_(new Ui_LibraryConfigDialog)
{
ui_->setupUi(this);
setWindowIcon(IconLoader::Load("folder-sound"));
}
LibraryConfigDialog::~LibraryConfigDialog() {
delete ui_;
}
void LibraryConfigDialog::SetModel(LibraryDirectoryModel* model) {
ui_->config->SetModel(model);
}
void LibraryConfigDialog::accept() {
ui_->config->Save();
QDialog::accept();
}

View File

@ -1,40 +0,0 @@
/* This file is part of Clementine.
Clementine 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 3 of the License, or
(at your option) any later version.
Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBRARYCONFIGDIALOG_H
#define LIBRARYCONFIGDIALOG_H
#include <QDialog>
class Ui_LibraryConfigDialog;
class LibraryDirectoryModel;
class LibraryConfigDialog : public QDialog {
Q_OBJECT
public:
LibraryConfigDialog(QWidget* parent = 0);
~LibraryConfigDialog();
void SetModel(LibraryDirectoryModel* model);
public slots:
void accept();
private:
Ui_LibraryConfigDialog* ui_;
};
#endif // LIBRARYCONFIGDIALOG_H

View File

@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LibraryConfigDialog</class>
<widget class="QDialog" name="LibraryConfigDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Music Library</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="LibraryConfig" name="config" native="true"/>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<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>
<customwidgets>
<customwidget>
<class>LibraryConfig</class>
<extends>QWidget</extends>
<header>library/libraryconfig.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>LibraryConfigDialog</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>LibraryConfigDialog</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>
</connections>
</ui>

View File

@ -17,9 +17,9 @@
#include "libraryfilterwidget.h"
#include "librarymodel.h"
#include "groupbydialog.h"
#include "libraryconfigdialog.h"
#include "ui_libraryfilterwidget.h"
#include "ui/iconloader.h"
#include "ui/settingsdialog.h"
#include <QMenu>
#include <QActionGroup>
@ -30,8 +30,7 @@ LibraryFilterWidget::LibraryFilterWidget(QWidget *parent)
: QWidget(parent),
ui_(new Ui_LibraryFilterWidget),
model_(NULL),
group_by_dialog_(new GroupByDialog),
library_config_dialog_(new LibraryConfigDialog)
group_by_dialog_(new GroupByDialog)
{
ui_->setupUi(this);
@ -101,9 +100,8 @@ LibraryFilterWidget::LibraryFilterWidget(QWidget *parent)
library_menu->addMenu(group_by_menu_);
library_menu->addSeparator();
config_action_ = library_menu->addAction(
tr("Configure library..."), library_config_dialog_.get(), SLOT(show()));
tr("Configure library..."), this, SLOT(ShowConfigDialog()));
ui_->options->setMenu(library_menu);
connect(library_config_dialog_.get(), SIGNAL(accepted()), SIGNAL(LibraryConfigChanged()));
}
LibraryFilterWidget::~LibraryFilterWidget() {
@ -131,9 +129,6 @@ void LibraryFilterWidget::SetLibraryModel(LibraryModel *model) {
connect(ui_->filter, SIGNAL(textChanged(QString)), model_, SLOT(SetFilterText(QString)));
connect(filter_age_mapper_, SIGNAL(mapped(int)), model_, SLOT(SetFilterAge(int)));
// Set up the dialogs
library_config_dialog_->SetModel(model_->directory_model());
// Load settings
if (!settings_group_.isEmpty()) {
QSettings s;
@ -184,7 +179,7 @@ void LibraryFilterWidget::ClearFilter() {
}
void LibraryFilterWidget::ShowConfigDialog() {
library_config_dialog_->show();
settings_dialog_->OpenAtPage(SettingsDialog::Page_Library);
}
void LibraryFilterWidget::SetFilterHint(const QString& hint) {

View File

@ -24,7 +24,7 @@
#include "librarymodel.h"
class GroupByDialog;
class LibraryConfigDialog;
class SettingsDialog;
class Ui_LibraryFilterWidget;
class QMenu;
@ -45,6 +45,7 @@ class LibraryFilterWidget : public QWidget {
void SetSettingsGroup(const QString& group) { settings_group_ = group; }
void SetLibraryModel(LibraryModel* model);
void SetSettingsDialog(SettingsDialog* dialog) { settings_dialog_ = dialog; }
signals:
void LibraryConfigChanged();
@ -62,7 +63,7 @@ class LibraryFilterWidget : public QWidget {
LibraryModel* model_;
boost::scoped_ptr<GroupByDialog> group_by_dialog_;
boost::scoped_ptr<LibraryConfigDialog> library_config_dialog_;
SettingsDialog* settings_dialog_;
QMenu* filter_age_menu_;
QMenu* group_by_menu_;

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "مكتبة الصوتيات"
msgid "Form"
msgstr "النموذج"
@ -1208,6 +1205,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr "مكتبة الصوتيات"
msgid "Last.fm"
msgstr ""

View File

@ -842,9 +842,6 @@ msgstr "Automaticky otevře jednostlivé kategorie ve stromu knihovny"
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Knihovna hudby"
msgid "Form"
msgstr "Formulář"
@ -1212,6 +1209,9 @@ msgstr "Chování"
msgid "Notifications"
msgstr "Upozornění"
msgid "Music Library"
msgstr "Knihovna hudby"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -845,9 +845,6 @@ msgstr "Åbn automatisk enkelte kategorier i bibliotekstræet"
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Musikbibliotek"
msgid "Form"
msgstr "Formular"
@ -1215,6 +1212,9 @@ msgstr "Opførsel"
msgid "Notifications"
msgstr "Bekendtgørelser"
msgid "Music Library"
msgstr "Musikbibliotek"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -844,9 +844,6 @@ msgstr "Kategorien in der Musiksammlung automatisch öffnen"
msgid "Double-clicking a song clears the playlist first"
msgstr "Stück doppelklicken um Wiedergabeliste zu ersetzen"
msgid "Music Library"
msgstr "Musiksammlung"
msgid "Form"
msgstr "Formular"
@ -1214,6 +1211,9 @@ msgstr "Verhalten"
msgid "Notifications"
msgstr "Benachrichtigungen"
msgid "Music Library"
msgstr "Musiksammlung"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -848,9 +848,6 @@ msgstr "Άνοιξε αυτόμα τις μόνες κατηγορίες του
msgid "Double-clicking a song clears the playlist first"
msgstr "Διπλό κλικ σε ένα τραγούδι θα καθαρίσει πρώτα την λίστα αναπαραγωγής"
msgid "Music Library"
msgstr "Μουσική βιβλιοθήκη"
msgid "Form"
msgstr "Μορφή"
@ -1218,6 +1215,9 @@ msgstr "Συμπεριφορά"
msgid "Notifications"
msgstr "Ειδοποιήσεις"
msgid "Music Library"
msgstr "Μουσική βιβλιοθήκη"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -844,9 +844,6 @@ msgstr "Automatically open single categories in the library tree"
msgid "Double-clicking a song clears the playlist first"
msgstr "Double-clicking a song clears the playlist first"
msgid "Music Library"
msgstr "Music Library"
msgid "Form"
msgstr "Form"
@ -1213,6 +1210,9 @@ msgstr "Behaviour"
msgid "Notifications"
msgstr "Notifications"
msgid "Music Library"
msgstr "Music Library"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -841,9 +841,6 @@ msgstr "Automatically open single categories in the library tree"
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Music Library"
msgid "Form"
msgstr "Form"
@ -1210,6 +1207,9 @@ msgstr "Behaviour"
msgid "Notifications"
msgstr "Notifications"
msgid "Music Library"
msgstr "Music Library"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -852,9 +852,6 @@ msgid "Double-clicking a song clears the playlist first"
msgstr ""
"Hacer doble clic sobre una canción limpia la lista de reproducción primero"
msgid "Music Library"
msgstr "Colección de Música"
msgid "Form"
msgstr "Formulario"
@ -1222,6 +1219,9 @@ msgstr "Comportamiento"
msgid "Notifications"
msgstr "Notificaciones"
msgid "Music Library"
msgstr "Colección de Música"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Form"
msgstr ""
@ -1208,6 +1205,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Last.fm"
msgstr ""

View File

@ -848,9 +848,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Bibliothèque musicale"
msgid "Form"
msgstr "Form"
@ -1218,6 +1215,9 @@ msgstr ""
msgid "Notifications"
msgstr "Notifications"
msgid "Music Library"
msgstr "Bibliothèque musicale"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -842,9 +842,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Form"
msgstr ""
@ -1210,6 +1207,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Last.fm"
msgstr ""

View File

@ -849,9 +849,6 @@ msgstr "Apri automaticamente categorie singole nell'albero della raccolta"
msgid "Double-clicking a song clears the playlist first"
msgstr "Il doppio clic su un brano svuota la scaletta"
msgid "Music Library"
msgstr "Raccolta musicale"
msgid "Form"
msgstr "Modulo"
@ -1219,6 +1216,9 @@ msgstr "Comportamento"
msgid "Notifications"
msgstr "Notifiche"
msgid "Music Library"
msgstr "Raccolta musicale"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -842,9 +842,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Form"
msgstr ""
@ -1210,6 +1207,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Last.fm"
msgstr ""

View File

@ -843,9 +843,6 @@ msgstr "Automatisk åpne enkeltkategorier i bibliotektreet"
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Musikkbibliotek"
msgid "Form"
msgstr "Skjema"
@ -1212,6 +1209,9 @@ msgstr ""
msgid "Notifications"
msgstr "Meldinger"
msgid "Music Library"
msgstr "Musikkbibliotek"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Discotèca"
msgid "Form"
msgstr "Formulari"
@ -1208,6 +1205,9 @@ msgstr "Compòrtament"
msgid "Notifications"
msgstr "Notificacions"
msgid "Music Library"
msgstr "Discotèca"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -842,9 +842,6 @@ msgstr "Automatycznie otwieraj pojedyńcze kategorie w drzewie Biblioteki"
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Biblioteka muzyki"
msgid "Form"
msgstr "Forma"
@ -1210,6 +1207,9 @@ msgstr ""
msgid "Notifications"
msgstr "Powiadomienia"
msgid "Music Library"
msgstr "Biblioteka muzyki"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -845,9 +845,6 @@ msgstr "Abrir categorias individuais automaticamente na biblioteca em árvore"
msgid "Double-clicking a song clears the playlist first"
msgstr "Duplo clique na canção apaga a lista de reprodução"
msgid "Music Library"
msgstr "Biblioteca de Música"
msgid "Form"
msgstr "Formulário"
@ -1214,6 +1211,9 @@ msgstr "Comportamento"
msgid "Notifications"
msgstr "Notificações"
msgid "Music Library"
msgstr "Biblioteca de Música"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -848,9 +848,6 @@ msgstr "Abrir categorias únicas na árvore da biblioteca automaticamente"
msgid "Double-clicking a song clears the playlist first"
msgstr "Duplo clique em música limpa a lista de reprodução primeiro"
msgid "Music Library"
msgstr "Biblioteca de Músicas"
msgid "Form"
msgstr "Formulário"
@ -1218,6 +1215,9 @@ msgstr "Comportamento"
msgid "Notifications"
msgstr "Notificações"
msgid "Music Library"
msgstr "Biblioteca de Músicas"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -841,9 +841,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Biblioteca audio"
msgid "Form"
msgstr ""
@ -1209,6 +1206,9 @@ msgstr "Comportament"
msgid "Notifications"
msgstr "Notificări"
msgid "Music Library"
msgstr "Biblioteca audio"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -846,9 +846,6 @@ msgstr "Автоматически открывать одиночные кат
msgid "Double-clicking a song clears the playlist first"
msgstr "Двойной щелчок мышью на композиции стирает список воспроизведения"
msgid "Music Library"
msgstr "Музыкальная коллекция"
msgid "Form"
msgstr "Форма"
@ -1214,6 +1211,9 @@ msgstr "Поведение"
msgid "Notifications"
msgstr "Уведомления"
msgid "Music Library"
msgstr "Музыкальная коллекция"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -845,9 +845,6 @@ msgstr "Automaticky otvoriť jednotlivé kategórie v strome zbierky"
msgid "Double-clicking a song clears the playlist first"
msgstr "Dvojklik na pieseň najprv vymaže playlist"
msgid "Music Library"
msgstr "Hudobná zbierka"
msgid "Form"
msgstr "Forma"
@ -1215,6 +1212,9 @@ msgstr "Správanie"
msgid "Notifications"
msgstr "Notifikácie"
msgid "Music Library"
msgstr "Hudobná zbierka"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -845,9 +845,6 @@ msgstr "Öppna enkla kategorier i biblioteksträdet automatiskt"
msgid "Double-clicking a song clears the playlist first"
msgstr "Dubbelklick på en sång rensar spellistan först"
msgid "Music Library"
msgstr "Musikbibliotek"
msgid "Form"
msgstr "Formulär"
@ -1215,6 +1212,9 @@ msgstr "Beteende"
msgid "Notifications"
msgstr "Underrättelser"
msgid "Music Library"
msgstr "Musikbibliotek"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "Müzik Kütüphanesi"
msgid "Form"
msgstr "Form"
@ -1208,6 +1205,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr "Müzik Kütüphanesi"
msgid "Last.fm"
msgstr "Last.fm"

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr "音乐库"
msgid "Form"
msgstr ""
@ -1208,6 +1205,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr "音乐库"
msgid "Last.fm"
msgstr ""

View File

@ -840,9 +840,6 @@ msgstr ""
msgid "Double-clicking a song clears the playlist first"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Form"
msgstr ""
@ -1208,6 +1205,9 @@ msgstr ""
msgid "Notifications"
msgstr ""
msgid "Music Library"
msgstr ""
msgid "Last.fm"
msgstr ""

View File

@ -26,7 +26,6 @@
#include "core/stylesheetloader.h"
#include "engines/enginebase.h"
#include "library/groupbydialog.h"
#include "library/libraryconfigdialog.h"
#include "library/libraryconfig.h"
#include "library/library.h"
#include "playlist/playlistbackend.h"
@ -318,6 +317,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
// Library filter widget
ui_->library_filter->SetSettingsGroup(kSettingsGroup);
ui_->library_filter->SetLibraryModel(library_->model());
ui_->library_filter->SetSettingsDialog(settings_dialog_.get());
connect(ui_->library_filter, SIGNAL(LibraryConfigChanged()), ui_->library_view,
SLOT(ReloadSettings()));
connect(ui_->library_filter, SIGNAL(LibraryConfigChanged()), SLOT(ReloadSettings()));