Skip to content

Commit

Permalink
firebase imported on demand (less requirements)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoheinisch committed Jan 19, 2022
1 parent d3a19ba commit 4417029
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/quiet_linenumbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def attach(self, text_widget):
def redraw(self, *args):
def drawthisline(line_index, lines):
if len(lines)>line_index and len(lines[line_index])>0:
print(lines[line_index][0])
tmp = (lines[line_index][0] == 'o')
return tmp
else:
Expand Down
7 changes: 4 additions & 3 deletions src/quiet_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
import tkinter.font as tk_font
import tkinter as tk

from firebase import Firebase
from quiet_config import Configurations



class ConfigLoader:

@staticmethod
Expand Down Expand Up @@ -99,11 +96,15 @@ def load(self, *args):
self.qt.clear_and_replace_textarea(text)

def pull_remote_text(self) -> str:

from firebase import Firebase
db = Firebase(self.fb_config).database()
return db.get().val()


def push_remote_text(self):

from firebase import Firebase
db = Firebase(self.fb_config).database()
textarea_content = self.qt.textarea.get(1.0, tk.END)
db.set(textarea_content)
12 changes: 10 additions & 2 deletions src/quiet_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, *args, **kwargs):
tk.Frame.__init__(self, *args, **kwargs)
master.title('QuietToDo')
# defined size of the editer window
master.geometry('600x500')
master.geometry('400x800')
self.operating_system = system()

self.conf = Configurations.Settings
Expand All @@ -48,14 +48,22 @@ def __init__(self, *args, **kwargs):
self.textarea.config(tabs=(self._tab_width,))

self.context_menu = ContextMenu(self)

self.menubar = Menubar(self)

self.statusbar = Statusbar(self)

self.syntax_highlighter = SyntaxHighlighting(self, self.textarea, self.initial_content)

self.linenumbers.attach(self.textarea)
self.linenumbers.pack(side=tk.LEFT, fill=tk.Y)
self.textarea.pack(side=tk.RIGHT, fill='both', expand=True)

# self.textarea_done =CustomText(self)
# self.textarea_done.insert('1.0',"TEEST_DONE")
# self.textarea_done.pack(side=tk.BOTTOM, fill='both')


self.textarea.pack(side=tk.RIGHT, fill='both', expand=True)
self.textarea.find_match_index = None
self.textarea.find_search_starting_index = 1.0

Expand Down

0 comments on commit 4417029

Please sign in to comment.