Skip to content

Commit

Permalink
cmd/trayscale: set switch activation manually along with state (#44)
Browse files Browse the repository at this point in the history
* cmd/trayscale: set switch activation manually along with state

The behavior of this seems to have changed recently. It's possible that
the previous behavior was actually a bug. Either way, this seems to work
correctly now.

* meta: run `apt-get update` before installing CI dependencies

* meta: add release info for v0.8.5
  • Loading branch information
DeedleFake authored Mar 29, 2023
1 parent 50620ec commit e92485f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get install -y ${{ env.dependencies }}
run: |
sudo apt-get update
sudo apt-get install -y ${{ env.dependencies }}
- name: Setup Go
uses: actions/setup-go@v4
with:
Expand All @@ -34,7 +36,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get install -y ${{ env.dependencies }}
run: |
sudo apt-get update
sudo apt-get install -y ${{ env.dependencies }}
- name: Setup Go
uses: actions/setup-go@v4
with:
Expand All @@ -51,7 +55,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get install -y ${{ env.dependencies }}
run: |
sudo apt-get update
sudo apt-get install -y ${{ env.dependencies }}
- name: Setup Go
uses: actions/setup-go@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions cmd/trayscale/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ func (a *App) updatePeerPage(page *peerPage, peer *ipnstate.PeerStatus, prefs *i
page.container.OptionsGroup.SetVisible(page.self)
if page.self {
page.container.AdvertiseExitNodeSwitch.SetState(prefs.AdvertisesExitNode())
page.container.AdvertiseExitNodeSwitch.SetActive(prefs.AdvertisesExitNode())
page.container.AllowLANAccessSwitch.SetState(prefs.ExitNodeAllowLANAccess)
page.container.AllowLANAccessSwitch.SetActive(prefs.ExitNodeAllowLANAccess)
}

page.container.AdvertiseRouteButton.SetVisible(page.self)
Expand Down Expand Up @@ -146,6 +148,7 @@ func (a *App) updatePeerPage(page *peerPage, peer *ipnstate.PeerStatus, prefs *i
page.container.MiscGroup.SetVisible(!page.self)
page.container.ExitNodeRow.SetVisible(peer.ExitNodeOption)
page.container.ExitNodeSwitch.SetState(peer.ExitNode)
page.container.ExitNodeSwitch.SetActive(peer.ExitNode)
page.container.RxBytes.SetText(strconv.FormatInt(peer.RxBytes, 10))
page.container.TxBytes.SetText(strconv.FormatInt(peer.TxBytes, 10))
page.container.Created.SetText(formatTime(peer.Created))
Expand Down Expand Up @@ -238,6 +241,7 @@ func (a *App) update(status *ipnstate.Status, prefs *ipn.Prefs) {
}

a.win.StatusSwitch.SetState(online)
a.win.StatusSwitch.SetActive(online)
a.updatePeers(status, prefs)
}

Expand Down
8 changes: 8 additions & 0 deletions dev.deedles.Trayscale.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
<content_rating type="oars-1.1" />

<releases>
<release version="v0.8.5" date="2023-03-28">
<description>
<ul>
<li>Fix switch state management for newer versions of Gtk4.</li>
<li>Update GNOME runtime to version 44.</li>
</ul>
</description>
</release>
<release version="v0.8.4" date="2023-03-27">
<description>
<ul>
Expand Down

0 comments on commit e92485f

Please sign in to comment.