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:
parent
c4df06615d
commit
ff3f1e7101
3 changed files with 29 additions and 3 deletions
|
@ -4,7 +4,10 @@
|
||||||
# This a console project manager.
|
# This a console project manager.
|
||||||
|
|
||||||
import os
|
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 settings
|
||||||
from settings import talk
|
from settings import talk
|
||||||
|
@ -47,6 +50,8 @@ def cls():
|
||||||
#cleaning the terminal
|
#cleaning the terminal
|
||||||
os.system("clear")
|
os.system("clear")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
|
||||||
cls()
|
cls()
|
||||||
|
@ -141,6 +146,8 @@ def run():
|
||||||
|
|
||||||
elif command == "project":
|
elif command == "project":
|
||||||
|
|
||||||
|
commands = pm_project.get_list()
|
||||||
|
|
||||||
n = input("\033[1;33m : ")
|
n = input("\033[1;33m : ")
|
||||||
print("\033[1;35m "+talk.text("Wait"))
|
print("\033[1;35m "+talk.text("Wait"))
|
||||||
pm_project.load(n)
|
pm_project.load(n)
|
||||||
|
|
|
@ -8,6 +8,7 @@ import datetime
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
from gi.repository import GLib
|
from gi.repository import GLib
|
||||||
import cairo
|
import cairo
|
||||||
import threading
|
import threading
|
||||||
|
@ -163,6 +164,16 @@ def pmdrawing(pmdrawing, main_layer, win):
|
||||||
|
|
||||||
win.sFPS = datetime.datetime.now()
|
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
|
# 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.
|
# Popen would not be noticed by the user as much.
|
||||||
#if win.current["frame"] > 50:
|
#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.set_source_surface(layer, 0 , 0)
|
||||||
main_layer.paint()
|
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 you press ESC you get back from any window to the main menu.
|
||||||
if 65307 in win.current["keys"] and win.url != "install_updates":
|
if 65307 in win.current["keys"] and win.url != "install_updates":
|
||||||
win.url = "project_manager"
|
win.url = "project_manager"
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
# THIS FILE IS A PART OF VCStudio
|
# THIS FILE IS A PART OF VCStudio
|
||||||
# PYTHON 3
|
# PYTHON 3
|
||||||
|
|
||||||
# this file handles language
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from settings import settings
|
from settings import settings
|
||||||
from settings import talk
|
from settings import talk
|
||||||
|
|
||||||
from studio import studio_gtk
|
from studio import studio_gtk
|
||||||
|
from studio_console import sc_main
|
||||||
from gi.repository import GLib
|
from gi.repository import GLib
|
||||||
|
|
||||||
def new(name):
|
def new(name):
|
||||||
|
@ -110,7 +111,12 @@ def load(path, win=False):
|
||||||
|
|
||||||
#if new
|
#if new
|
||||||
if not is_legacy(path):
|
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
|
#old organizer
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue