File tree Expand file tree Collapse file tree
app-android/app/src/main/kotlin/com/algoritmico/passepartout/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: 2026 Davide De Rosa
2+ //
3+ // SPDX-License-Identifier: GPL-3.0
4+
5+ package com.algoritmico.passepartout.ui
6+
7+ import androidx.compose.material3.AlertDialog
8+ import androidx.compose.material3.Text
9+ import androidx.compose.material3.TextButton
10+ import androidx.compose.runtime.Composable
11+
12+ @Composable
13+ fun FailureAlert (
14+ title : String ,
15+ message : String ,
16+ onDismiss : () -> Unit
17+ ) {
18+ AlertDialog (
19+ onDismissRequest = onDismiss,
20+ title = {
21+ Text (title)
22+ },
23+ text = {
24+ Text (message)
25+ },
26+ confirmButton = {
27+ TextButton (onClick = onDismiss) {
28+ Text (" OK" )
29+ }
30+ }
31+ )
32+ }
Original file line number Diff line number Diff line change @@ -6,11 +6,8 @@ package com.algoritmico.passepartout.ui
66
77import androidx.compose.foundation.isSystemInDarkTheme
88import androidx.compose.foundation.layout.fillMaxSize
9- import androidx.compose.material3.AlertDialog
109import androidx.compose.material3.MaterialTheme
1110import androidx.compose.material3.Surface
12- import androidx.compose.material3.Text
13- import androidx.compose.material3.TextButton
1411import androidx.compose.material3.darkColorScheme
1512import androidx.compose.material3.lightColorScheme
1613import androidx.compose.runtime.Composable
@@ -104,25 +101,3 @@ fun PassepartoutApp(
104101 }
105102 }
106103}
107-
108- @Composable
109- private fun FailureAlert (
110- title : String ,
111- message : String ,
112- onDismiss : () -> Unit
113- ) {
114- AlertDialog (
115- onDismissRequest = onDismiss,
116- title = {
117- Text (title)
118- },
119- text = {
120- Text (message)
121- },
122- confirmButton = {
123- TextButton (onClick = onDismiss) {
124- Text (" OK" )
125- }
126- }
127- )
128- }
Original file line number Diff line number Diff line change @@ -263,32 +263,6 @@ fun ProfileContainerView(
263263 )
264264}
265265
266- @Composable
267- private fun VpnPermissionDeniedAlert (
268- onDismiss : () -> Unit ,
269- onOpenSettings : () -> Unit
270- ) {
271- AlertDialog (
272- onDismissRequest = onDismiss,
273- title = {
274- Text (" VPN permission required" )
275- },
276- text = {
277- Text (" Passepartout needs VPN permission to start a connection." )
278- },
279- confirmButton = {
280- TextButton (onClick = onOpenSettings) {
281- Text (" Open VPN settings" )
282- }
283- },
284- dismissButton = {
285- TextButton (onClick = onDismiss) {
286- Text (" OK" )
287- }
288- }
289- )
290- }
291-
292266@Composable
293267private fun MobileProfilesView (
294268 modifier : Modifier ,
Original file line number Diff line number Diff line change 1+ // SPDX-FileCopyrightText: 2026 Davide De Rosa
2+ //
3+ // SPDX-License-Identifier: GPL-3.0
4+
5+ package com.algoritmico.passepartout.ui
6+
7+ import androidx.compose.material3.AlertDialog
8+ import androidx.compose.material3.Text
9+ import androidx.compose.material3.TextButton
10+ import androidx.compose.runtime.Composable
11+
12+ @Composable
13+ fun VpnPermissionDeniedAlert (
14+ onDismiss : () -> Unit ,
15+ onOpenSettings : () -> Unit
16+ ) {
17+ AlertDialog (
18+ onDismissRequest = onDismiss,
19+ title = {
20+ Text (" VPN permission required" )
21+ },
22+ text = {
23+ Text (" Passepartout needs VPN permission to start a connection." )
24+ },
25+ confirmButton = {
26+ TextButton (onClick = onOpenSettings) {
27+ Text (" Open VPN settings" )
28+ }
29+ },
30+ dismissButton = {
31+ TextButton (onClick = onDismiss) {
32+ Text (" OK" )
33+ }
34+ }
35+ )
36+ }
You can’t perform that action at this time.
0 commit comments