Skip to content

Commit

Permalink
Merge pull request #678 from h3poteto/iss-673
Browse files Browse the repository at this point in the history
closes #673 Move visibility settings to sync instance settings
  • Loading branch information
h3poteto authored Oct 29, 2018
2 parents 3b1242d + d07e2db commit 9510835
Show file tree
Hide file tree
Showing 20 changed files with 327 additions and 84 deletions.
14 changes: 10 additions & 4 deletions src/config/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "Profil",
"show_profile": "Profil ansehen",
"edit_profile": "Profil bearbeiten",
"settings": "Settings",
"collapse": "Zusammenbruch",
"expand": "Erweitern",
"home": "Home",
Expand Down Expand Up @@ -71,10 +72,9 @@
"new_toot": "Toot",
"reload": "Neu laden"
},
"preferences": {
"title": "Einstellungen",
"settings": {
"general": {
"title": "Allgemein",
"title": "Settings",
"toot": {
"title": "Toot",
"description": "Customize default visibility of toot.",
Expand All @@ -85,7 +85,13 @@
"private": "Privat",
"direct": "Direkt"
}
},
}
}
},
"preferences": {
"title": "Einstellungen",
"general": {
"title": "Allgemein",
"sounds": {
"title": "Klänge",
"description": "Please set feedback sounds.",
Expand Down
13 changes: 10 additions & 3 deletions src/config/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "Profile",
"show_profile": "Show profile",
"edit_profile": "Edit profile",
"settings": "Settings",
"collapse": "Collapse",
"expand": "Expand",
"home": "Home",
Expand Down Expand Up @@ -71,8 +72,8 @@
"new_toot": "Toot",
"reload": "Reload"
},
"preferences": {
"title": "Preferences",
"settings": {
"title": "Settings",
"general": {
"title": "General",
"toot": {
Expand All @@ -85,7 +86,13 @@
"private": "Private",
"direct": "Direct"
}
},
}
}
},
"preferences": {
"title": "Preferences",
"general": {
"title": "General",
"sounds": {
"title": "Sounds",
"description": "Please set feedback sounds.",
Expand Down
13 changes: 10 additions & 3 deletions src/config/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "Profil",
"show_profile": "Voir le profil",
"edit_profile": "Éditer mon profil",
"settings": "Settings",
"collapse": "Effondrer",
"expand": "Développer",
"home": "Accueil",
Expand Down Expand Up @@ -71,8 +72,8 @@
"new_toot": "Pouet",
"reload": "Recharger"
},
"preferences": {
"title": "Préférences",
"settings": {
"title": "Settings",
"general": {
"title": "Général",
"toot": {
Expand All @@ -85,7 +86,13 @@
"private": "Abonné⋅e⋅s uniquement",
"direct": "Message direct"
}
},
}
}
},
"preferences": {
"title": "Préférences",
"general": {
"title": "Général",
"sounds": {
"title": "Sons",
"description": "Please set feedback sounds.",
Expand Down
12 changes: 9 additions & 3 deletions src/config/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "プロフィール",
"show_profile": "プロフィール確認",
"edit_profile": "プロフィール編集",
"settings": "設定",
"collapse": "縮小",
"expand": "拡大",
"home": "ホーム",
Expand Down Expand Up @@ -71,10 +72,9 @@
"new_toot": "トゥート",
"reload": "再読み込み"
},
"preferences": {
"settings": {
"title": "設定",
"general": {
"title": "一般",
"toot": {
"title": "トゥート",
"description": "トゥートの公開設定を変更できます",
Expand All @@ -85,7 +85,13 @@
"private": "フォロワー限定",
"direct": "ダイレクト"
}
},
}
}
},
"preferences": {
"title": "設定",
"general": {
"title": "一般",
"sounds": {
"title": "効果音",
"description": "操作時の効果音を設定",
Expand Down
13 changes: 10 additions & 3 deletions src/config/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "프로필",
"show_profile": "프로필 보기",
"edit_profile": "프로필 수정",
"settings": "Settings",
"collapse": "접기",
"expand": "펼치기",
"home": "",
Expand Down Expand Up @@ -71,8 +72,8 @@
"new_toot": "",
"reload": "새로고침"
},
"preferences": {
"title": "설정",
"settings": {
"title": "Settings",
"general": {
"title": "일반",
"toot": {
Expand All @@ -85,7 +86,13 @@
"private": "비공개",
"direct": "다이렉트"
}
},
}
}
},
"preferences": {
"title": "설정",
"general": {
"title": "일반",
"sounds": {
"title": "사운드",
"description": "피드백 소리를 설정해 주세요.",
Expand Down
13 changes: 10 additions & 3 deletions src/config/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"profile": "Profil",
"show_profile": "Pokaż profil",
"edit_profile": "Edytuj profil",
"settings": "Settings",
"collapse": "Zawalić się",
"expand": "Rozszerzać",
"home": "Strona główna",
Expand Down Expand Up @@ -71,8 +72,8 @@
"new_toot": "Wpisy",
"reload": "Przeładować"
},
"preferences": {
"title": "Preferencje",
"settings": {
"title": "Settings",
"general": {
"title": "Ogólne",
"toot": {
Expand All @@ -85,7 +86,13 @@
"private": "Prywatne",
"direct": "Bezpośrednie"
}
},
}
}
},
"preferences": {
"title": "Preferencje",
"general": {
"title": "Ogólne",
"sounds": {
"title": "Dźwięki",
"description": "Please set feedback sounds.",
Expand Down
8 changes: 4 additions & 4 deletions src/constants/visibility.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export default {
Public: {
name: 'preferences.general.toot.visibility.public',
name: 'settings.general.toot.visibility.public',
value: 0,
key: 'public'
},
Unlisted: {
name: 'preferences.general.toot.visibility.unlisted',
name: 'settings.general.toot.visibility.unlisted',
value: 1,
key: 'unlisted'
},
Private: {
name: 'preferences.general.toot.visibility.private',
name: 'settings.general.toot.visibility.private',
value: 2,
key: 'private'
},
Direct: {
name: 'preferences.general.toot.visibility.direct',
name: 'settings.general.toot.visibility.direct',
value: 3,
key: 'direct'
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/preferences.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import storage from 'electron-json-storage'
import objectAssignDeep from 'object-assign-deep'
import Visibility from '../constants/visibility'
import DisplayStyle from '../constants/displayStyle'
import Theme from '../constants/theme'
import Language from '../constants/language'
Expand All @@ -13,8 +12,7 @@ const Base = {
sound: {
fav_rb: true,
toot: true
},
tootVisibility: Visibility.Public.value
}
},
state: {
collapse: false,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/GlobalHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default {
left: 0;
width: 65px;
padding-top: 24px;
border: 0;
.el-tooltip {
outline: 0;
Expand Down
30 changes: 0 additions & 30 deletions src/renderer/components/Preferences/General.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
<template>
<div id="general" v-loading="loading">
<h2>{{ $t('preferences.general.title') }}</h2>
<div class="toot section">
<h3>{{ $t('preferences.general.toot.title') }}</h3>
<p class="description">{{ $t('preferences.general.toot.description') }}</p>
<el-select v-model="tootVisibility" placeholder="visibility">
<el-option
v-for="v in visibilities"
:key="v.value"
:label="$t(v.name)"
:value="v.value">
</el-option>
</el-select>
</div>
<div class="sounds section">
<h3>{{ $t('preferences.general.sounds.title') }}</h3>
<p class="description">{{ $t('preferences.general.sounds.description') }}</p>
Expand Down Expand Up @@ -40,31 +28,13 @@

<script>
import { mapState } from 'vuex'
import Visibility from '~/src/constants/visibility'
export default {
name: 'general',
data () {
return {
visibilities: [
Visibility.Public,
Visibility.Unlisted,
Visibility.Private
]
}
},
computed: {
...mapState({
loading: state => state.Preferences.General.loading
}),
tootVisibility: {
get () {
return this.$store.state.Preferences.General.general.tootVisibility
},
set (value) {
this.$store.dispatch('Preferences/General/updateTootVisibility', value)
}
},
sound_fav_rb: {
get () {
return this.$store.state.Preferences.General.general.sound.fav_rb
Expand Down
Loading

0 comments on commit 9510835

Please sign in to comment.