Skip to content

Commit

Permalink
Merge pull request #26 from korapp/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
korapp authored Jan 1, 2024
2 parents 2b1da4a + fe400ec commit eea79c9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 18 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Close inactive issues
on:
schedule:
- cron: "* * */7 * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
any-of-issue-labels: "question"
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion plasmoid/contents/ui/ConnectionItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PlasmaExtras.ExpandableListItem {

title: model.title
subtitle: model.subtitle
icon: flags.isFlagString(model.icon) ? flags.getFlagImage(model.icon) : model.icon
icon: resolveIcon(model.icon)
iconEmblem: model.indicator
visible: model.visible
defaultActionButtonAction: model.isConnected ? actionDisconnect : actionConnect
Expand Down
4 changes: 2 additions & 2 deletions plasmoid/contents/ui/FavoriteItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ PlasmaComponents3.ToolButton {

contentItem: RowLayout {
PlasmaCore.IconItem {
source: flags.isFlagString(model.icon) ? flags.getFlagImage(model.icon) : model.icon
source: resolveIcon(model.icon)
implicitWidth: PlasmaCore.Units.iconSizes.medium
implicitHeight: PlasmaCore.Units.iconSizes.medium
enabled: !busy

PlasmaCore.IconItem {
visible: !!model.indicator
source: model.indicator
source: resolveIcon(model.indicator)
width: parent.width / 2
height: parent.height / 2
enabled: parent.enabled
Expand Down
3 changes: 1 addition & 2 deletions plasmoid/contents/ui/NordVPNModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ QtObject {
}

function createFavoriteModel(f) {
const icon = (f.group && Globals.Icons[f.group]) || (f.country && flags.getFlagName(f.country)) || Globals.Icons.globe
return createModel({
icon,
icon: getFavoriteIcon(f),
indicator: f.group && f.country ? flags.getFlagName(f.country) : '',
title: f.group || f.city || f.country || i18n("Auto"),
subtitle: f.group ? f.city || f.country : f.city ? f.country : '',
Expand Down
22 changes: 9 additions & 13 deletions plasmoid/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Item {
favoriteConnections.forEach((f, i) => plasmoid.setAction(
i,
Object.values(f).filter(Boolean).join(" > "),
(f.group && Globals.Icons[f.group]) || (f.country && flags.getLegacyFlagUrl(f.country)) || Globals.Icons.globe
getFavoriteIcon(f, true)
))
}

Expand Down Expand Up @@ -86,23 +86,19 @@ Item {
function getLegacyFlagUrl(countryName) {
return legacyIconsDir + Country.codes[countryName].toLowerCase() + "/flag.png"
}
}

function skipUrlSchema(urlString) {
return /(?:.*:\/\/)?(.*)/.exec(urlString)[1]
function skipUrlSchema(urlString) {
return /(?:.*:\/\/)?(.*)/.exec(urlString)[1]
}
}

function getFavoriteIcon(f) {
if (f.group) {
return Globals.Icons[f.group]
} else if (f.country) {
return flags.getLegacyFlagUrl(f.country)
}
return Globals.Icons.globe
function resolveIcon(source) {
return flags.isFlagString(source) ? flags.getFlagImage(source) : source
}

Exec {
id: cmd
function getFavoriteIcon(f, legacyFlag) {
const getFlag = legacyFlag ? flags.getLegacyFlagUrl : flags.getFlagName
return (f.group && Globals.Icons[f.group]) || (f.country && getFlag(f.country)) || Globals.Icons.globe
}

PlasmaCore.DataSource {
Expand Down

0 comments on commit eea79c9

Please sign in to comment.