Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Merge requests
!35
Make it possible to run multiple versions of briar-desktop concurrently
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Make it possible to run multiple versions of briar-desktop concurrently
77-run-two-instances-in-parallel
into
main
Overview
27
Commits
14
Pipelines
21
Changes
8
Merged
Sebastian
requested to merge
77-run-two-instances-in-parallel
into
main
3 years ago
Overview
3
Commits
14
Pipelines
21
Changes
8
Expand
Closes
#77 (closed)
Edited
3 years ago
by
Sebastian
0
0
Merge request reports
Compare
main
version 24
5c2fdb9f
3 years ago
version 23
2eae3c02
3 years ago
version 22
e054e59e
3 years ago
version 21
936c9763
3 years ago
version 20
ca8646ed
3 years ago
version 19
c582af4b
3 years ago
version 18
02c8ec81
3 years ago
version 17
02c8ec81
3 years ago
version 16
02c8ec81
3 years ago
version 15
65cef945
3 years ago
version 14
af27e9e6
3 years ago
version 13
a097ae4a
3 years ago
version 12
a451b3e4
3 years ago
version 11
a451b3e4
3 years ago
version 10
a451b3e4
3 years ago
version 9
585836b8
3 years ago
version 8
00c5b2c2
3 years ago
version 7
7102da4a
3 years ago
version 6
fda2c9f0
3 years ago
version 5
2ee91545
3 years ago
version 4
e401d796
3 years ago
version 3
8d70df0d
3 years ago
version 2
352d420c
3 years ago
version 1
352d420c
3 years ago
main (base)
and
version 2
latest version
ef03b9a6
14 commits,
3 years ago
version 24
5c2fdb9f
14 commits,
3 years ago
version 23
2eae3c02
14 commits,
3 years ago
version 22
e054e59e
14 commits,
3 years ago
version 21
936c9763
13 commits,
3 years ago
version 20
ca8646ed
13 commits,
3 years ago
version 19
c582af4b
12 commits,
3 years ago
version 18
02c8ec81
12 commits,
3 years ago
version 17
02c8ec81
12 commits,
3 years ago
version 16
02c8ec81
12 commits,
3 years ago
version 15
65cef945
11 commits,
3 years ago
version 14
af27e9e6
9 commits,
3 years ago
version 13
a097ae4a
8 commits,
3 years ago
version 12
a451b3e4
7 commits,
3 years ago
version 11
a451b3e4
9 commits,
3 years ago
version 10
a451b3e4
9 commits,
3 years ago
version 9
585836b8
9 commits,
3 years ago
version 8
00c5b2c2
7 commits,
3 years ago
version 7
7102da4a
7 commits,
3 years ago
version 6
fda2c9f0
7 commits,
3 years ago
version 5
2ee91545
6 commits,
3 years ago
version 4
e401d796
6 commits,
3 years ago
version 3
8d70df0d
5 commits,
3 years ago
version 2
352d420c
3 commits,
3 years ago
version 1
352d420c
11 commits,
3 years ago
8 files
+
179
−
60
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
src/main/kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt
+
55
−
53
Options
package
org.briarproject.briar.desktop.ui
import
androidx.compose.runtime.Composable
import
androidx.compose.runtime.CompositionLocalProvider
import
androidx.compose.runtime.compositionLocalOf
import
androidx.compose.runtime.getValue
import
androidx.compose.runtime.mutableStateOf
import
androidx.compose.runtime.remember
import
androidx.compose.runtime.setValue
import
androidx.compose.ui.window.ApplicationScope
import
androidx.compose.ui.window.Window
import
androidx.compose.ui.window.application
import
org.briarproject.bramble.api.account.AccountManager
import
org.briarproject.bramble.api.contact.ContactManager
import
org.briarproject.bramble.api.identity.IdentityManager
@@ -37,7 +38,8 @@ enum class Screen {
interface
BriarUi
{
fun
start
()
@Composable
fun
start
(
applicationScope
:
ApplicationScope
)
fun
stop
()
}
@@ -77,57 +79,57 @@ constructor(
}
}
override
fun
start
()
{
a
pplication
{
val
(
isDark
,
setDark
)
=
remember
{
mutableStateOf
(
true
)
}
val
title
=
"Briar Desktop"
var
screenState
by
remember
{
mutableStateOf
(
if
(
accountManager
.
hasDatabaseKey
())
{
// this should only happen during testing when we launch the main UI directly
// without a need to enter the password.
contactListViewModel
.
loadContacts
()
Screen
.
MAIN
}
else
if
(
accountManager
.
accountExists
())
{
Screen
.
LOGIN
}
else
{
Screen
.
REGISTRATION
}
)
}
Window
(
title
=
title
,
onCloseRequest
=
{
stop
();
exitApplication
()
}
,
)
{
window
.
minimumSize
=
Dimension
(
800
,
600
)
BriarTheme
(
isDarkTheme
=
isDark
)
{
when
(
screenState
)
{
Screen
.
REGISTRATION
->
Registration
(
registrationViewModel
)
{
contactListViewModel
.
loadContacts
()
screenState
=
Screen
.
MAIN
}
Screen
.
LOGIN
->
Login
(
loginViewModel
)
{
contactListViewModel
.
loadContacts
()
screenState
=
Screen
.
MAIN
}
else
->
CompositionLocalProvider
(
CVM
provides
conversationManag
er
,
CT
M
provides
con
tact
Manager
,
M
M
provides
messaging
Manager
,
I
M
provides
identity
Manager
,
)
{
MainScreen
(
contactListViewModel
,
addC
ontactViewModel
,
introduction
ViewModel
,
isDark
,
set
Dark
)
}
}
@Composable
override
fun
start
(
applicationScope
:
A
pplication
Scope
)
{
val
(
isDark
,
setDark
)
=
remember
{
mutableStateOf
(
true
)
}
val
title
=
"Briar Desktop"
var
screenState
by
remember
{
mutableStateOf
(
if
(
accountManager
.
hasDatabaseKey
())
{
// this should only happen during testing when we launch the main UI directly
// without a need to enter the password.
contactListViewModel
.
loadContacts
()
Screen
.
MAIN
}
else
if
(
accountManager
.
accountExists
())
{
Screen
.
LOGIN
}
else
{
Screen
.
REGISTRATION
}
)
}
Window
(
title
=
title
,
onCloseRequest
=
{
stop
();
applicationScope
.
exitApplication
()
},
)
{
window
.
minimumSize
=
Dimension
(
800
,
600
)
BriarTheme
(
isDarkTheme
=
isDark
)
{
when
(
screenState
)
{
Screen
.
REGISTRATION
->
Registration
(
registrationViewModel
)
{
contactListViewModel
.
loadContacts
()
screenState
=
Screen
.
MAIN
}
Screen
.
LOGIN
->
Login
(
loginViewModel
)
{
contactListViewModel
.
loadContacts
()
screenState
=
Screen
.
MAIN
}
else
->
CompositionLocalProvid
er
(
CV
M
provides
con
versation
Manager
,
CT
M
provides
contact
Manager
,
M
M
provides
messaging
Manager
,
IM
provides
identityManager
,
)
{
MainScreen
(
c
ontact
List
ViewModel
,
addContact
ViewModel
,
introductionViewModel
,
is
Dark
,
setDark
)
}
}
}
}
Loading