Removed some Connect Functions, some import cycles remain

This commit is contained in:
aditya-K2 2022-09-02 01:30:17 +05:30
parent 4ae005cbe7
commit 7e5df526c3
2 changed files with 4 additions and 13 deletions

View File

@ -50,9 +50,6 @@ func main() {
ui.Ui = ui.NewApplication()
// Connecting the Notification Server to the Main UI
notify.ConnectUI(ui.Ui)
fileMap, err := CONN.ListAllInfo("/")
if err != nil {
utils.Print("RED", "Could Not Generate the File Map\n")

View File

@ -4,7 +4,6 @@ import (
"time"
"github.com/aditya-K2/gomp/ui"
"github.com/aditya-K2/gomp/utils"
"github.com/aditya-K2/tview"
@ -12,7 +11,6 @@ import (
)
var (
UI *ui.Application
Notify *NotificationServer
)
@ -22,10 +20,6 @@ type Notification struct {
Text string
}
func ConnectUI(a *ui.Application) {
UI = a
}
/* Get A Pointer to A Notification Struct */
func NewNotification(s string) *Notification {
return &Notification{
@ -80,11 +74,11 @@ func NotificationRoutine(c chan string, s string) {
if s != "EMPTY NOTIFICATION" {
go func() {
currentTime := time.Now().String()
UI.Pages.AddPage(currentTime, NewNotification(s), false, true)
UI.App.SetFocus(UI.ExpandedView)
ui.Ui.Pages.AddPage(currentTime, NewNotification(s), false, true)
ui.Ui.App.SetFocus(ui.Ui.ExpandedView)
time.Sleep(time.Second * 1)
UI.Pages.RemovePage(currentTime)
UI.App.SetFocus(UI.ExpandedView)
ui.Ui.Pages.RemovePage(currentTime)
ui.Ui.App.SetFocus(ui.Ui.ExpandedView)
}()
}
NewNotification := <-c