-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f1b335
commit 662578a
Showing
38 changed files
with
502 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...son/git/link/extensions/ListExtensions.kt → ...bson/git/link/extension/ListExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/main/kotlin/uk/co/ben_gibson/git/link/git/HostLocator.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
src/main/kotlin/uk/co/ben_gibson/git/link/listener/ApplicationStartupListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package uk.co.ben_gibson.git.link.listener | ||
|
||
import com.intellij.openapi.components.service | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.startup.StartupActivity | ||
import uk.co.ben_gibson.git.link.GitLinkBundle | ||
import uk.co.ben_gibson.git.link.platform.PlatformDetector | ||
import uk.co.ben_gibson.git.link.settings.ApplicationSettings | ||
import uk.co.ben_gibson.git.link.settings.ProjectSettings | ||
import uk.co.ben_gibson.git.link.ui.notification.Notification | ||
import uk.co.ben_gibson.git.link.ui.notification.sendNotification | ||
|
||
class ApplicationStartupListener : StartupActivity.DumbAware { | ||
override fun runActivity(project: Project) { | ||
showVersionNotification(project) | ||
detectPlatform(project) | ||
} | ||
|
||
private fun showVersionNotification(project: Project) { | ||
val settings = service<ApplicationSettings>() | ||
val version = GitLinkBundle.plugin()?.version | ||
|
||
if (version == settings.lastVersion) { | ||
return | ||
} | ||
|
||
settings.lastVersion = version | ||
sendNotification(Notification.welcome(version ?: "Unknown"), project) | ||
} | ||
|
||
private fun detectPlatform(project: Project) { | ||
val projectSettings = project.service<ProjectSettings>() | ||
|
||
if (projectSettings.host != null) { | ||
return | ||
} | ||
|
||
val platform = project.service<PlatformDetector>().detect() | ||
|
||
if (platform == null) { | ||
sendNotification(Notification.couldNotDetectPlatform(project), project) | ||
return | ||
} | ||
|
||
sendNotification(Notification.platformAutoDetected(platform, project), project) | ||
|
||
projectSettings.host = platform.id.toString() | ||
} | ||
} |
60 changes: 0 additions & 60 deletions
60
src/main/kotlin/uk/co/ben_gibson/git/link/listeners/ApplicationStartupListener.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...git/link/pipeline/ForceHttpsMiddleware.kt → ...it/link/pipeline/middleware/ForceHttps.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...en_gibson/git/link/pipeline/Middleware.kt → ...it/link/pipeline/middleware/Middleware.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
.../git/link/pipeline/RecordHitMiddleware.kt → ...git/link/pipeline/middleware/RecordHit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
...link/pipeline/ResolveContextMiddleware.kt → ...ink/pipeline/middleware/ResolveContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.