Browse Source

Added all gui content classes

Ivan Arkhipov 5 years ago
parent
commit
961aa9e25f

+ 14 - 3
Legacy_v2.pro

@@ -34,7 +34,11 @@ SOURCES += \
         src/filesystem.cpp \
         src/filedownloader.cpp \
     gui/statuswidget.cpp \
-    gui/rusificationwidget.cpp
+    gui/rusificationwidget.cpp \
+    gui/settingswidget.cpp \
+    gui/newswidget.cpp \
+    gui/helpwidget.cpp \
+    src/rusificationtreeelement.cpp
 
 HEADERS += \
         gui/mainwindow.h \
@@ -43,12 +47,19 @@ HEADERS += \
         include/filesystem.h \
         include/filedownloader.h \
     gui/statuswidget.h \
-    gui/rusificationwidget.h
+    gui/rusificationwidget.h \
+    gui/settingswidget.h \
+    gui/newswidget.h \
+    gui/helpwidget.h \
+    include/rusificationtreeelement.h
 
 FORMS += \
         gui/mainwindow.ui \
     gui/statuswidget.ui \
-    gui/rusificationwidget.ui
+    gui/rusificationwidget.ui \
+    gui/settingswidget.ui \
+    gui/newswidget.ui \
+    gui/helpwidget.ui
 
 RESOURCES += \
         res.qrc

+ 14 - 0
gui/helpwidget.cpp

@@ -0,0 +1,14 @@
+#include "gui\helpwidget.h"
+#include "ui_helpwidget.h"
+
+HelpWidget::HelpWidget(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::HelpWidget)
+{
+    ui->setupUi(this);
+}
+
+HelpWidget::~HelpWidget()
+{
+    delete ui;
+}

+ 22 - 0
gui/helpwidget.h

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

+ 40 - 0
gui/helpwidget.ui

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>HelpWidget</class>
+ <widget class="QWidget" name="HelpWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="font">
+      <font>
+       <family>Arial</family>
+       <pointsize>18</pointsize>
+      </font>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">color: white;</string>
+     </property>
+     <property name="text">
+      <string>Окно &quot;Помощь&quot;</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 15 - 0
gui/mainwindow.cpp

@@ -20,6 +20,15 @@ void MainWindow::Init() {
     rusification_frame = new RusificationWidget(this);
     ui->content_layout->addWidget(rusification_frame);
 
+    settings_frame = new SettingsWidget(this);
+    ui->content_layout->addWidget(settings_frame);
+
+    news_frame = new NewsWidget(this);
+    ui->content_layout->addWidget(news_frame);
+
+    help_frame = new HelpWidget(this);
+    ui->content_layout->addWidget(help_frame);
+
     hideAllContentWidgets();
     status_frame->show();
 
@@ -65,6 +74,7 @@ void MainWindow::on_menuentry_1_clicked()
 void MainWindow::on_menuentry_2_clicked()
 {
     hideAllContentWidgets();
+    settings_frame->show();
 }
 
 void MainWindow::on_menuentry_3_clicked()
@@ -76,11 +86,13 @@ void MainWindow::on_menuentry_3_clicked()
 void MainWindow::on_menuentry_4_clicked()
 {
     hideAllContentWidgets();
+    news_frame->show();
 }
 
 void MainWindow::on_menuentry_5_clicked()
 {
     hideAllContentWidgets();
+    help_frame->show();
 }
 
 void MainWindow::onHoverMenuentry()
@@ -154,6 +166,9 @@ void MainWindow::hideAllContentWidgets()
 {
     status_frame->hide();
     rusification_frame->hide();
+    settings_frame->hide();
+    news_frame->hide();
+    help_frame->hide();
 }
 
 void MainWindow::on_closeButton_clicked()

+ 6 - 0
gui/mainwindow.h

@@ -7,6 +7,9 @@
 
 #include "statuswidget.h"
 #include "rusificationwidget.h"
+#include "settingswidget.h"
+#include "newswidget.h"
+#include "helpwidget.h"
 
 namespace Ui {
 class MainWindow;
@@ -71,6 +74,9 @@ private:
 
     StatusWidget *status_frame;
     RusificationWidget *rusification_frame;
+    SettingsWidget *settings_frame;
+    NewsWidget *news_frame;
+    HelpWidget *help_frame;
 };
 
 #endif // MAINWINDOW_H

+ 14 - 0
gui/newswidget.cpp

@@ -0,0 +1,14 @@
+#include "gui\newswidget.h"
+#include "ui_newswidget.h"
+
+NewsWidget::NewsWidget(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::NewsWidget)
+{
+    ui->setupUi(this);
+}
+
+NewsWidget::~NewsWidget()
+{
+    delete ui;
+}

+ 22 - 0
gui/newswidget.h

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

+ 40 - 0
gui/newswidget.ui

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>NewsWidget</class>
+ <widget class="QWidget" name="NewsWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="font">
+      <font>
+       <family>Arial</family>
+       <pointsize>18</pointsize>
+      </font>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">color: white;</string>
+     </property>
+     <property name="text">
+      <string>Окно &quot;Новости&quot;</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 10 - 0
gui/rusificationwidget.cpp

@@ -1,11 +1,21 @@
 #include "gui\rusificationwidget.h"
 #include "ui_rusificationwidget.h"
 
+
+void doStuffWithEveryItemInMyTree( QTreeWidgetItem *item )
+{
+    item->setCheckState(0, Qt::Checked);
+    for( int i = 0; i < item->childCount(); ++i )
+        doStuffWithEveryItemInMyTree( item->child(i) );
+}
+
 RusificationWidget::RusificationWidget(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::RusificationWidget)
 {
     ui->setupUi(this);
+    ui->treeWidget->expandAll();
+    doStuffWithEveryItemInMyTree(ui->treeWidget->invisibleRootItem());
 }
 
 RusificationWidget::~RusificationWidget()

+ 3 - 0
gui/rusificationwidget.ui

@@ -38,6 +38,9 @@ background-color: rgba(30, 0, 0, 100);</string>
      <layout class="QGridLayout" name="gridLayout">
       <item row="0" column="0">
        <widget class="QTreeWidget" name="treeWidget">
+        <property name="mouseTracking">
+         <bool>true</bool>
+        </property>
         <property name="styleSheet">
          <string notr="true">border-radius: 20px;
 color: rgb(255, 255, 255);

+ 14 - 0
gui/settingswidget.cpp

@@ -0,0 +1,14 @@
+#include "gui\settingswidget.h"
+#include "ui_settingswidget.h"
+
+SettingsWidget::SettingsWidget(QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::SettingsWidget)
+{
+    ui->setupUi(this);
+}
+
+SettingsWidget::~SettingsWidget()
+{
+    delete ui;
+}

+ 22 - 0
gui/settingswidget.h

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

+ 40 - 0
gui/settingswidget.ui

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SettingsWidget</class>
+ <widget class="QWidget" name="SettingsWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>640</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="font">
+      <font>
+       <family>Arial</family>
+       <pointsize>18</pointsize>
+      </font>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">color: white;</string>
+     </property>
+     <property name="text">
+      <string>Окно &quot;Настройки&quot;</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 12 - 0
include/rusificationtreeelement.h

@@ -0,0 +1,12 @@
+#ifndef INCLUDEUSIFICATIONTREEELEMENT_H
+#define INCLUDEUSIFICATIONTREEELEMENT_H
+
+#include <QTreeWidgetItem>
+
+class RusificationTreeElement : public QTreeWidgetItem
+{
+public:
+    RusificationTreeElement();
+};
+
+#endif // INCLUDEUSIFICATIONTREEELEMENT_H

+ 6 - 0
src/rusificationtreeelement.cpp

@@ -0,0 +1,6 @@
+#include "rusificationtreeelement.h"
+
+RusificationTreeElement::RusificationTreeElement()
+{
+
+}