@@ -170,27 +170,68 @@ def submit():
170
170
canvas1 .create_window (100 , 335 , anchor = "nw" , window = desc_of_group1 )
171
171
172
172
def NPriGrp ():
173
- import GlobalChatGUI
174
- GlobalChatGUI .main (str (name ))
175
- sb1 = Button (root1 , text = ' Global Chat' , bg = color ["nero" ], fg = color ["orange" ],
176
- font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login ,
177
- compound = LEFT ,anchor = "nw" , command = Gchat )
178
- sl1 = Button (root1 , text = ' Public Chat Groups' , bg = color ["nero" ], fg = color ["orange" ],
179
- font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login ,
180
- compound = LEFT ,
181
- anchor = "nw" , command = PuGrp )
182
- sl2 = Button (root1 , text = ' Private Chat Groups' , bg = color ["nero" ], fg = color ["orange" ],
183
- font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login ,
184
- compound = LEFT ,
185
- anchor = "nw" , command = PrGrp )
186
- sl3 = Button (root1 , text = ' New Public Group' , bg = color ["nero" ], fg = color ["orange" ],
187
- font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login ,
188
- compound = LEFT ,
189
- anchor = "nw" , command = NPuGrp )
190
- sl4 = Button (root1 , text = ' New Private Group' , bg = color ["nero" ], fg = color ["orange" ],
191
- font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login ,
192
- compound = LEFT ,
193
- anchor = "nw" , command = NPriGrp )
173
+ Ngn = StringVar ()
174
+ Ngd = StringVar ()
175
+ NgS = StringVar ()
176
+ sb1 .destroy ()
177
+ sl1 .destroy ()
178
+ sl2 .destroy ()
179
+ sl3 .destroy ()
180
+ sl4 .destroy ()
181
+ def submit ():
182
+ GName = Ngn .get ()
183
+ Desc = Ngd .get ()
184
+ Skey = NgS .get ()
185
+ myquery = {"Gname" : GName , "Owner" : name }
186
+ mycol = mydb ["PrivateChatGroups" ]
187
+ mydoc = mycol .find (myquery )
188
+ for x in mydoc :
189
+ res = not bool (x )
190
+ while not res :
191
+ print ("Similar Group Already Exists Already Exists" )
192
+ NPriGrp ()
193
+ mydict = {"GName" : GName ,
194
+ "Desc" : Desc ,
195
+ "SKey" : Skey ,
196
+ "Owner" : name ,
197
+ "Admins" : {
198
+ "username" : [name ]
199
+ },
200
+ "Members" : {
201
+ "username" : [{
202
+ "username" : name ,
203
+ }
204
+ ]
205
+ },
206
+ "Chats" : [
207
+ {
208
+ "username" : name ,
209
+ "Message" : "Booyahh! Welcome To My Own Public Group"
210
+ }
211
+ ]
212
+ }
213
+ temp = mycol .insert_one (mydict )
214
+ from ChatBoxGUI import PrivateChatGUI
215
+ PrivateChatGUI .main (GName , name )
216
+ submit = Button (root1 ,command = submit , text = ' CreateGroup' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" )
217
+ Name_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = Ngn )
218
+ Desc_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = Ngd )
219
+ Skey_of_group = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = NgS , show = '*' )
220
+ Desc_of_group1 = Label (root1 , text = 'Description Of Group' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
221
+ Name_of_group1 = Label (root1 , text = 'Group Name' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
222
+ Skey_of_group1 = Label (root1 , text = 'Security Key' , width = 18 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
223
+ canvas1 .create_window (300 , 585 , anchor = "nw" , window = submit )
224
+ canvas1 .create_window (700 , 210 , anchor = "nw" , window = Name_of_group )
225
+ canvas1 .create_window (700 , 335 , anchor = "nw" , window = Desc_of_group )
226
+ canvas1 .create_window (100 , 210 , anchor = "nw" , window = Name_of_group1 )
227
+ canvas1 .create_window (700 , 460 , anchor = "nw" , window = Skey_of_group )
228
+ canvas1 .create_window (100 , 460 , anchor = "nw" , window = Skey_of_group1 )
229
+ canvas1 .create_window (100 , 335 , anchor = "nw" , window = Desc_of_group1 )
230
+ sb1 = Button (root1 , text = ' Global Chat' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT ,anchor = "nw" , command = Gchat )
231
+ sl1 = Button (root1 , text = ' Public Chat Groups' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" , command = PuGrp )
232
+ sl2 = Button (root1 , text = ' Private Chat Groups' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" , command = PrGrp )
233
+ sl3 = Button (root1 , text = ' New Public Group' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" , command = NPuGrp )
234
+ sl4 = Button (root1 , text = ' New Private Group' , bg = color ["nero" ], fg = color ["orange" ], font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT , anchor = "nw" , command = NPriGrp )
194
235
canvas1 .create_window (400 , 495 , anchor = "nw" , window = sb1 )
195
236
canvas1 .create_window (700 , 245 , anchor = "nw" , window = sl1 )
196
237
canvas1 .create_window (700 , 370 , anchor = "nw" , window = sl2 )
@@ -268,10 +309,10 @@ def switch():
268
309
font = ('Malgun Gothic Semilight' , 25 , "bold" ), width = 500 , height = 100 , bd = 5 , image = login , compound = LEFT ,
269
310
anchor = "nw" , command = some )
270
311
# canvas1.create_text(100, 245, "Username", width=50, height=1, fg=color["orange"])
271
- l1 = Entry (root1 ,font = ('Malgun Gothic Semilight' , 25 , "bold" ),bd = 5 , textvariable = userid )
272
- l2 = Entry (root1 ,font = ('Malgun Gothic Semilight' , 25 , "bold" ),bd = 5 , textvariable = paswrd , show = '*' )
273
- l3 = Label (root1 , text = 'UserName' , width = 15 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ),bd = 5 )
274
- l4 = Label (root1 , text = 'Password' , width = 15 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ),bd = 5 )
312
+ l1 = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = userid )
313
+ l2 = Entry (root1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 , textvariable = paswrd , show = '*' )
314
+ l3 = Label (root1 , text = 'UserName' , width = 15 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
315
+ l4 = Label (root1 , text = 'Password' , width = 15 , height = 1 , font = ('Malgun Gothic Semilight' , 25 , "bold" ), bd = 5 )
275
316
canvas1 .create_window (300 , 495 , anchor = "nw" , window = b1 )
276
317
canvas1 .create_window (700 , 245 , anchor = "nw" , window = l1 )
277
318
canvas1 .create_window (700 , 370 , anchor = "nw" , window = l2 )
0 commit comments