-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwin_ui.py
180 lines (152 loc) · 6.67 KB
/
mainwin_ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.26
# in conjunction with Tcl version 8.6
# Sep 27, 2023 09:52:10 PM CEST platform: Linux
import sys
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
import mainwin_ui_support
def vp_start_gui():
'''Starting point when module is the main routine.'''
global val, w, root
root = tk.Tk()
top = DiffToDoc (root)
mainwin_ui_support.init(root, top)
root.mainloop()
w = None
def create_DiffToDoc(root, *args, **kwargs):
'''Starting point when module is imported by another program.'''
global w, w_win, rt
rt = root
w = tk.Toplevel (root)
top = DiffToDoc (w)
mainwin_ui_support.init(w, top, *args, **kwargs)
return (w, top)
def destroy_DiffToDoc():
global w
w.destroy()
w = None
class DiffToDoc:
def __init__(self, top=None):
'''This class configures and populates the toplevel window.
top is the toplevel containing window.'''
_bgcolor = '#d9d9d9' # X11 color: 'gray85'
_fgcolor = '#000000' # X11 color: 'black'
_compcolor = '#d9d9d9' # X11 color: 'gray85'
_ana1color = '#d9d9d9' # X11 color: 'gray85'
_ana2color = '#ececec' # Closest X11 color: 'gray92'
self.style = ttk.Style()
if sys.platform == "win32":
self.style.theme_use('winnative')
self.style.configure('.',background=_bgcolor)
self.style.configure('.',foreground=_fgcolor)
self.style.configure('.',font="TkDefaultFont")
self.style.map('.',background=
[('selected', _compcolor), ('active',_ana2color)])
top.geometry("597x444+418+380")
top.minsize(120, 1)
top.maxsize(3196, 1173)
top.resizable(1, 1)
top.title("Git Review")
top.configure(highlightcolor="black")
self.txtCommitIds = tk.Text(top)
self.txtCommitIds.place(relx=0.017, rely=0.291, relheight=0.234
, relwidth=0.961)
self.txtCommitIds.configure(background="white")
self.txtCommitIds.configure(font="TkTextFont")
self.txtCommitIds.configure(selectbackground="#c4c4c4")
self.txtCommitIds.configure(undo="1")
self.txtCommitIds.configure(wrap="word")
self.txtFilters = tk.Text(top)
self.txtFilters.place(relx=0.017, rely=0.586, relheight=0.324
, relwidth=0.961)
self.txtFilters.configure(background="white")
self.txtFilters.configure(font="TkTextFont")
self.txtFilters.configure(selectbackground="#c4c4c4")
self.txtFilters.configure(undo="1")
self.txtFilters.configure(wrap="word")
self.comboBaseBranch = ttk.Combobox(top)
self.comboBaseBranch.place(relx=0.184, rely=0.023, relheight=0.047
, relwidth=0.665)
self.value_list = ['master','develop',]
self.comboBaseBranch.configure(values=self.value_list)
self.varBaseBranch = tk.StringVar()
self.comboBaseBranch.configure(textvariable=self.varBaseBranch)
self.comboBaseBranch.configure(takefocus="")
self.comboToBranch = ttk.Combobox(top)
self.comboToBranch.place(relx=0.184, rely=0.09, relheight=0.047
, relwidth=0.665)
self.value_list = ['master','develop','feat_xxx',]
self.comboToBranch.configure(values=self.value_list)
self.varToBranch = tk.StringVar()
self.comboToBranch.configure(textvariable=self.varToBranch)
self.comboToBranch.configure(takefocus="")
self.TButton1 = ttk.Button(top)
self.TButton1.place(relx=0.871, rely=0.068, height=28, width=62)
self.TButton1.configure(command=lambda:mainwin_ui_support.addBranchDiffFromCommonAncestor(self))
self.TButton1.configure(takefocus="")
self.TButton1.configure(text='''Add''')
self.TLabel1 = ttk.Label(top)
self.TLabel1.place(relx=0.017, rely=0.023, height=19, width=92)
self.TLabel1.configure(background="#d9d9d9")
self.TLabel1.configure(foreground="#000000")
self.TLabel1.configure(font="TkDefaultFont")
self.TLabel1.configure(relief="flat")
self.TLabel1.configure(text='''Base branch:''')
self.TLabel2 = ttk.Label(top)
self.TLabel2.place(relx=0.017, rely=0.09, height=22, width=92)
self.TLabel2.configure(background="#d9d9d9")
self.TLabel2.configure(foreground="#000000")
self.TLabel2.configure(font="TkDefaultFont")
self.TLabel2.configure(relief="flat")
self.TLabel2.configure(text='''Branch:''')
self.TLabel3 = ttk.Label(top)
self.TLabel3.place(relx=0.017, rely=0.158, height=19, width=92)
self.TLabel3.configure(background="#d9d9d9")
self.TLabel3.configure(foreground="#000000")
self.TLabel3.configure(font="TkDefaultFont")
self.TLabel3.configure(relief="flat")
self.TLabel3.configure(text='''Name:''')
self.edName = ttk.Entry(top)
self.edName.place(relx=0.184, rely=0.158, relheight=0.047
, relwidth=0.794)
self.varName = tk.StringVar()
self.edName.configure(textvariable=self.varName)
self.edName.configure(takefocus="")
self.edName.configure(cursor="xterm")
self.TButton2 = ttk.Button(top)
self.TButton2.place(relx=0.821, rely=0.923, height=31, width=110)
self.TButton2.configure(command=lambda:mainwin_ui_support.generateDiffDocument(self))
self.TButton2.configure(takefocus="")
self.TButton2.configure(text='''Generate''')
self.TLabel4 = ttk.Label(top)
self.TLabel4.place(relx=0.017, rely=0.236, height=19, width=61)
self.TLabel4.configure(background="#d9d9d9")
self.TLabel4.configure(foreground="#000000")
self.TLabel4.configure(font="TkDefaultFont")
self.TLabel4.configure(relief="flat")
self.TLabel4.configure(text='''Commits''')
self.TLabel5 = ttk.Label(top)
self.TLabel5.place(relx=0.017, rely=0.541, height=22, width=69)
self.TLabel5.configure(background="#d9d9d9")
self.TLabel5.configure(foreground="#000000")
self.TLabel5.configure(font="TkDefaultFont")
self.TLabel5.configure(relief="flat")
self.TLabel5.configure(text='''Exclude''')
self.TButton3 = ttk.Button(top)
self.TButton3.place(relx=0.637, rely=0.923, height=31, width=110)
self.TButton3.configure(command=lambda:mainwin_ui_support.displayDiffPreview(self))
self.TButton3.configure(takefocus="")
self.TButton3.configure(text='''Preview...''')
if __name__ == '__main__':
vp_start_gui()