-
Notifications
You must be signed in to change notification settings - Fork 0
/
editwindow.h
86 lines (63 loc) · 2.38 KB
/
editwindow.h
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
#ifndef EDITWINDOW_H
#define EDITWINDOW_H
#include "contact.h"
#include <QMainWindow>
#include <QWidget>
#include <QGridLayout>
#include <QFormLayout>
#include <QHBoxLayout>
#include <QCheckBox>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
class EditWindow : public QMainWindow
{
Q_OBJECT
public:
explicit EditWindow(QWidget *parent = 0);
QWidget * mainwidget;
QGridLayout * mainlayout;
QFormLayout * CurrentInfoForm, * NewInfoForm;
QCheckBox * EditContact, * EditGroupName;
QHBoxLayout *CheckBoxeslayout, *ButtonsLayout;
QPushButton *Edit, *Back;
QLabel * CurrentFirstName , * CurrentLastName ,
* CurrentPhoneNum , * CurrentGroupName ,
* NewFirstname , * NewLastName ,
* NewPhoneNum , * NewGroupName ;
QLineEdit * CurrentFirstNameLine , * CurrentLastNameLine ,
* CurrentPhoneNumLine , * CurrentGroupNameLine ,
* NewFirstNameLine , * NewLastNameLine ,
* NewPhoneNumLine , * NewGroupNameLine ;
QMessageBox * CompletedEditMessage;
void CreateCompletedEditMessage();
void ShowCompletedEditMessage();
void CreateCheckBoxes();
void SetCheckBoxesInlayout();
void ConnectCheckBoxes();
void CreateHorizontalLayout();
void CreateFormLayouts();
void SetFormLayoutsInMainLayout();
void CreateButtons();
void SetButtonsInLayout();
void ConnectButtons();
void CreateLabels();
void CreateEditLines();
void SetLinesAndLabelsInLayout();
bool EditContactInBook(Contact & curC,Contact & NewC,QList<Contact> & ac);
bool EditContactInGroups(Contact & curC,Contact & NewC,QMap<QString,QList<Contact>> & gl,QString gn);
bool LoadAllContactsFromFile(QList<Contact> & ac);
bool SaveAllContactsInFile(QList<Contact> & ac);
QStringList getAllGroupsName();
bool LoadGroupsFromFile(QMap<QString,QList<Contact>> & gl);
bool SaveGroupsInFile(QMap<QString,QList<Contact>> & gl);
QString GetContactGroupName(Contact & target);
void EditContactFromBook(Contact & curc,Contact & newc);
void EditContactFromGroup(Contact & curc,Contact & newc,QString groupname);
signals:
public slots:
void EdittingMission();
void CheckForEdit();
};
#endif // EDITWINDOW_H