Terminal Mode ( Studio )

Some changes for the terminal mode. And also
some changes to support cursor changes. Might
have a weird effect on the Operating System.
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2021-01-11 20:48:25 +00:00
parent c4df06615d
commit ff3f1e7101
3 changed files with 29 additions and 3 deletions

View file

@ -4,7 +4,10 @@
# This a console project manager.
import os
w, h = os.get_terminal_size()
try:
w, h = os.get_terminal_size()
except:
w, h, = 50,50
from settings import settings
from settings import talk
@ -47,6 +50,8 @@ def cls():
#cleaning the terminal
os.system("clear")
def run():
cls()
@ -141,6 +146,8 @@ def run():
elif command == "project":
commands = pm_project.get_list()
n = input("\033[1;33m : ")
print("\033[1;35m "+talk.text("Wait"))
pm_project.load(n)

View file

@ -8,6 +8,7 @@ import datetime
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
import cairo
import threading
@ -163,6 +164,16 @@ def pmdrawing(pmdrawing, main_layer, win):
win.sFPS = datetime.datetime.now()
win.cursors = {
"arrow":Gdk.Cursor.new(Gdk.CursorType.ARROW),
"watch":Gdk.Cursor.new(Gdk.CursorType.WATCH),
"text" :Gdk.Cursor.new(Gdk.CursorType.XTERM),
"hand" :Gdk.Cursor.new(Gdk.CursorType.HAND1),
"cross":Gdk.Cursor.new(Gdk.CursorType.CROSS)
}
win.current["cursor"] = win.cursors["arrow"]
# Getting update info. I've added a bit of delay. So the starting of the
# Popen would not be noticed by the user as much.
#if win.current["frame"] > 50:
@ -235,6 +246,8 @@ def pmdrawing(pmdrawing, main_layer, win):
main_layer.set_source_surface(layer, 0 , 0)
main_layer.paint()
win.get_root_window().set_cursor(win.current["cursor"])
# If you press ESC you get back from any window to the main menu.
if 65307 in win.current["keys"] and win.url != "install_updates":
win.url = "project_manager"

View file

@ -1,13 +1,14 @@
# THIS FILE IS A PART OF VCStudio
# PYTHON 3
# this file handles language
import os
import sys
import subprocess
from settings import settings
from settings import talk
from studio import studio_gtk
from studio_console import sc_main
from gi.repository import GLib
def new(name):
@ -110,7 +111,12 @@ def load(path, win=False):
#if new
if not is_legacy(path):
studio_gtk.run(path, win)
# Console mode
if len(sys.argv) > 1 and sys.argv[1] == "-c":
sc_main.run(path)
else:
studio_gtk.run(path, win)
#old organizer
else: