fix(Settings): use calls folder instead of videos folder for captures

This commit is contained in:
Ronan Abhamon 2018-07-20 10:31:31 +02:00
parent 953ec716e1
commit b26f88ac3d
14 changed files with 50 additions and 46 deletions

View file

@ -1531,10 +1531,6 @@ Server URL ist nicht konfiguriert.</translation>
<source>savedScreenshotsLabel</source>
<translation>Ordner für gespeicherter Screenshots</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Ordner für gespeicherte Videos</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Sprachen</translation>
@ -1575,6 +1571,10 @@ Server URL ist nicht konfiguriert.</translation>
<source>dataTitle</source>
<translation>UI-Daten</translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1537,8 +1537,8 @@ your friend&apos;s SIP address or username.</translation>
<translation>Saved screenshots folder</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Saved videos folder</translation>
<source>savedCallsLabel</source>
<translation>Saved calls folder</translation>
</message>
<message>
<source>languagesTitle</source>

View file

@ -1535,8 +1535,8 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Dossier des captures d&apos;écran</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Dossier des captures vidéo</translation>
<source>savedCallsLabel</source>
<translation>Dossier des captures d&apos;appels</translation>
</message>
<message>
<source>languagesTitle</source>

View file

@ -1531,10 +1531,6 @@
<source>savedScreenshotsLabel</source>
<translation></translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation></translation>
</message>
<message>
<source>languagesTitle</source>
<translation></translation>
@ -1575,6 +1571,10 @@
<source>dataTitle</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1533,10 +1533,6 @@ Tiesiog, įveskite savo draugo SIP adresą ar naudotojo vardą.</translation>
<source>savedScreenshotsLabel</source>
<translation>Įrašytų ekrano kopijų aplankas</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Įrašytų vaizdo įrašų aplankas</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Kalbos</translation>
@ -1577,6 +1573,10 @@ Tiesiog, įveskite savo draugo SIP adresą ar naudotojo vardą.</translation>
<source>dataTitle</source>
<translation>Naudotojo sąsajos duomenys</translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1536,10 +1536,6 @@ o endereço SIP ou nome de usuário do seu amigo.</translation>
<source>savedScreenshotsLabel</source>
<translation>Salvar captura de tela na pasta</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Salvar vídeos na pasta</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Idiomas</translation>
@ -1580,6 +1576,10 @@ o endereço SIP ou nome de usuário do seu amigo.</translation>
<source>dataTitle</source>
<translation>Dados UI</translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1534,10 +1534,6 @@
<source>savedScreenshotsLabel</source>
<translation>Папка для сохранения снимков</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Папка для сохранения видео</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Языки</translation>
@ -1578,6 +1574,10 @@
<source>dataTitle</source>
<translation>Данные пользовательского интерфейса</translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1533,10 +1533,6 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>savedScreenshotsLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Mapp för sparade videoklipp</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Språk</translation>
@ -1577,6 +1573,10 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>dataTitle</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1533,10 +1533,6 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.</translation>
<source>savedScreenshotsLabel</source>
<translation>Kaydedilen ekran görüntüleri klasörü</translation>
</message>
<message>
<source>savedVideosLabel</source>
<translation>Kaydedilen videolar klasörü</translation>
</message>
<message>
<source>languagesTitle</source>
<translation>Diller</translation>
@ -1577,6 +1573,10 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.</translation>
<source>dataTitle</source>
<translation>Kullanıcı Arayüzü Verisi</translation>
</message>
<message>
<source>savedCallsLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -94,7 +94,7 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {
callParams->setRecordFile(
Utils::appStringToCoreString(
QStringLiteral("%1%2.mkv")
.arg(CoreManager::getInstance()->getSettingsModel()->getSavedVideosFolder())
.arg(CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss"))
)
);

View file

@ -83,7 +83,7 @@ void ConferenceModel::startRecording () {
coreManager->getCore()->startConferenceRecording(
Utils::appStringToCoreString(
QStringLiteral("%1%2.mkv")
.arg(coreManager->getSettingsModel()->getSavedVideosFolder())
.arg(coreManager->getSettingsModel()->getSavedCallsFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss"))
)
);

View file

@ -873,18 +873,22 @@ void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
// -----------------------------------------------------------------------------
QString SettingsModel::getSavedVideosFolder () const {
static inline string getLegacySavedCallsFolder (const shared_ptr<linphone::Config> &config) {
return config->getString(SettingsModel::UiSection, "saved_videos_folder", Paths::getCapturesDirPath());
}
QString SettingsModel::getSavedCallsFolder () const {
return QDir::cleanPath(
Utils::coreStringToAppString(
mConfig->getString(UiSection, "saved_videos_folder", Paths::getCapturesDirPath())
mConfig->getString(UiSection, "saved_calls_folder", getLegacySavedCallsFolder(mConfig))
)
) + QDir::separator();
}
void SettingsModel::setSavedVideosFolder (const QString &folder) {
void SettingsModel::setSavedCallsFolder (const QString &folder) {
QString cleanedFolder = QDir::cleanPath(folder) + QDir::separator();
mConfig->setString(UiSection, "saved_videos_folder", Utils::appStringToCoreString(cleanedFolder));
emit savedVideosFolderChanged(cleanedFolder);
mConfig->setString(UiSection, "saved_calls_folder", Utils::appStringToCoreString(cleanedFolder));
emit savedCallsFolderChanged(cleanedFolder);
}
// -----------------------------------------------------------------------------

View file

@ -144,7 +144,7 @@ class SettingsModel : public QObject {
Q_PROPERTY(QString remoteProvisioning READ getRemoteProvisioning WRITE setRemoteProvisioning NOTIFY remoteProvisioningChanged);
Q_PROPERTY(QString savedScreenshotsFolder READ getSavedScreenshotsFolder WRITE setSavedScreenshotsFolder NOTIFY savedScreenshotsFolderChanged);
Q_PROPERTY(QString savedVideosFolder READ getSavedVideosFolder WRITE setSavedVideosFolder NOTIFY savedVideosFolderChanged);
Q_PROPERTY(QString savedCallsFolder READ getSavedCallsFolder WRITE setSavedCallsFolder NOTIFY savedCallsFolderChanged);
Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged);
Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged);
@ -354,8 +354,8 @@ public:
QString getSavedScreenshotsFolder () const;
void setSavedScreenshotsFolder (const QString &folder);
QString getSavedVideosFolder () const;
void setSavedVideosFolder (const QString &folder);
QString getSavedCallsFolder () const;
void setSavedCallsFolder (const QString &folder);
QString getDownloadFolder () const;
void setDownloadFolder (const QString &folder);
@ -486,7 +486,7 @@ signals:
// UI. -----------------------------------------------------------------------
void savedScreenshotsFolderChanged (const QString &folder);
void savedVideosFolderChanged (const QString &folder);
void savedCallsFolderChanged (const QString &folder);
void downloadFolderChanged (const QString &folder);
void remoteProvisioningChanged (const QString &remoteProvisioning);

View file

@ -80,13 +80,13 @@ TabContainer {
visible: SettingsModel.callRecorderEnabled
FormGroup {
label: qsTr('savedVideosLabel')
label: qsTr('savedCallsLabel')
FileChooserButton {
selectedFile: SettingsModel.savedVideosFolder
selectedFile: SettingsModel.savedCallsFolder
selectFolder: true
onAccepted: SettingsModel.savedVideosFolder = selectedFile
onAccepted: SettingsModel.savedCallsFolder = selectedFile
}
}
}