Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
afb72301
Commit
afb72301
authored
Feb 22, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsUi): view in progress, add a `FileChooserButton` component
parent
b3ab7405
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
214 additions
and
9 deletions
+214
-9
file.png
linphone-desktop/assets/images/file.png
+0
-0
en.ts
linphone-desktop/assets/languages/en.ts
+15
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+15
-0
resources.qrc
linphone-desktop/resources.qrc
+3
-0
FileChooserButton.qml
...ktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml
+93
-0
NumericField.qml
...ne-desktop/ui/modules/Common/Form/Fields/NumericField.qml
+1
-7
TextField.qml
linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml
+5
-0
FileChooserButtonStyle.qml
...les/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml
+22
-0
qmldir
linphone-desktop/ui/modules/Common/Styles/qmldir
+1
-0
qmldir
linphone-desktop/ui/modules/Common/qmldir
+1
-0
utils.js
linphone-desktop/ui/scripts/Utils/utils.js
+16
-2
SettingsUi.qml
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
+42
-0
No files found.
linphone-desktop/assets/images/file.png
0 → 100644
View file @
afb72301
596 Bytes
linphone-desktop/assets/languages/en.ts
View file @
afb72301
...
...
@@ -837,6 +837,21 @@ Server url not configured.</translation>
<
translation
>
Enable
adaptive
rate
control
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
message
>
<
source
>
pathsTitle
<
/source
>
<
translation
>
Paths
<
/translation
>
<
/message
>
<
message
>
<
source
>
savedScreenshotsLabel
<
/source
>
<
translation
>
Saved
screenshots
folder
<
/translation
>
<
/message
>
<
message
>
<
source
>
savedVideosLabel
<
/source
>
<
translation
>
Saved
videos
folder
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsWindow
<
/name
>
<
message
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
afb72301
...
...
@@ -847,6 +847,21 @@ Url du serveur non configurée.</translation>
<
translation
>
Activer
le
contr
ô
le
de
d
é
bit
adaptif
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
message
>
<
source
>
pathsTitle
<
/source
>
<
translation
>
Chemins
<
/translation
>
<
/message
>
<
message
>
<
source
>
savedScreenshotsLabel
<
/source
>
<
translation
>
Dossier
des
captures
d
&
apos
;
é
crans
<
/translation
>
<
/message
>
<
message
>
<
source
>
savedVideosLabel
<
/source
>
<
translation
>
Dossier
des
captures
vid
é
os
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsWindow
<
/name
>
<
message
>
...
...
linphone-desktop/resources.qrc
View file @
afb72301
...
...
@@ -78,6 +78,7 @@
<file>
assets/images/edit_normal.svg
</file>
<file>
assets/images/edit_pressed.svg
</file>
<file>
assets/images/ended_call.svg
</file>
<file>
assets/images/file.png
</file>
<file>
assets/images/file_sign.svg
</file>
<file>
assets/images/filter.svg
</file>
<file>
assets/images/fullscreen_hovered.svg
</file>
...
...
@@ -177,6 +178,7 @@
<file>
ui/modules/Common/Form/ActionSwitch.qml
</file>
<file>
ui/modules/Common/Form/Buttons/AbstractTextButton.qml
</file>
<file>
ui/modules/Common/Form/Buttons/ExclusiveButtons.qml
</file>
<file>
ui/modules/Common/Form/Buttons/FileChooserButton.qml
</file>
<file>
ui/modules/Common/Form/Buttons/SmallButton.qml
</file>
<file>
ui/modules/Common/Form/Buttons/TextButtonA.qml
</file>
<file>
ui/modules/Common/Form/Buttons/TextButtonB.qml
</file>
...
...
@@ -224,6 +226,7 @@
<file>
ui/modules/Common/Styles/Form/ActionBarStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/AbstractTextButtonStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/ExclusiveButtonsStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/SmallButtonStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/TextButtonAStyle.qml
</file>
<file>
ui/modules/Common/Styles/Form/Buttons/TextButtonBStyle.qml
</file>
...
...
linphone-desktop/ui/modules/Common/Form/Buttons/FileChooserButton.qml
0 → 100644
View file @
afb72301
import
QtQuick
2.7
import
QtQuick
.
Dialogs
1.2
import
Common
1.0
import
Common
.
Styles
1.0
import
Utils
1.0
// =============================================================================
TextField
{
id
:
textField
// ---------------------------------------------------------------------------
property
alias
selectExisting
:
fileDialog
.
selectExisting
property
alias
selectFolder
:
fileDialog
.
selectFolder
property
alias
title
:
fileDialog
.
title
property
string
selectedFile
:
''
// ---------------------------------------------------------------------------
signal
accepted
(
var
selectedFile
)
signal
rejected
// ---------------------------------------------------------------------------
text
:
{
var
path
=
textField
.
selectedFile
return
path
.
length
?
Utils
.
basename
(
path
)
:
''
}
tools
:
Item
{
height
:
parent
.
height
width
:
FileChooserButtonStyle
.
tools
.
width
Rectangle
{
anchors
{
fill
:
parent
margins
:
TextFieldStyle
.
background
.
border
.
width
}
color
:
mouseArea
.
pressed
?
FileChooserButtonStyle
.
tools
.
button
.
color
.
pressed
:
(
mouseArea
.
containsMouse
?
FileChooserButtonStyle
.
tools
.
button
.
color
.
hovered
:
FileChooserButtonStyle
.
tools
.
button
.
color
.
normal
)
Icon
{
anchors.centerIn
:
parent
// TODO: Set icon file or folder.
iconSize
:
FileChooserButtonStyle
.
tools
.
button
.
iconSize
}
}
}
// ---------------------------------------------------------------------------
FileDialog
{
id
:
fileDialog
folder
:
{
if
(
!
textField
.
selectedFile
.
length
)
{
return
''
}
var
folder
=
Utils
.
dirname
(
textField
.
selectedFile
)
return
!
Utils
.
startsWith
(
folder
,
'
file:
'
)
?
'
file:
'
+
folder
:
folder
}
onAccepted
:
{
textField
.
selectedFile
=
fileUrl
.
toString
().
substring
(
7
)
textField
.
accepted
(
textField
.
selectedFile
)
}
onRejected
:
textField
.
rejected
()
}
// ---------------------------------------------------------------------------
MouseArea
{
id
:
mouseArea
anchors.fill
:
parent
hoverEnabled
:
true
onClicked
:
fileDialog
.
open
()
}
}
linphone-desktop/ui/modules/Common/Form/Fields/NumericField.qml
View file @
afb72301
...
...
@@ -35,13 +35,7 @@ TextField {
text
:
minValue
tools
:
Rectangle
{
border
{
color
:
TextFieldStyle
.
background
.
border
.
color
width
:
TextFieldStyle
.
background
.
border
.
width
}
color
:
'
transparent
'
// Not a style.
tools
:
Item
{
height
:
parent
.
height
width
:
NumericFieldStyle
.
tools
.
width
...
...
linphone-desktop/ui/modules/Common/Form/Fields/TextField.qml
View file @
afb72301
...
...
@@ -38,6 +38,11 @@ Controls.TextField {
Rectangle
{
id
:
toolsContainer
border
{
color
:
TextFieldStyle
.
background
.
border
.
color
width
:
TextFieldStyle
.
background
.
border
.
width
}
anchors.fill
:
parent
color
:
background
.
color
data
:
tools
||
[]
...
...
linphone-desktop/ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml
0 → 100644
View file @
afb72301
pragma
Singleton
import
QtQuick
2.7
import
Common
1.0
// =============================================================================
QtObject
{
property
QtObject
tools
:
QtObject
{
property
int
width
:
30
property
QtObject
button
:
QtObject
{
property
int
iconSize
:
16
property
QtObject
color
:
QtObject
{
property
color
hovered
:
Colors
.
c
property
color
normal
:
Colors
.
q
property
color
pressed
:
Colors
.
c
}
}
}
}
linphone-desktop/ui/modules/Common/Styles/qmldir
View file @
afb72301
...
...
@@ -10,6 +10,7 @@ singleton DialogStyle 1.0 Dialog/DialogStyle.qml
singleton AbstractTextButtonStyle 1.0 Form/Buttons/AbstractTextButtonStyle.qml
singleton ExclusiveButtonsStyle 1.0 Form/Buttons/ExclusiveButtonsStyle.qml
singleton FileChooserButtonStyle 1.0 Form/Buttons/FileChooserButtonStyle.qml
singleton SmallButtonStyle 1.0 Form/Buttons/SmallButtonStyle.qml
singleton TextButtonAStyle 1.0 Form/Buttons/TextButtonAStyle.qml
singleton TextButtonBStyle 1.0 Form/Buttons/TextButtonBStyle.qml
...
...
linphone-desktop/ui/modules/Common/qmldir
View file @
afb72301
...
...
@@ -29,6 +29,7 @@ TransparentComboBox 1.0 Form/TransparentComboBox.qml
TransparentTextInput 1.0 Form/TransparentTextInput.qml
ExclusiveButtons 1.0 Form/Buttons/ExclusiveButtons.qml
FileChooserButton 1.0 Form/Buttons/FileChooserButton.qml
TextButtonA 1.0 Form/Buttons/TextButtonA.qml
TextButtonB 1.0 Form/Buttons/TextButtonB.qml
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
afb72301
...
...
@@ -262,13 +262,27 @@ function assert (condition, message) {
// -----------------------------------------------------------------------------
function
basename
(
str
)
{
return
str
.
slice
(
str
.
lastIndexOf
(
'
/
'
)
+
1
)
var
str2
=
str
var
length
=
str2
.
length
-
1
if
(
str2
[
length
]
===
'
/
'
)
{
str2
=
str2
.
substring
(
0
,
length
)
}
return
str2
.
slice
(
str2
.
lastIndexOf
(
'
/
'
)
+
1
)
}
// -----------------------------------------------------------------------------
function
dirname
(
str
)
{
return
str
.
slice
(
0
,
str
.
lastIndexOf
(
'
/
'
)
+
1
)
var
str2
=
str
var
length
=
str2
.
length
-
1
if
(
str2
[
length
]
===
'
/
'
)
{
str2
=
str2
.
substring
(
0
,
length
)
}
return
str2
.
slice
(
0
,
str2
.
lastIndexOf
(
'
/
'
)
+
1
)
}
// -----------------------------------------------------------------------------
...
...
linphone-desktop/ui/views/App/Settings/SettingsUi.qml
View file @
afb72301
...
...
@@ -2,8 +2,50 @@ import QtQuick 2.7
import
Common
1.0
import
App
.
Styles
1.0
// =============================================================================
TabContainer
{
Column
{
spacing
:
SettingsWindowStyle
.
forms
.
spacing
width
:
parent
.
width
// -------------------------------------------------------------------------
// Languages.
// -------------------------------------------------------------------------
// TODO
// -------------------------------------------------------------------------
// Paths.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
pathsTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
savedScreenshotsLabel
'
)
FileChooserButton
{
id
:
savedScreenshotsFolder
selectFolder
:
true
}
}
FormGroup
{
label
:
qsTr
(
'
savedVideosLabel
'
)
FileChooserButton
{
id
:
savedVideosFolder
selectFolder
:
true
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment