FixedAdding #1

Merged
danylo_nevidomiy merged 33 commits from FixedAdding into main 2025-02-12 21:46:46 +03:00
7 changed files with 394 additions and 94 deletions
Showing only changes of commit a52425c817 - Show all commits

View File

@ -43,6 +43,9 @@ set(PROJECT_SOURCES
hello.cpp
hello.h
hello.ui
addc.h
addc.cpp
addc.ui
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)

14
PasswordManager/addc.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "addc.h"
#include "ui_addc.h"
AddC::AddC(QWidget *parent) :
QWidget(parent),
ui(new Ui::AddC)
{
ui->setupUi(this);
}
AddC::~AddC()
{
delete ui;
}

22
PasswordManager/addc.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef ADDC_H
#define ADDC_H
#include <QWidget>
namespace Ui {
class AddC;
}
class AddC : public QWidget
{
Q_OBJECT
public:
explicit AddC(QWidget *parent = nullptr);
~AddC();
private:
Ui::AddC *ui;
};
#endif // ADDC_H

147
PasswordManager/addc.ui Normal file
View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AddC</class>
<widget class="QWidget" name="AddC">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>593</width>
<height>406</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QListView" name="listView">
<property name="geometry">
<rect>
<x>120</x>
<y>90</y>
<width>351</width>
<height>211</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>260</x>
<y>40</y>
<width>71</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Добавить</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>180</x>
<y>170</y>
<width>231</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>170</x>
<y>130</y>
<width>111</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>номер карты</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>330</x>
<y>240</y>
<width>21</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>до</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>370</x>
<y>240</y>
<width>71</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="geometry">
<rect>
<x>150</x>
<y>240</y>
<width>121</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>100</x>
<y>340</y>
<width>31</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>CVS:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="geometry">
<rect>
<x>140</x>
<y>340</y>
<width>51</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>280</x>
<y>340</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>PIN:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_5">
<property name="geometry">
<rect>
<x>320</x>
<y>340</y>
<width>113</width>
<height>25</height>
</rect>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -414,7 +414,7 @@ void MainWindow::on_pushButton_4_clicked()
ui->lineEdit_password->setText(password);
ui->lineEdit_url->setText(r->getURL());
ui->lineEdit_note->setText(r->getNote());
ui->stackedWidget->setCurrentIndex(2);
ui->stackedWidget->setCurrentIndex(3);
}
@ -424,3 +424,27 @@ void MainWindow::on_pushButton_6_clicked()
ui->stackedWidget->setCurrentIndex(0);
}
void MainWindow::on_addCard_clicked()
{
std::cout << "addc" << std::endl;
addc.show();
}
void MainWindow::on_pushButton_13_clicked()
{
std::cout << "addc" << std::endl;
addc.show();
}
void MainWindow::on_PW_Button_clicked()
{
ui->stackedWidget->setCurrentIndex(0);
}
void MainWindow::on_CardButton_clicked()
{
ui->stackedWidget->setCurrentIndex(1);
}

View File

@ -11,6 +11,7 @@
#include"about.h"
//#include"hello.h"
#include"cryptographer.h"
#include"addc.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@ -40,6 +41,7 @@ private:
GenPass genpass;
AddDialog *dial;
About about;
AddC addc;
// Hello* hello;
SimpleCrypt* crypto;
QSqlDatabase m_db; // объект базы данных.
@ -51,14 +53,14 @@ private:
static const QString fileDialogFilterString;
static constexpr char* checkpoint = "checkpoint";
inline quint64 convertPassword(const QString &word)
{
quint64 value = 0;
for(auto x : word.toStdString())
{
quint64 value = 0;
for(auto x : word.toStdString())
{
value+=(char)x;
}
return value;
value+=(char)x;
}
return value;
}
// void initAppWithDatabaseFile(const QString &dbFileFullPath);
@ -69,13 +71,13 @@ private slots:
void on_addButton_clicked();
void addRecordSlot(Record *r);//слот принимающий текст из LineEdit
// void openDBSlot(QString path);
// void openDBSlot(QString path);
void acceptDelete();
void on_pushButton_clicked();
// void on_pushButton_2_clicked();
// void on_pushButton_2_clicked();
void on_actionExit_triggered();
// void on_tableView_activated(const QModelIndex &index);
// void on_tableView_activated(const QModelIndex &index);
void on_deleteButton_clicked();
void on_pushButton_5_clicked();
// void on_editButton_clicked();
@ -85,8 +87,14 @@ private slots:
void on_action_7_triggered();
// void on_action_2_triggered();
// void on_action_2_triggered(bool checked);
// void on_editSaveButton_clicked();
// void on_editSaveButton_clicked();addc
void on_pushButton_4_clicked();
void on_pushButton_6_clicked();
void on_addCard_clicked();
void on_pushButton_13_clicked();
void on_PW_Button_clicked();
void on_CardButton_clicked();
};
#endif // MAINWINDOW_H

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>804</width>
<height>600</height>
</rect>
</property>
@ -23,8 +23,8 @@
<rect>
<x>10</x>
<y>40</y>
<width>891</width>
<height>649</height>
<width>781</width>
<height>531</height>
</rect>
</property>
<property name="acceptDrops">
@ -40,10 +40,10 @@
</property>
<property name="geometry">
<rect>
<x>-10</x>
<x>-1</x>
<y>0</y>
<width>800</width>
<height>481</height>
<width>781</width>
<height>491</height>
</rect>
</property>
</widget>
@ -51,18 +51,44 @@
<property name="geometry">
<rect>
<x>0</x>
<y>490</y>
<width>1011</width>
<y>500</y>
<width>791</width>
<height>31</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QPushButton" name="addButton">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>241</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>540</x>
<y>0</y>
<width>241</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Watch</string>
</property>
</widget>
<widget class="QPushButton" name="deleteButton">
<property name="geometry">
<rect>
<x>280</x>
<x>270</x>
<y>0</y>
<width>241</width>
<height>31</height>
@ -72,25 +98,53 @@
<string>Delete</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>570</x>
<y>0</y>
<width>211</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Watch</string>
</property>
</widget>
<widget class="QPushButton" name="addButton">
</widget>
<widget class="QPushButton" name="CardButton">
<property name="geometry">
<rect>
<x>700</x>
<y>30</y>
<width>61</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Card</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_8">
<widget class="QTableView" name="tableViewRecords_3">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>-1</x>
<y>0</y>
<width>781</width>
<height>491</height>
</rect>
</property>
</widget>
<widget class="QGroupBox" name="ToolGroup_3">
<property name="geometry">
<rect>
<x>0</x>
<y>500</y>
<width>791</width>
<height>31</height>
</rect>
</property>
<property name="title">
<string/>
</property>
<widget class="QPushButton" name="addCard">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>201</width>
<width>241</width>
<height>31</height>
</rect>
</property>
@ -98,6 +152,45 @@
<string>Add</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_12">
<property name="geometry">
<rect>
<x>540</x>
<y>0</y>
<width>241</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Watch</string>
</property>
</widget>
<widget class="QPushButton" name="deleteButton_3">
<property name="geometry">
<rect>
<x>270</x>
<y>0</y>
<width>241</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="PW_Button">
<property name="geometry">
<rect>
<x>700</x>
<y>30</y>
<width>61</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>PW</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_2">
@ -265,7 +358,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_4">
<widget class="QTableView" name="tableView_3">
@ -346,57 +439,11 @@
</widget>
<widget class="QWidget" name="page_5"/>
<widget class="QWidget" name="page_6">
<widget class="QLabel" name="label_20">
<property name="geometry">
<rect>
<x>190</x>
<y>160</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Путь:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_18">
<property name="geometry">
<rect>
<x>320</x>
<y>150</y>
<width>511</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_19">
<property name="geometry">
<rect>
<x>320</x>
<y>240</y>
<width>511</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_21">
<property name="geometry">
<rect>
<x>190</x>
<y>250</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Пароль:</string>
</property>
</widget>
<widget class="QLabel" name="label_24">
<property name="geometry">
<rect>
<x>400</x>
<y>70</y>
<x>300</x>
<y>80</y>
<width>241</width>
<height>17</height>
</rect>
@ -411,8 +458,8 @@
<widget class="QPushButton" name="pushButton_8">
<property name="geometry">
<rect>
<x>610</x>
<y>340</y>
<x>530</x>
<y>400</y>
<width>141</width>
<height>31</height>
</rect>
@ -424,8 +471,8 @@
<widget class="QPushButton" name="pushButton_9">
<property name="geometry">
<rect>
<x>250</x>
<y>340</y>
<x>150</x>
<y>400</y>
<width>141</width>
<height>31</height>
</rect>
@ -434,6 +481,38 @@
<string>Создать</string>
</property>
</widget>
<widget class="QWidget" name="gridLayoutWidget_3">
<property name="geometry">
<rect>
<x>180</x>
<y>170</y>
<width>481</width>
<height>121</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_19"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Путь:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Пароль:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_18"/>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
@ -627,9 +706,9 @@
<widget class="QTableView" name="tableView_2">
<property name="geometry">
<rect>
<x>0</x>
<x>10</x>
<y>0</y>
<width>901</width>
<width>781</width>
<height>41</height>
</rect>
</property>
@ -637,12 +716,15 @@
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>80</x>
<x>90</x>
<y>0</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>GP</string>
</property>
<property name="icon">
<iconset>
<normaloff>../../../../../media/daniil/_________/dice_3293.png</normaloff>../../../../../media/daniil/_________/dice_3293.png</iconset>
@ -657,14 +739,14 @@
<widget class="QPushButton" name="pushButton_5">
<property name="geometry">
<rect>
<x>20</x>
<x>30</x>
<y>0</y>
<width>40</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string/>
<string>home</string>
</property>
<property name="icon">
<iconset>
@ -683,7 +765,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>804</width>
<height>23</height>
</rect>
</property>