From 68bb7c9621bc02451f968a3d389a2f6ff2daddfb Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 22 Jan 2010 22:07:03 +0000 Subject: added special class for settings git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1523 90c681e8-e032-0410-971d-27865f9a5e38 --- src/ui/addurldialog.cpp | 12 ++++--- src/ui/configdialog.cpp | 76 +++++++++++++++++++-------------------- src/ui/translations/qmmp_cs.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_de.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_it.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_lt.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_pl_PL.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_pt_BR.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_ru.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_tr.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_uk_UA.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_zh_CN.ts | 66 +++++++++++++++++----------------- src/ui/translations/qmmp_zh_TW.ts | 66 +++++++++++++++++----------------- 13 files changed, 407 insertions(+), 407 deletions(-) (limited to 'src/ui') diff --git a/src/ui/addurldialog.cpp b/src/ui/addurldialog.cpp index 542044f66..3cdada075 100644 --- a/src/ui/addurldialog.cpp +++ b/src/ui/addurldialog.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #define HISTORY_SIZE 10 @@ -41,11 +42,12 @@ AddUrlDialog::AddUrlDialog( QWidget * parent, Qt::WindowFlags f) : QDialog(paren urlComboBox->addItems(m_history); m_http = new QHttp(this); //load global proxy settings - if (Qmmp::useProxy()) - m_http->setProxy(Qmmp::proxy().host(), - Qmmp::proxy().port(), - Qmmp::useProxyAuth() ? Qmmp::proxy().userName() : QString(), - Qmmp::useProxyAuth() ? Qmmp::proxy().password() : QString()); + QmmpSettings *gs = QmmpSettings::instance(); + if (gs->isProxyEnabled()) + m_http->setProxy(gs->proxy().host(), + gs->proxy().port(), + gs->useProxyAuth() ? gs->proxy().userName() : QString(), + gs->useProxyAuth() ? gs->proxy().password() : QString()); } AddUrlDialog::~AddUrlDialog() diff --git a/src/ui/configdialog.cpp b/src/ui/configdialog.cpp index a3a569a6a..3bd39bdc1 100644 --- a/src/ui/configdialog.cpp +++ b/src/ui/configdialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * + * Copyright (C) 2007-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -78,9 +78,9 @@ ConfigDialog::ConfigDialog (QWidget *parent) connect (ui.listWidget, SIGNAL (itemClicked (QListWidgetItem *)), this, SLOT (changeSkin())); ui.listWidget->setIconSize (QSize (105,34)); m_skin = Skin::instance(); - ui.replayGainModeComboBox->addItem (tr("Track"), AudioSettings::REPLAYGAIN_TRACK); - ui.replayGainModeComboBox->addItem (tr("Album"), AudioSettings::REPLAYGAIN_ALBUM); - ui.replayGainModeComboBox->addItem (tr("Disabled"), AudioSettings::REPLAYGAIN_DISABLED); + ui.replayGainModeComboBox->addItem (tr("Track"), QmmpSettings::REPLAYGAIN_TRACK); + ui.replayGainModeComboBox->addItem (tr("Album"), QmmpSettings::REPLAYGAIN_ALBUM); + ui.replayGainModeComboBox->addItem (tr("Disabled"), QmmpSettings::REPLAYGAIN_DISABLED); readSettings(); m_reader = new SkinReader(this); loadSkins(); @@ -117,14 +117,15 @@ void ConfigDialog::readSettings() ui.numbersCheckBox->setChecked(settings.value ("PlayList/show_numbers", TRUE).toBool()); ui.playlistsCheckBox->setChecked(settings.value("PlayList/show_plalists", FALSE).toBool()); ui.popupCheckBox->setChecked(settings.value("PlayList/show_popup", FALSE).toBool()); + QmmpSettings *gs = QmmpSettings::instance(); //proxy settings - ui.enableProxyCheckBox->setChecked(Qmmp::useProxy()); - ui.authProxyCheckBox->setChecked(Qmmp::useProxyAuth()); - ui.hostLineEdit->setText(Qmmp::proxy().host()); - if (Qmmp::proxy().port(0)) - ui.portLineEdit->setText(QString::number(Qmmp::proxy().port(0))); - ui.proxyUserLineEdit->setText(Qmmp::proxy().userName()); - ui.proxyPasswLineEdit->setText(Qmmp::proxy().password()); + ui.enableProxyCheckBox->setChecked(gs->isProxyEnabled()); + ui.authProxyCheckBox->setChecked(gs->useProxyAuth()); + ui.hostLineEdit->setText(gs->proxy().host()); + if (gs->proxy().port(0)) + ui.portLineEdit->setText(QString::number(gs->proxy().port(0))); + ui.proxyUserLineEdit->setText(gs->proxy().userName()); + ui.proxyPasswLineEdit->setText(gs->proxy().password()); ui.hostLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); ui.portLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); @@ -144,19 +145,17 @@ void ConfigDialog::readSettings() ui.skinCursorsCheckBox->setChecked(settings.value("General/skin_cursors", FALSE).toBool()); ui.doubleSizeCheckBox->setChecked(settings.value("General/double_size", FALSE).toBool()); //cover options - ui.coverIncludeLineEdit->setText(MetaDataManager::instance()->coverNameFilters(TRUE).join(",")); - ui.coverExcludeLineEdit->setText(MetaDataManager::instance()->coverNameFilters(FALSE).join(",")); - ui.coverDepthSpinBox->setValue(MetaDataManager::instance()->coverSearchDepth()); + ui.coverIncludeLineEdit->setText(gs->coverNameFilters(TRUE).join(",")); + ui.coverExcludeLineEdit->setText(gs->coverNameFilters(FALSE).join(",")); + ui.coverDepthSpinBox->setValue(gs->coverSearchDepth()); //replay gain - AudioSettings as = SoundCore::instance()->audioSettings(); - ui.clippingCheckBox->setChecked(as.value(AudioSettings::REPLAYGAIN_PREVENT_CLIPPING).toBool()); - AudioSettings::ReplayGainMode mode = (AudioSettings::ReplayGainMode)as.value(AudioSettings::REPLAYGAIN_MODE).toInt(); - ui.replayGainModeComboBox->setCurrentIndex(ui.replayGainModeComboBox->findData(mode)); - ui.preampDoubleSpinBox->setValue(as.value(AudioSettings::REPLAYGAIN_PREAMP).toDouble()); - ui.defaultGainDoubleSpinBox->setValue(as.value(AudioSettings::REPLAYGAIN_DEFAULT_GAIN).toDouble()); + ui.clippingCheckBox->setChecked(gs->replayGainPreventClipping()); + ui.replayGainModeComboBox->setCurrentIndex(ui.replayGainModeComboBox->findData(gs->replayGainMode())); + ui.preampDoubleSpinBox->setValue(gs->replayGainPreamp()); + ui.defaultGainDoubleSpinBox->setValue(gs->replayGainDefaultGain()); //audio - ui.softVolumeCheckBox->setChecked(as.value(AudioSettings::SOFTWARE_VOLUME).toBool()); - ui.use16BitCheckBox->setChecked(as.value(AudioSettings::OUTPUT_16BIT).toBool()); + ui.softVolumeCheckBox->setChecked(gs->useSoftVolume()); + ui.use16BitCheckBox->setChecked(gs->use16BitOutput()); } void ConfigDialog::changePage (QListWidgetItem *current, QListWidgetItem *previous) @@ -635,15 +634,17 @@ void ConfigDialog::saveSettings() settings.setValue ("PlayList/show_plalists", ui.playlistsCheckBox->isChecked()); settings.setValue ("PlayList/show_popup", ui.popupCheckBox->isChecked()); FileDialog::setEnabled(FileDialog::registeredFactories().at(ui.fileDialogComboBox->currentIndex())); - - Qmmp::setProxyEnabled(ui.enableProxyCheckBox->isChecked()); - Qmmp::setProxyAuthEnabled(ui.authProxyCheckBox->isChecked()); + QmmpSettings *gs = QmmpSettings::instance(); + //proxy QUrl proxyUrl; proxyUrl.setHost(ui.hostLineEdit->text()); proxyUrl.setPort(ui.portLineEdit->text().toUInt()); proxyUrl.setUserName(ui.proxyUserLineEdit->text()); proxyUrl.setPassword(ui.proxyPasswLineEdit->text()); - Qmmp::setProxy(proxyUrl); + gs->setNetworkSettings(ui.enableProxyCheckBox->isChecked(), + ui.authProxyCheckBox->isChecked(), + proxyUrl); + settings.setValue ("MainWindow/start_hidden", ui.hiddenCheckBox->isChecked()); settings.setValue ("MainWindow/hide_on_close", ui.hideOnCloseCheckBox->isChecked()); settings.setValue ("MainWindow/opacity", 1.0 - (double)ui.mwTransparencySlider->value()/100); @@ -654,19 +655,16 @@ void ConfigDialog::saveSettings() settings.setValue ("MainWindow/bitmap_font", ui.useBitmapCheckBox->isChecked()); settings.setValue ("General/skin_cursors", ui.skinCursorsCheckBox->isChecked()); settings.setValue ("General/double_size", ui.doubleSizeCheckBox->isChecked()); - MetaDataManager::instance()->setCoverSearchSettings(ui.coverIncludeLineEdit->text().split(","), - ui.coverExcludeLineEdit->text().split(","), - ui.coverDepthSpinBox->value()); + gs->setCoverSettings(ui.coverIncludeLineEdit->text().split(","), + ui.coverExcludeLineEdit->text().split(","), + ui.coverDepthSpinBox->value(), TRUE); int i = ui.replayGainModeComboBox->currentIndex(); - //audio - AudioSettings as = SoundCore::instance()->audioSettings(); - as.setValue(AudioSettings::REPLAYGAIN_MODE, ui.replayGainModeComboBox->itemData(i).toInt()); - as.setValue(AudioSettings::REPLAYGAIN_PREAMP, ui.preampDoubleSpinBox->value()); - as.setValue(AudioSettings::REPLAYGAIN_DEFAULT_GAIN, ui.defaultGainDoubleSpinBox->value()); - as.setValue(AudioSettings::REPLAYGAIN_PREVENT_CLIPPING, ui.clippingCheckBox->isChecked()); - as.setValue(AudioSettings::SOFTWARE_VOLUME, ui.softVolumeCheckBox->isChecked()); - as.setValue(AudioSettings::OUTPUT_16BIT, ui.use16BitCheckBox->isChecked()); - SoundCore::instance()->setAudioSettings(as); + gs->setReplayGainSettings((QmmpSettings::ReplayGainMode) + ui.replayGainModeComboBox->itemData(i).toInt(), + ui.preampDoubleSpinBox->value(), + ui.defaultGainDoubleSpinBox->value(), + ui.clippingCheckBox->isChecked()); + gs->setAudioSettings(ui.softVolumeCheckBox->isChecked(), ui.use16BitCheckBox->isChecked()); } void ConfigDialog::updateButtons() diff --git a/src/ui/translations/qmmp_cs.ts b/src/ui/translations/qmmp_cs.ts index 9900d5091..ada1aca00 100644 --- a/src/ui/translations/qmmp_cs.ts +++ b/src/ui/translations/qmmp_cs.ts @@ -97,7 +97,7 @@ Přidat URL - + Error Chyba @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Povoleno - - - - - + + + + + Description Popis - - - - - + + + + + Filename Soubor - + Artist Umělec - + Album Album @@ -221,57 +221,57 @@ Vypnuto - + Title Název - + Track number Číslo stopy - + Two-digit track number Dvoumístné číslo stopy - + Disc number Číslo disku - + Condition Stav - + Composer Skladatel - + File name Název souboru - + File path Cesta k souboru - + Genre Žánr - + Year Rok - + Comment Poznámka @@ -542,12 +542,12 @@ Heslo: - + Archived skin Sbalené téma - + Unarchived skin Rozbalené téma @@ -603,12 +603,12 @@ Převést %20 na mezery - + Select Skin Files Vybrat soubory s tématy - + Skin files Soubory s tématy diff --git a/src/ui/translations/qmmp_de.ts b/src/ui/translations/qmmp_de.ts index 866ae5e95..d3d485f81 100644 --- a/src/ui/translations/qmmp_de.ts +++ b/src/ui/translations/qmmp_de.ts @@ -97,7 +97,7 @@ Hinzuzufügende URL eingeben - + Error Fehler @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Aktiviert - - - - - + + + + + Description Beschreibung - - - - - + + + + + Filename Dateiname - + Artist Interpret - + Album Album @@ -221,57 +221,57 @@ - + Title Titel - + Track number Stücknummer - + Two-digit track number Zweistellige Stücknummer - + Disc number CD-Nummer - + Condition - + Genre Genre - + Composer Komponist - + File name Dateiname - + File path Dateipfad - + Year Jahr - + Comment Kommentar @@ -542,12 +542,12 @@ Passwort: - + Archived skin Archiviertes Design - + Unarchived skin Nicht archiviertes Design @@ -603,12 +603,12 @@ %20 in Leerzeichen umwandeln - + Select Skin Files Design-Dateien auswählen - + Skin files Design-Dateien diff --git a/src/ui/translations/qmmp_it.ts b/src/ui/translations/qmmp_it.ts index 02dbf29ca..623f1482f 100644 --- a/src/ui/translations/qmmp_it.ts +++ b/src/ui/translations/qmmp_it.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Errore @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Attivo - - - - - + + + + + Description Descrizione - - - - - + + + + + Filename File - + Artist Interprete - + Album Album @@ -221,57 +221,57 @@ - + Title Titolo - + Track number Traccia n° - + Two-digit track number Traccia n° a due cifre - + Disc number Disco n° - + Condition Condizione - + Genre Genere - + Composer Compositore - + File name Nome file - + File path Percorso file - + Year Anno - + Comment Commento @@ -386,12 +386,12 @@ Chiudi - + Archived skin Tema archiviato - + Unarchived skin Tema non archiviato @@ -603,12 +603,12 @@ Converti il carattere « %20 » in spazi - + Select Skin Files Seleziona aspetto - + Skin files Aspetto diff --git a/src/ui/translations/qmmp_lt.ts b/src/ui/translations/qmmp_lt.ts index 827aa63a2..6a036d882 100644 --- a/src/ui/translations/qmmp_lt.ts +++ b/src/ui/translations/qmmp_lt.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Klaida @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Įjungtas - - - - - + + + + + Description Aprašymas - - - - - + + + + + Filename Bylos pavadinimas - + Artist Atlikėjas - + Album Albumas @@ -221,57 +221,57 @@ - + Title Pavadinimas - + Track number Takelio numeris - + Two-digit track number Dviejų skaičių takelio numeris - + Disc number Disko numeris - + Condition Būklė - + Composer Autorius - + File name Bylos pavadinimas - + File path Bylos kelias - + Genre Žanras - + Year Metai - + Comment Komentaras @@ -386,12 +386,12 @@ Užverti - + Archived skin Suspausta tema - + Unarchived skin Išskleista tema @@ -604,12 +604,12 @@ Paversti %20 į tarpus - + Select Skin Files Pasirinkti temų bylas - + Skin files Temų bylos diff --git a/src/ui/translations/qmmp_pl_PL.ts b/src/ui/translations/qmmp_pl_PL.ts index 011c27ad9..69af6cb05 100644 --- a/src/ui/translations/qmmp_pl_PL.ts +++ b/src/ui/translations/qmmp_pl_PL.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Błąd @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Włączone - - - - - + + + + + Description Opis - - - - - + + + + + Filename Nazwa pliku - + Artist Artysta - + Album Album @@ -221,57 +221,57 @@ Wyłączone - + Title Tytuł - + Track number Numer utworu - + Two-digit track number Dwuznakowy numer utworu - + Disc number Numer albumu - + Condition Warunek - + Genre Gatunek - + Composer Kompozytor - + File name Nazwa pliku - + File path Lokalizacja - + Year Rok - + Comment Komentarz @@ -386,12 +386,12 @@ Zamknij - + Archived skin Skompresowana skórka - + Unarchived skin Niekompresowana skórka @@ -603,12 +603,12 @@ Konwertuj sekwencje %20 na spacje - + Select Skin Files Wybierz skórę - + Skin files Pliki skór diff --git a/src/ui/translations/qmmp_pt_BR.ts b/src/ui/translations/qmmp_pt_BR.ts index 7f5647b5b..11e42937f 100644 --- a/src/ui/translations/qmmp_pt_BR.ts +++ b/src/ui/translations/qmmp_pt_BR.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Ligado - - - - - + + + + + Description Descrição - - - - - + + + + + Filename Nome do Arquivo - + Artist Artista - + Album Álbum @@ -221,57 +221,57 @@ - + Title Título - + Track number - + Two-digit track number - + Disc number - + Condition - + Genre Gênero - + Composer - + File name - + File path - + Year Ano - + Comment Comentário @@ -386,12 +386,12 @@ Fechar - + Archived skin - + Unarchived skin @@ -603,12 +603,12 @@ - + Select Skin Files - + Skin files diff --git a/src/ui/translations/qmmp_ru.ts b/src/ui/translations/qmmp_ru.ts index bdbaff32a..ab6fd19f0 100644 --- a/src/ui/translations/qmmp_ru.ts +++ b/src/ui/translations/qmmp_ru.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Ошибка @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Включён - - - - - + + + + + Description Описание - - - - - + + + + + Filename Имя файла - + Artist Исполнитель - + Album Альбом @@ -221,57 +221,57 @@ Отключено - + Title Название - + Track number Номер трека - + Two-digit track number 2-x разрядный номер трека - + Disc number Номер диска - + Condition Условие - + Genre Жанр - + Composer Композитор - + File name Имя файла - + File path Путь к файлу - + Year Год - + Comment Комментарий @@ -386,12 +386,12 @@ Закрыть - + Archived skin Упакованная тема - + Unarchived skin Распакованная тема @@ -603,12 +603,12 @@ Преобразовывать %20 в пробел - + Select Skin Files Выберите файлы обложек - + Skin files Файлы обложек diff --git a/src/ui/translations/qmmp_tr.ts b/src/ui/translations/qmmp_tr.ts index 51058f7ec..cb847e67e 100644 --- a/src/ui/translations/qmmp_tr.ts +++ b/src/ui/translations/qmmp_tr.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Hata @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Etkinleştirildi - - - - - + + + + + Description Açıklama - - - - - + + + + + Filename Dosya adı - + Artist Sanatçı - + Album Albüm @@ -221,57 +221,57 @@ - + Title Başlık - + Track number - + Two-digit track number - + Disc number - + Condition - + Genre Tarz - + Composer - + File name - + File path - + Year Yıl - + Comment Yorum @@ -386,12 +386,12 @@ Kapat - + Archived skin Arşivlenmiş kabuk - + Unarchived skin Arşivlenmemiş kabuk @@ -603,12 +603,12 @@ %20 yi boşluğa çevir - + Select Skin Files Kabuk Dosyası Seç - + Skin files Kabuk dosyaları diff --git a/src/ui/translations/qmmp_uk_UA.ts b/src/ui/translations/qmmp_uk_UA.ts index 3ba0131e9..f451f130d 100644 --- a/src/ui/translations/qmmp_uk_UA.ts +++ b/src/ui/translations/qmmp_uk_UA.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error Помилка @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled Увімкнено - - - - - + + + + + Description Пояснення - - - - - + + + + + Filename Ім'я файлу - + Artist Виконавець - + Album Альбом @@ -221,57 +221,57 @@ Вимкнено - + Title Назва - + Track number Номер треку - + Two-digit track number 2- розрядний номер трека - + Disc number Номер диску - + Condition Умова - + Genre Жанр - + Composer Композитор - + File name Ім'я файлу - + File path Шлях файлу - + Year Рік - + Comment Коментар @@ -386,12 +386,12 @@ Закрити - + Archived skin Упакована тема - + Unarchived skin Розпакована тема @@ -603,12 +603,12 @@ Конвертувати %20 в пробіл - + Select Skin Files Вибрати файли скінів - + Skin files Файли скінів diff --git a/src/ui/translations/qmmp_zh_CN.ts b/src/ui/translations/qmmp_zh_CN.ts index b2e0f87f5..c52d3310a 100644 --- a/src/ui/translations/qmmp_zh_CN.ts +++ b/src/ui/translations/qmmp_zh_CN.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error 错误 @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled 启用 - - - - - + + + + + Description 描述 - - - - - + + + + + Filename 文件名 - + Artist 艺术家 - + Album 专辑 @@ -221,57 +221,57 @@ - + Title 标题 - + Track number - + Two-digit track number - + Disc number - + Condition - + Genre 流派 - + Composer - + File name - + File path - + Year 年代 - + Comment 备注 @@ -386,12 +386,12 @@ 关闭 - + Archived skin 压缩皮肤 - + Unarchived skin 未压缩皮肤 @@ -603,12 +603,12 @@ 转换 %20 为空格 - + Select Skin Files 选择皮肤文件 - + Skin files 皮肤文件 diff --git a/src/ui/translations/qmmp_zh_TW.ts b/src/ui/translations/qmmp_zh_TW.ts index d21402452..d08ac82fb 100644 --- a/src/ui/translations/qmmp_zh_TW.ts +++ b/src/ui/translations/qmmp_zh_TW.ts @@ -92,7 +92,7 @@ AddUrlDialog - + Error 錯誤 @@ -173,40 +173,40 @@ ConfigDialog - - - - - + + + + + Enabled 啟用 - - - - - + + + + + Description 說明 - - - - - + + + + + Filename 檔名 - + Artist 藝術家 - + Album 專輯 @@ -221,57 +221,57 @@ - + Title 標題 - + Track number - + Two-digit track number - + Disc number - + Condition - + Genre 流派 - + Composer - + File name - + File path - + Year 年代 - + Comment 備註 @@ -386,12 +386,12 @@ 關閉 - + Archived skin 封包皮膚 - + Unarchived skin 未封包皮膚 @@ -603,12 +603,12 @@ 轉換 %20 為空格 - + Select Skin Files 選取皮膚檔案 - + Skin files 皮膚檔案 -- cgit v1.2.3-13-gbd6f