Skip to content

Commit

Permalink
Added New windows
Browse files Browse the repository at this point in the history
Added the compress and decompress window and the view errors button
  • Loading branch information
AbdElrhmanRezq authored Dec 21, 2023
1 parent 9257511 commit b4ed8dd
Show file tree
Hide file tree
Showing 7 changed files with 304 additions and 182 deletions.
2 changes: 2 additions & 0 deletions XML-Files-Parser.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ INCLUDEPATH += $$quote(E:/FEASU/Fall semester 2023 - on/DS/XML-Files-Parser/inc)
# Input
HEADERS += inc/tree.h \
inc/Node.h \
inc/resultwindow.h \
inc/tree.h \
inc/XML_Compressor.h \
inc/XML_Decompressor.h \
Expand All @@ -14,6 +15,7 @@ HEADERS += inc/tree.h \
inc/TreeNode.h \
inc/XML_Parser.h
SOURCES += src/main.cpp \
src/resultwindow.cpp \
src/tree.cpp \
src/TreeNode.cpp \
src/XML_Parser.cpp \
Expand Down
4 changes: 2 additions & 2 deletions XML-Files-Parser.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 12.0.0, 2023-12-16T21:58:14. -->
<!-- Written by QtCreator 12.0.0, 2023-12-21T09:55:07. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -84,7 +84,7 @@
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ClangdSettings">
<value type="bool" key="blockIndexing">true</value>
<value type="bool" key="blockIndexing">false</value>
<value type="bool" key="useGlobalSettings">true</value>
</valuemap>
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
Expand Down
8 changes: 8 additions & 0 deletions inc/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ private slots:

void on_fix_data_button_clicked();

void on_locate_button_clicked();

void on_json_button_clicked();

void on_compress_button_clicked();

void on_show_errors_button_clicked();

private:
Ui::MainWindow *ui;

Expand Down
22 changes: 22 additions & 0 deletions inc/resultwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef RESULTWINDOW_H
#define RESULTWINDOW_H

#include <QDialog>
#include <QLabel>
#include <QVBoxLayout>
#include <QScrollArea>

class ResultWindow : public QDialog
{
Q_OBJECT

public:
ResultWindow(QWidget *parent = nullptr);
void setLabelText(const QString &text);

private:
QLabel *resultLabel;
QScrollArea *scrollArea;
};

#endif // RESULTWINDOW_H
280 changes: 143 additions & 137 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,150 +6,156 @@
<rect>
<x>0</x>
<y>0</y>
<width>1091</width>
<height>543</height>
<width>798</width>
<height>515</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>200</x>
<y>40</y>
<width>231</width>
<height>181</height>
</rect>
</property>
<property name="text">
<string>Locate</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>30</x>
<y>270</y>
<width>991</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Your file location will be put here.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>800</x>
<y>130</y>
<width>181</width>
<height>101</height>
</rect>
</property>
<property name="text">
<string>Save to json</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>800</x>
<y>40</y>
<width>181</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string>Compress</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>40</x>
<y>300</y>
<width>991</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="decompress_button">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>600</x>
<y>40</y>
<width>181</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string>Decompress</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="fix_data_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>600</x>
<y>130</y>
<width>181</width>
<height>101</height>
</rect>
</property>
<property name="text">
<string>Save fixed</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>774</width>
<height>491</height>
</rect>
</property>
<widget class="QPushButton" name="locate_button">
<property name="geometry">
<rect>
<x>50</x>
<y>30</y>
<width>191</width>
<height>171</height>
</rect>
</property>
<property name="text">
<string>Locate</string>
</property>
</widget>
<widget class="QPushButton" name="json_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>630</x>
<y>20</y>
<width>121</width>
<height>131</height>
</rect>
</property>
<property name="text">
<string>To json</string>
</property>
</widget>
<widget class="QPushButton" name="compress_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>630</x>
<y>160</y>
<width>121</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Compress</string>
</property>
</widget>
<widget class="QPushButton" name="decompress_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>630</x>
<y>200</y>
<width>121</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Decompress</string>
</property>
</widget>
<widget class="QPushButton" name="fix_data_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>630</x>
<y>240</y>
<width>121</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Save fixed</string>
</property>
</widget>
<widget class="QLabel" name="address_label">
<property name="geometry">
<rect>
<x>270</x>
<y>40</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Your file address will be put here</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="error_label">
<property name="geometry">
<rect>
<x>270</x>
<y>110</y>
<width>291</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QPushButton" name="show_errors_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>630</x>
<y>280</y>
<width>121</width>
<height>29</height>
</rect>
</property>
<property name="text">
<string>Show errors</string>
</property>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1091</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuParser">
<property name="title">
<string>Parser </string>
</property>
</widget>
<addaction name="menuParser"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<resources/>
<connections/>
Expand Down
Loading

0 comments on commit b4ed8dd

Please sign in to comment.