Added setting for CC on reply all

This commit is contained in:
Morgan McMillian 2016-11-04 14:16:03 -07:00
parent bafe3a26d3
commit 7162f8fa94
5 changed files with 66 additions and 6 deletions

View file

@ -257,7 +257,11 @@ Container {
} }
} }
if (mtext.length > 0) { if (mtext.length > 0) {
if (postitem.ListItem.view.ccOnReply()) {
return "\n/" + mtext return "\n/" + mtext
} else {
return mtext
}
} else { } else {
return "" return ""
} }

View file

@ -71,6 +71,45 @@ Page {
} }
} }
Divider {} Divider {}
Container {
layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
Container {
verticalAlignment: VerticalAlignment.Center
leftPadding: ui.sdu(3)
Label {
text: qsTr("Use CC on Reply All")
textStyle.fontSize: FontSize.Medium
textStyle.fontWeight: FontWeight.Bold
}
Label {
text: qsTr("Additional mentions follow /")
textStyle.fontSize: FontSize.Small
multiline: true
}
}
Container {
id: cctoggle
rightPadding: ui.sdu(3)
horizontalAlignment: HorizontalAlignment.Right
verticalAlignment: VerticalAlignment.Center
ToggleButton {
checked: _app.setting("cc")
onCheckedChanged: {
if (checked) {
_app.setSetting("cc", true)
reload()
} else {
_app.setSetting("cc", false)
reload()
}
}
accessibility.name: "carboncopy"
}
}
}
Divider {}
// Container { // Container {
// layout: DockLayout {} // layout: DockLayout {}
// horizontalAlignment: HorizontalAlignment.Fill // horizontalAlignment: HorizontalAlignment.Fill

View file

@ -106,6 +106,13 @@ NavigationPane {
function getPost(pid) { function getPost(pid) {
pnut.getPost(pid) pnut.getPost(pid)
} }
function ccOnReply() {
if (_app.setting("cc") === "true") {
return true
} else {
return false
}
}
attachedObjects: [ attachedObjects: [
ListScrollStateHandler { ListScrollStateHandler {
onAtEndChanged: { onAtEndChanged: {

View file

@ -1 +1 @@
230 233

View file

@ -158,26 +158,36 @@
<source>Include mentions in home stream</source> <source>Include mentions in home stream</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../assets/SettingsPage.qml" line="82"/>
<source>Use CC on Reply All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/SettingsPage.qml" line="87"/>
<source>Additional mentions follow /</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>StreamTab</name> <name>StreamTab</name>
<message> <message>
<location filename="../assets/StreamTab.qml" line="130"/> <location filename="../assets/StreamTab.qml" line="137"/>
<source>New Post</source> <source>New Post</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="144"/> <location filename="../assets/StreamTab.qml" line="151"/>
<source>To Top</source> <source>To Top</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="172"/> <location filename="../assets/StreamTab.qml" line="179"/>
<source>To Bottom</source> <source>To Bottom</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="159"/> <location filename="../assets/StreamTab.qml" line="166"/>
<source>Reload</source> <source>Reload</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>