Removed some Connect Functions, some import cycles remain
This commit is contained in:
parent
4ae005cbe7
commit
7e5df526c3
3
main.go
3
main.go
@ -50,9 +50,6 @@ func main() {
|
|||||||
|
|
||||||
ui.Ui = ui.NewApplication()
|
ui.Ui = ui.NewApplication()
|
||||||
|
|
||||||
// Connecting the Notification Server to the Main UI
|
|
||||||
notify.ConnectUI(ui.Ui)
|
|
||||||
|
|
||||||
fileMap, err := CONN.ListAllInfo("/")
|
fileMap, err := CONN.ListAllInfo("/")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Print("RED", "Could Not Generate the File Map\n")
|
utils.Print("RED", "Could Not Generate the File Map\n")
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aditya-K2/gomp/ui"
|
"github.com/aditya-K2/gomp/ui"
|
||||||
|
|
||||||
"github.com/aditya-K2/gomp/utils"
|
"github.com/aditya-K2/gomp/utils"
|
||||||
|
|
||||||
"github.com/aditya-K2/tview"
|
"github.com/aditya-K2/tview"
|
||||||
@ -12,7 +11,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
UI *ui.Application
|
|
||||||
Notify *NotificationServer
|
Notify *NotificationServer
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,10 +20,6 @@ type Notification struct {
|
|||||||
Text string
|
Text string
|
||||||
}
|
}
|
||||||
|
|
||||||
func ConnectUI(a *ui.Application) {
|
|
||||||
UI = a
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get A Pointer to A Notification Struct */
|
/* Get A Pointer to A Notification Struct */
|
||||||
func NewNotification(s string) *Notification {
|
func NewNotification(s string) *Notification {
|
||||||
return &Notification{
|
return &Notification{
|
||||||
@ -80,11 +74,11 @@ func NotificationRoutine(c chan string, s string) {
|
|||||||
if s != "EMPTY NOTIFICATION" {
|
if s != "EMPTY NOTIFICATION" {
|
||||||
go func() {
|
go func() {
|
||||||
currentTime := time.Now().String()
|
currentTime := time.Now().String()
|
||||||
UI.Pages.AddPage(currentTime, NewNotification(s), false, true)
|
ui.Ui.Pages.AddPage(currentTime, NewNotification(s), false, true)
|
||||||
UI.App.SetFocus(UI.ExpandedView)
|
ui.Ui.App.SetFocus(ui.Ui.ExpandedView)
|
||||||
time.Sleep(time.Second * 1)
|
time.Sleep(time.Second * 1)
|
||||||
UI.Pages.RemovePage(currentTime)
|
ui.Ui.Pages.RemovePage(currentTime)
|
||||||
UI.App.SetFocus(UI.ExpandedView)
|
ui.Ui.App.SetFocus(ui.Ui.ExpandedView)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
NewNotification := <-c
|
NewNotification := <-c
|
||||||
|
Loading…
Reference in New Issue
Block a user