Browse Source

Added background change timeout and fixed some ui scale issues

Ivan Arkhipov 5 years ago
parent
commit
948b50253f
13 changed files with 653 additions and 625 deletions
  1. 4 0
      Legacy_v2.pro
  2. 74 11
      gui/mainwindow.cpp
  3. 15 1
      gui/mainwindow.h
  4. 316 399
      gui/mainwindow.ui
  5. 10 1
      gui/newswidget.cpp
  6. 96 104
      gui/newswidget.ui
  7. 111 105
      gui/rusificationwidget.ui
  8. 3 0
      gui/settingswidget.cpp
  9. 2 2
      gui/settingswidget.ui
  10. 2 2
      gui/statuswidget.ui
  11. 4 0
      res.qrc
  12. 12 0
      src/main.cpp
  13. 4 0
      src/networkdownloader.cpp

+ 4 - 0
Legacy_v2.pro

@@ -13,6 +13,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 TARGET = Legacy_v2
 TEMPLATE = app
 
+CXXFLAGS += -O2 -fno-stack-limit
+
 
 # The following define makes your compiler emit warnings if you use
 # any feature of Qt which has been marked as deprecated (the exact warnings
@@ -93,3 +95,5 @@ DEPENDPATH += $$PWD/lib/Third_party
 win32:!win32-g++: PRE_TARGETDEPS += $$PWD/lib/Third_party/lib/zlibstatic.lib
 else:unix:!macx|win32-g++: PRE_TARGETDEPS += $$PWD/lib/Third_party/lib/libzlibstatic.a
 
+DISTFILES +=
+

+ 74 - 11
gui/mainwindow.cpp

@@ -1,15 +1,22 @@
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
+#include "legacyapp.h"
 
 #include <QBitmap>
+#include <QPainter>
+#include <QPixmap>
+#include <QDebug>
+#include <QThread>
 #include <QMouseEvent>
 #include <QMessageBox>
 #include <QDesktopWidget>
+#include <QtConcurrent/QtConcurrent>
 
 MainWindow::MainWindow(LegacyApp *app, QWidget *parent) :
     QMainWindow(parent, Qt::Window | Qt::FramelessWindowHint), app(app),
     ui(new Ui::MainWindow), menuHoverWidget(nullptr), menuHoverWidgetAnimation(nullptr)
-{}
+{
+}
 
 void MainWindow::Init() {
     ui->setupUi(this);
@@ -32,12 +39,17 @@ void MainWindow::Init() {
     hideAllContentWidgets();
     status_frame->show();
 
-    setupWindowBackgroundAndMask(1);
-    setupMenuHoverWidget();
-
     changeFontSizeRecursive(100, this);
     updateGeometry();
 
+    background = new QPixmap(":/assets/bg1.png");
+    setupWindowBackgroundAndMask();
+    setupMenuHoverWidget();
+
+    background_update_timer.setInterval(30 * 1000);
+    connect(&background_update_timer, &QTimer::timeout, this, &MainWindow::randomChangeBackground);
+    background_update_timer.start();
+    ui->centralWidget->setStyleSheet("");
     show();
 }
 
@@ -57,13 +69,64 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
     }
 }
 
-void MainWindow::resizeEvent(QResizeEvent * /* event */)
+void MainWindow::resizeEvent(QResizeEvent * event)
 {
-    QPixmap maskPix(":/assets/bg1.png");
-    maskPix = maskPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::FastTransformation);
-    setMask(maskPix.mask());
+    int width = event->size().width();
+    int height = event->size().height();
+
+    ui->menu_widget->move(width * 420 / 1239, height * 55 / 810);
+    ui->menu_widget->resize(width * 770 / 1239, height * 60 / 810);
+
+    ui->content_area->move(width * 15 / 1239, height * 160 / 810);
+    ui->content_area->resize(width * 1210 / 1239, height * 650 / 810);
+    setupWindowBackgroundAndMask();
+}
+
+void MainWindow::randomChangeBackground()
+{
+    qDebug() << "Starting background update";
+
+    if (fade_animation_timer.isActive()) {
+        qDebug() << "MainWindow::startBackgroundUpdate() - cannot start, because update is still active";
+        return;
+    }
+
+    next_pixmap_opacity = 0;
+    int next_pixmap_id = qrand() % MAX_PIXMAP_ID + 1;
+
+    if (!next_pixmap)
+        next_pixmap = new QPixmap();
+
+    next_pixmap->load(":/assets/bg" + QString::number(next_pixmap_id) + ".png");
+    qDebug() << "Next pixmap id" << next_pixmap_id << "!";
+
+    if (next_pixmap->isNull()) {
+        qDebug() << "Incorrect pixmap id " << next_pixmap_id << "!";
+        return;
+    }
+
+    QtConcurrent::run([this](){
+        qDebug() << "Starting background update";
+        while (next_pixmap_opacity < 1) {
+            if (!qApp)
+                return;
+
+            QPainter painter;
+            painter.begin(background);
+            painter.setOpacity(next_pixmap_opacity);
+            painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
+            painter.drawPixmap(0,0, *next_pixmap);
+            painter.end();
+
+            setupWindowBackgroundAndMask();
+            next_pixmap_opacity += 0.005;
+            QThread::msleep(50);
+        }
+        qDebug() << "Background update finished";
+    });
 }
 
+
 MainWindow::~MainWindow()
 {
     delete ui;
@@ -104,10 +167,9 @@ void MainWindow::onHoverMenuentry()
     moveMenuHoverWidget(MenuEntry::getHoverLabel());
 }
 
-void MainWindow::setupWindowBackgroundAndMask(int bg_id)
+void MainWindow::setupWindowBackgroundAndMask()
 {
-    QPixmap maskPix(":/assets/bg" + QString::number(bg_id) + ".png");
-    maskPix = maskPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::FastTransformation);
+    QPixmap maskPix = background->scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::FastTransformation);
     setMask(maskPix.mask());
 
     QPalette palette;
@@ -206,6 +268,7 @@ void MainWindow::changeFontSizeRecursive(size_t percent, QWidget *widget)
 
 void MainWindow::on_closeButton_clicked()
 {
+    hide();
     qApp->quit();
 }
 

+ 15 - 1
gui/mainwindow.h

@@ -4,6 +4,7 @@
 #include <QMainWindow>
 #include <QPropertyAnimation>
 #include <QTimer>
+#include <QPixmap>
 
 #include "statuswidget.h"
 #include "rusificationwidget.h"
@@ -21,6 +22,9 @@ class LegacyApp;
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
+    struct PixmapObertka{
+        QPixmap* pixmap;
+    };
 
 public:
     explicit MainWindow(LegacyApp *app = 0, QWidget *parent = 0);
@@ -34,6 +38,8 @@ protected:
     void resizeEvent(QResizeEvent *event) override;
 
 private slots:
+    void randomChangeBackground();
+
     void on_menuentry_1_common_clicked();
 
     void on_menuentry_2_common_clicked();
@@ -51,7 +57,7 @@ private slots:
     void on_minimizeButton_clicked();
 
 private:
-    void setupWindowBackgroundAndMask(int bg_id);
+    void setupWindowBackgroundAndMask();
 
     void setupMenuHoverWidget();
 
@@ -79,6 +85,14 @@ private:
     NewsWidget *news_frame;
     HelpWidget *help_frame;
 
+    QPixmap *background;
+    QPixmap *next_pixmap {nullptr};
+    QTimer background_update_timer;
+    QTimer fade_animation_timer;
+    double next_pixmap_opacity;
+
+    const int MAX_PIXMAP_ID = 5;
+
     const size_t common_font_size = 15;
     const size_t title_font_size = 16;
     const size_t supertitle_font_size = 32;

+ 316 - 399
gui/mainwindow.ui

@@ -42,419 +42,336 @@
     <bool>false</bool>
    </property>
    <property name="styleSheet">
-    <string notr="true">border-image: url(:/assets/bg1.png);
-
-</string>
+    <string notr="true">border-image: url(:/assets/bg2.png);</string>
    </property>
-   <layout class="QGridLayout" name="gridLayout" rowstretch="1,4" columnstretch="1,2">
-    <property name="sizeConstraint">
-     <enum>QLayout::SetDefaultConstraint</enum>
+   <widget class="QWidget" name="content_area" native="true">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>129</y>
+      <width>901</width>
+      <height>501</height>
+     </rect>
     </property>
-    <property name="leftMargin">
-     <number>0</number>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
     </property>
-    <property name="topMargin">
-     <number>0</number>
+    <property name="autoFillBackground">
+     <bool>false</bool>
     </property>
-    <property name="rightMargin">
-     <number>0</number>
+    <property name="styleSheet">
+     <string notr="true">border-image:none;</string>
     </property>
-    <property name="bottomMargin">
-     <number>0</number>
+    <layout class="QGridLayout" name="gridLayout_3">
+     <property name="leftMargin">
+      <number>20</number>
+     </property>
+     <property name="topMargin">
+      <number>10</number>
+     </property>
+     <property name="rightMargin">
+      <number>20</number>
+     </property>
+     <property name="bottomMargin">
+      <number>10</number>
+     </property>
+     <item row="0" column="0">
+      <layout class="QGridLayout" name="content_layout"/>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QWidget" name="menu_widget" native="true">
+    <property name="geometry">
+     <rect>
+      <x>290</x>
+      <y>50</y>
+      <width>571</width>
+      <height>51</height>
+     </rect>
     </property>
-    <property name="spacing">
-     <number>0</number>
+    <property name="sizePolicy">
+     <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+      <horstretch>0</horstretch>
+      <verstretch>0</verstretch>
+     </sizepolicy>
     </property>
-    <item row="0" column="0">
-     <widget class="QWidget" name="logo_area" native="true">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>0</width>
-        <height>120</height>
-       </size>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">border-image:none;</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="1">
-     <widget class="QWidget" name="menu_area" native="true">
-      <property name="styleSheet">
-       <string notr="true">border-image:none;</string>
-      </property>
-      <layout class="QVBoxLayout" name="verticalLayout" stretch="10,9,7">
-       <property name="spacing">
-        <number>0</number>
-       </property>
-       <property name="leftMargin">
-        <number>0</number>
-       </property>
-       <property name="topMargin">
-        <number>0</number>
-       </property>
-       <property name="rightMargin">
-        <number>0</number>
-       </property>
-       <property name="bottomMargin">
-        <number>0</number>
-       </property>
-       <item>
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>52</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QWidget" name="menu_widget" native="true">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="autoFillBackground">
-          <bool>false</bool>
-         </property>
-         <property name="styleSheet">
-          <string notr="true"/>
-         </property>
-         <layout class="QHBoxLayout" name="horizontalLayout" stretch="6,9,11,7,6,0,2">
-          <property name="spacing">
-           <number>10</number>
-          </property>
-          <property name="sizeConstraint">
-           <enum>QLayout::SetDefaultConstraint</enum>
-          </property>
-          <property name="leftMargin">
-           <number>0</number>
-          </property>
-          <property name="topMargin">
-           <number>0</number>
-          </property>
-          <property name="rightMargin">
-           <number>0</number>
-          </property>
-          <property name="bottomMargin">
-           <number>0</number>
+    <property name="autoFillBackground">
+     <bool>false</bool>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">border-image:transparent;</string>
+    </property>
+    <layout class="QHBoxLayout" name="horizontalLayout" stretch="6,9,11,7,6,0">
+     <property name="spacing">
+      <number>10</number>
+     </property>
+     <property name="sizeConstraint">
+      <enum>QLayout::SetDefaultConstraint</enum>
+     </property>
+     <property name="leftMargin">
+      <number>0</number>
+     </property>
+     <property name="topMargin">
+      <number>0</number>
+     </property>
+     <property name="rightMargin">
+      <number>0</number>
+     </property>
+     <property name="bottomMargin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="MenuEntry" name="menuentry_1_common">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="baseSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="mouseTracking">
+        <bool>true</bool>
+       </property>
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color:rgb(255, 255, 255);</string>
+       </property>
+       <property name="text">
+        <string>  СТАТУС  </string>
+       </property>
+       <property name="scaledContents">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="default" stdset="0">
+        <bool>false</bool>
+       </property>
+       <property name="flat" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="MenuEntry" name="menuentry_2_common">
+       <property name="enabled">
+        <bool>true</bool>
+       </property>
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="mouseTracking">
+        <bool>true</bool>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color:rgb(255, 255, 255);</string>
+       </property>
+       <property name="text">
+        <string>  НАСТРОЙКИ  </string>
+       </property>
+       <property name="scaledContents">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="flat" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="MenuEntry" name="menuentry_3_common">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="mouseTracking">
+        <bool>true</bool>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color:rgb(255, 255, 255)</string>
+       </property>
+       <property name="text">
+        <string notr="true">  РУСИФИКАЦИЯ  </string>
+       </property>
+       <property name="scaledContents">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="flat" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="MenuEntry" name="menuentry_4_common">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="mouseTracking">
+        <bool>true</bool>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color:rgb(255, 255, 255);</string>
+       </property>
+       <property name="text">
+        <string>  НОВОСТИ  </string>
+       </property>
+       <property name="scaledContents">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="flat" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="MenuEntry" name="menuentry_5_common">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="mouseTracking">
+        <bool>true</bool>
+       </property>
+       <property name="layoutDirection">
+        <enum>Qt::LeftToRight</enum>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">color:rgb(255, 255, 255);</string>
+       </property>
+       <property name="text">
+        <string>  ПОМОЩЬ  </string>
+       </property>
+       <property name="scaledContents">
+        <bool>true</bool>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="flat" stdset="0">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QWidget" name="widget" native="true">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <property name="spacing">
+         <number>5</number>
+        </property>
+        <property name="leftMargin">
+         <number>0</number>
+        </property>
+        <property name="topMargin">
+         <number>0</number>
+        </property>
+        <property name="rightMargin">
+         <number>0</number>
+        </property>
+        <property name="bottomMargin">
+         <number>0</number>
+        </property>
+        <item>
+         <widget class="QPushButton" name="minimizeButton">
+          <property name="minimumSize">
+           <size>
+            <width>20</width>
+            <height>20</height>
+           </size>
           </property>
-          <item>
-           <widget class="MenuEntry" name="menuentry_1_common">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="baseSize">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="layoutDirection">
-             <enum>Qt::LeftToRight</enum>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">color:rgb(255, 255, 255);</string>
-            </property>
-            <property name="text">
-             <string>  СТАТУС  </string>
-            </property>
-            <property name="scaledContents">
-             <bool>true</bool>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-            <property name="default" stdset="0">
-             <bool>false</bool>
-            </property>
-            <property name="flat" stdset="0">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="MenuEntry" name="menuentry_2_common">
-            <property name="enabled">
-             <bool>true</bool>
-            </property>
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">color:rgb(255, 255, 255);</string>
-            </property>
-            <property name="text">
-             <string>  НАСТРОЙКИ  </string>
-            </property>
-            <property name="scaledContents">
-             <bool>true</bool>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-            <property name="flat" stdset="0">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="MenuEntry" name="menuentry_3_common">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">color:rgb(255, 255, 255)</string>
-            </property>
-            <property name="text">
-             <string notr="true">  РУСИФИКАЦИЯ  </string>
-            </property>
-            <property name="scaledContents">
-             <bool>true</bool>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-            <property name="flat" stdset="0">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="MenuEntry" name="menuentry_4_common">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">color:rgb(255, 255, 255);</string>
-            </property>
-            <property name="text">
-             <string>  НОВОСТИ  </string>
-            </property>
-            <property name="scaledContents">
-             <bool>true</bool>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-            <property name="flat" stdset="0">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="MenuEntry" name="menuentry_5_common">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="layoutDirection">
-             <enum>Qt::LeftToRight</enum>
-            </property>
-            <property name="styleSheet">
-             <string notr="true">color:rgb(255, 255, 255);</string>
-            </property>
-            <property name="text">
-             <string>  ПОМОЩЬ  </string>
-            </property>
-            <property name="scaledContents">
-             <bool>true</bool>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignCenter</set>
-            </property>
-            <property name="flat" stdset="0">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QWidget" name="widget" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>0</width>
-              <height>0</height>
-             </size>
-            </property>
-            <layout class="QHBoxLayout" name="horizontalLayout_2">
-             <property name="spacing">
-              <number>5</number>
-             </property>
-             <property name="leftMargin">
-              <number>0</number>
-             </property>
-             <property name="topMargin">
-              <number>0</number>
-             </property>
-             <property name="rightMargin">
-              <number>0</number>
-             </property>
-             <property name="bottomMargin">
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QPushButton" name="minimizeButton">
-               <property name="minimumSize">
-                <size>
-                 <width>20</width>
-                 <height>20</height>
-                </size>
-               </property>
-               <property name="styleSheet">
-                <string notr="true">QPushButton#minimizeButton {border-image: url(:/assets/minimize.png) 0 0 0 0 stretch stretch; border: 0px;}
+          <property name="styleSheet">
+           <string notr="true">QPushButton#minimizeButton {border-image: url(:/assets/minimize.png) 0 0 0 0 stretch stretch; border: 0px;}
 
 QPushButton#minimizeButton:hover {border-image: url(:/assets/minimize.png) 0 0 0 0 stretch stretch; border: 1px;}
 
 </string>
-               </property>
-               <property name="text">
-                <string>_</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="closeButton">
-               <property name="minimumSize">
-                <size>
-                 <width>20</width>
-                 <height>20</height>
-                </size>
-               </property>
-               <property name="styleSheet">
-                <string notr="true">QPushButton#closeButton { border-image: url(:/assets/close.png) 0 0 0 0 stretch stretch; }
+          </property>
+          <property name="text">
+           <string>_</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="closeButton">
+          <property name="minimumSize">
+           <size>
+            <width>20</width>
+            <height>20</height>
+           </size>
+          </property>
+          <property name="styleSheet">
+           <string notr="true">QPushButton#closeButton { border-image: url(:/assets/close.png) 0 0 0 0 stretch stretch; }
 
 QPushButton#closeButton:hover { border-image: url(:/assets/close.png) 0 0 0 0 stretch stretch; border:1px;}</string>
-               </property>
-               <property name="text">
-                <string>Х</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeType">
-             <enum>QSizePolicy::Fixed</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>20</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>45</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-    </item>
-    <item row="1" column="0" colspan="2">
-     <widget class="QWidget" name="content_area" native="true">
-      <property name="autoFillBackground">
-       <bool>false</bool>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">border-image:none;</string>
-      </property>
-      <layout class="QGridLayout" name="gridLayout_3">
-       <property name="leftMargin">
-        <number>20</number>
-       </property>
-       <property name="rightMargin">
-        <number>20</number>
-       </property>
-       <item row="0" column="0">
-        <layout class="QGridLayout" name="content_layout"/>
-       </item>
-      </layout>
-     </widget>
-    </item>
-   </layout>
+          </property>
+          <property name="text">
+           <string>Х</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </widget>
   </widget>
  </widget>
  <layoutdefault spacing="6" margin="11"/>

+ 10 - 1
gui/newswidget.cpp

@@ -12,6 +12,8 @@ NewsWidget::NewsWidget(LegacyApp *_app, QWidget *parent) :
     app(_app), news_downloader(this)
 {
     ui->setupUi(this);
+    ui->test_news_piece->hide();
+
     news_downloader.targetBytearray = &news_data;
     news_downloader.setUrl(QUrl("http://translate.lotros.ru/groupware/launcher_news"));
 
@@ -30,6 +32,14 @@ NewsWidget::~NewsWidget()
 
 void NewsWidget::updateNews()
 {
+    if (!qApp)
+        return;
+
+    if (news_data.size() == 0) {
+        constructNewsPiece(0, "Не могу загрузить новости", "Загрузка новостей не удалась. Чтобы просмотреть новости, перейдите на <a href='http://translate.lotros.ru/news'>http://translate.lotros.ru/news</a>", "http://translate.lotros.ru/news");
+        return;
+    }
+
     QStringList news_list = QString(news_data).split(":::");
     news_data.clear();
 
@@ -125,7 +135,6 @@ void NewsWidget::constructNewsPiece(int piece_id, QString title, QString text, Q
     contentLabel->setText(text);
 
     news_piece_layout->addWidget(contentLabel, 1, 1, 1, 1);
-
     app->window.changeFontSizeRecursive(app->properties.value("settings/ui_scale", 100).toInt(), news_piece);
 
     ui->news_layout->addWidget(news_piece);

+ 96 - 104
gui/newswidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>728</width>
-    <height>446</height>
+    <width>860</width>
+    <height>491</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -29,12 +29,14 @@
       </sizepolicy>
      </property>
      <property name="autoFillBackground">
-      <bool>true</bool>
+      <bool>false</bool>
      </property>
      <property name="styleSheet">
       <string notr="true">QScrollArea{
 	background: transparent;
-} 
+}
+
+QScrollArea &gt; QWidget &gt; QWidget { background: transparent; }
 
 QScrollBar:vertical {
      border: 0px solid grey;
@@ -83,6 +85,9 @@ QScrollBar:vertical {
      <property name="lineWidth">
       <number>0</number>
      </property>
+     <property name="horizontalScrollBarPolicy">
+      <enum>Qt::ScrollBarAlwaysOff</enum>
+     </property>
      <property name="sizeAdjustPolicy">
       <enum>QAbstractScrollArea::AdjustToContents</enum>
      </property>
@@ -94,11 +99,14 @@ QScrollBar:vertical {
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>710</width>
-        <height>403</height>
+        <width>838</width>
+        <height>469</height>
        </rect>
       </property>
-      <layout class="QGridLayout" name="gridLayout_2">
+      <property name="autoFillBackground">
+       <bool>false</bool>
+      </property>
+      <layout class="QGridLayout" name="news_layout">
        <property name="leftMargin">
         <number>11</number>
        </property>
@@ -115,29 +123,15 @@ QScrollBar:vertical {
         <number>7</number>
        </property>
        <item row="0" column="0">
-        <layout class="QVBoxLayout" name="news_layout">
-         <property name="leftMargin">
-          <number>0</number>
+        <widget class="QWidget" name="test_news_piece" native="true">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
          </property>
-         <property name="topMargin">
-          <number>0</number>
-         </property>
-         <property name="rightMargin">
-          <number>0</number>
-         </property>
-         <property name="bottomMargin">
-          <number>0</number>
-         </property>
-         <item>
-          <widget class="QWidget" name="test_news_piece" native="true">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="styleSheet">
-            <string notr="true">QWidget{
+         <property name="styleSheet">
+          <string notr="true">QWidget{
 border-radius: 20px;
 background-color: rgba(30, 0, 0, 100);
 color: white;
@@ -147,82 +141,80 @@ QLabel{
 border-radius: 2px;
 background-color:rgba(0,0,0,0);
 }</string>
-           </property>
-           <layout class="QGridLayout" name="news_piece_layout">
-            <item row="0" column="0" rowspan="2">
-             <widget class="QLabel" name="iconLabel">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>60</width>
-                <height>60</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>60</width>
-                <height>60</height>
-               </size>
-              </property>
-              <property name="text">
-               <string/>
-              </property>
-              <property name="pixmap">
-               <pixmap resource="../res.qrc">:/assets/appicon.ico</pixmap>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QLabel" name="titleLabel_title">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="font">
-               <font>
-                <family>Trebuchet MS</family>
-                <pointsize>11</pointsize>
-               </font>
-              </property>
-              <property name="styleSheet">
-               <string notr="true">color: white;
+         </property>
+         <layout class="QGridLayout" name="news_piece_layout">
+          <item row="0" column="0" rowspan="2">
+           <widget class="QLabel" name="iconLabel">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="minimumSize">
+             <size>
+              <width>60</width>
+              <height>60</height>
+             </size>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>60</width>
+              <height>60</height>
+             </size>
+            </property>
+            <property name="text">
+             <string/>
+            </property>
+            <property name="pixmap">
+             <pixmap resource="../res.qrc">:/assets/appicon.ico</pixmap>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <widget class="QLabel" name="titleLabel_title">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <family>Trebuchet MS</family>
+              <pointsize>11</pointsize>
+             </font>
+            </property>
+            <property name="styleSheet">
+             <string notr="true">color: white;
 text-decoration: none;</string>
-              </property>
-              <property name="text">
-               <string>Тестовая новость - Название</string>
-              </property>
-              <property name="alignment">
-               <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-              </property>
-              <property name="wordWrap">
-               <bool>true</bool>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <widget class="QLabel" name="contentLabel">
-              <property name="text">
-               <string>Контент контент контент контент контент контент контент контент контент контент контент контент</string>
-              </property>
-              <property name="alignment">
-               <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-              </property>
-              <property name="wordWrap">
-               <bool>false</bool>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </widget>
-         </item>
-        </layout>
+            </property>
+            <property name="text">
+             <string>Тестовая новость - Название</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+            </property>
+            <property name="wordWrap">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QLabel" name="contentLabel">
+            <property name="text">
+             <string>Контент контент контент контент контент контент контент контент контент контент контент контент</string>
+            </property>
+            <property name="alignment">
+             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+            </property>
+            <property name="wordWrap">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
        </item>
       </layout>
      </widget>

+ 111 - 105
gui/rusificationwidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>721</width>
-    <height>703</height>
+    <width>860</width>
+    <height>491</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -40,7 +40,7 @@
    <item>
     <widget class="QTabWidget" name="tabWidget_common">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -131,7 +131,7 @@ QPushButton, QGroupBox, QComboBox {
        <item>
         <widget class="QWidget" name="left_column_widget" native="true">
          <property name="sizePolicy">
-          <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+          <sizepolicy hsizetype="Fixed" vsizetype="Ignored">
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
@@ -149,6 +149,12 @@ background-color: rgba(30, 0, 0, 100);</string>
          <layout class="QGridLayout" name="gridLayout">
           <item row="0" column="0">
            <widget class="QTreeWidget" name="treeWidget_title">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
             <property name="mouseTracking">
              <bool>true</bool>
             </property>
@@ -351,63 +357,6 @@ background-color: rgba(255, 255, 255, 0);</string>
           </sizepolicy>
          </property>
          <layout class="QGridLayout" name="gridLayout_2">
-          <item row="1" column="1" colspan="2">
-           <spacer name="verticalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>321</width>
-              <height>18</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item row="2" column="1" colspan="2">
-           <widget class="QWidget" name="widget" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <layout class="QHBoxLayout" name="horizontalLayout_2">
-             <item>
-              <spacer name="horizontalSpacer">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>132</width>
-                 <height>57</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="pushButton">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="minimumSize">
-                <size>
-                 <width>160</width>
-                 <height>60</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>ПРИМЕНИТЬ</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </item>
           <item row="0" column="1" colspan="2">
            <widget class="QWidget" name="widget_2" native="true">
             <property name="sizePolicy">
@@ -488,6 +437,63 @@ p, li { white-space: pre-wrap; }
             </layout>
            </widget>
           </item>
+          <item row="1" column="1" colspan="2">
+           <spacer name="verticalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>321</width>
+              <height>18</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item row="2" column="1" colspan="2">
+           <widget class="QWidget" name="widget" native="true">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <layout class="QHBoxLayout" name="horizontalLayout_2">
+             <item>
+              <spacer name="horizontalSpacer">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>132</width>
+                 <height>57</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pushButton">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>160</width>
+                 <height>60</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>ПРИМЕНИТЬ</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </widget>
+          </item>
          </layout>
         </widget>
        </item>
@@ -1306,17 +1312,17 @@ background-color: rgba(30, 0, 0, 100);
          <zorder>widget_18</zorder>
         </widget>
        </item>
-       <item row="1" column="1">
-        <widget class="QWidget" name="patched_contents_widget" native="true">
+       <item row="1" column="0">
+        <widget class="QWidget" name="original_contents_widget" native="true">
          <property name="styleSheet">
-          <string notr="true">QWidget#patched_contents_widget{
+          <string notr="true">QWidget#original_contents_widget{
 border-radius: 20px;
 background-color: rgba(30, 0, 0, 100);
 }</string>
          </property>
-         <layout class="QVBoxLayout" name="verticalLayout_5">
+         <layout class="QVBoxLayout" name="verticalLayout_6">
           <item>
-           <widget class="QLabel" name="label_18">
+           <widget class="QLabel" name="label_17">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
               <horstretch>0</horstretch>
@@ -1324,7 +1330,7 @@ background-color: rgba(30, 0, 0, 100);
              </sizepolicy>
             </property>
             <property name="text">
-             <string>Русифицированная версия</string>
+             <string>Оригинальная версия</string>
             </property>
             <property name="alignment">
              <set>Qt::AlignCenter</set>
@@ -1334,17 +1340,17 @@ background-color: rgba(30, 0, 0, 100);
          </layout>
         </widget>
        </item>
-       <item row="1" column="0">
-        <widget class="QWidget" name="original_contents_widget" native="true">
+       <item row="1" column="1">
+        <widget class="QWidget" name="patched_contents_widget" native="true">
          <property name="styleSheet">
-          <string notr="true">QWidget#original_contents_widget{
+          <string notr="true">QWidget#patched_contents_widget{
 border-radius: 20px;
 background-color: rgba(30, 0, 0, 100);
 }</string>
          </property>
-         <layout class="QVBoxLayout" name="verticalLayout_6">
+         <layout class="QVBoxLayout" name="verticalLayout_5">
           <item>
-           <widget class="QLabel" name="label_17">
+           <widget class="QLabel" name="label_18">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
               <horstretch>0</horstretch>
@@ -1352,7 +1358,7 @@ background-color: rgba(30, 0, 0, 100);
              </sizepolicy>
             </property>
             <property name="text">
-             <string>Оригинальная версия</string>
+             <string>Русифицированная версия</string>
             </property>
             <property name="alignment">
              <set>Qt::AlignCenter</set>
@@ -1542,20 +1548,6 @@ background-color: rgba(30, 0, 0, 100);
                </property>
               </widget>
              </item>
-             <item row="4" column="1">
-              <widget class="QCheckBox" name="checkBox_3_common">
-               <property name="text">
-                <string>WAV</string>
-               </property>
-              </widget>
-             </item>
-             <item row="5" column="1">
-              <widget class="QCheckBox" name="checkBox_2_common">
-               <property name="text">
-                <string>FONTBIN</string>
-               </property>
-              </widget>
-             </item>
              <item row="2" column="1">
               <widget class="QCheckBox" name="checkBox_6_common">
                <property name="text">
@@ -1563,13 +1555,6 @@ background-color: rgba(30, 0, 0, 100);
                </property>
               </widget>
              </item>
-             <item row="3" column="1">
-              <widget class="QCheckBox" name="checkBox_4_common">
-               <property name="text">
-                <string>OGG</string>
-               </property>
-              </widget>
-             </item>
              <item row="0" column="0">
               <widget class="QLabel" name="label_13_common">
                <property name="sizePolicy">
@@ -1583,21 +1568,14 @@ background-color: rgba(30, 0, 0, 100);
                </property>
               </widget>
              </item>
-             <item row="0" column="1">
-              <widget class="QCheckBox" name="checkBox_common">
-               <property name="text">
-                <string>TXT</string>
-               </property>
-              </widget>
-             </item>
-             <item row="6" column="1">
-              <widget class="QCheckBox" name="checkBox_7_common">
+             <item row="3" column="1">
+              <widget class="QCheckBox" name="checkBox_4_common">
                <property name="text">
-                <string>UNKNOWN</string>
+                <string>OGG</string>
                </property>
               </widget>
              </item>
-             <item row="0" column="2" rowspan="7">
+             <item row="0" column="3" rowspan="7">
               <spacer name="horizontalSpacer_10">
                <property name="orientation">
                 <enum>Qt::Horizontal</enum>
@@ -1610,6 +1588,34 @@ background-color: rgba(30, 0, 0, 100);
                </property>
               </spacer>
              </item>
+             <item row="0" column="1">
+              <widget class="QCheckBox" name="checkBox_common">
+               <property name="text">
+                <string>TXT</string>
+               </property>
+              </widget>
+             </item>
+             <item row="0" column="2">
+              <widget class="QCheckBox" name="checkBox_3_common">
+               <property name="text">
+                <string>WAV</string>
+               </property>
+              </widget>
+             </item>
+             <item row="1" column="2">
+              <widget class="QCheckBox" name="checkBox_2_common">
+               <property name="text">
+                <string>FONTBIN</string>
+               </property>
+              </widget>
+             </item>
+             <item row="2" column="2">
+              <widget class="QCheckBox" name="checkBox_7_common">
+               <property name="text">
+                <string>UNKNOWN</string>
+               </property>
+              </widget>
+             </item>
             </layout>
            </widget>
           </item>

+ 3 - 0
gui/settingswidget.cpp

@@ -28,6 +28,9 @@ SettingsWidget::~SettingsWidget()
 
 void SettingsWidget::updateUI()
 {
+    if (!qApp)
+        return;
+
     QString path = app->properties.value("settings/lotro_folder", "(не выбрана)").toString();
     ui->folder_value_common->setText(path);
 

+ 2 - 2
gui/settingswidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>817</width>
-    <height>653</height>
+    <width>860</width>
+    <height>491</height>
    </rect>
   </property>
   <property name="windowTitle">

+ 2 - 2
gui/statuswidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>764</width>
-    <height>495</height>
+    <width>860</width>
+    <height>491</height>
    </rect>
   </property>
   <property name="windowTitle">

+ 4 - 0
res.qrc

@@ -15,5 +15,9 @@
         <file>assets/question.png</file>
         <file>assets/gray-button-hi.png</file>
         <file>assets/teksty-photo-normal.png</file>
+        <file>assets/bg2.png</file>
+        <file>assets/bg3.png</file>
+        <file>assets/bg4.png</file>
+        <file>assets/bg5.png</file>
     </qresource>
 </RCC>

+ 12 - 0
src/main.cpp

@@ -1,9 +1,21 @@
 #include <QApplication>
+#include <QMessageBox>
+#include <QLockFile>
+#include <QDir>
 #include "legacyapp.h"
 
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
+    QLockFile lockFile(QDir::temp().absoluteFilePath("rulotro.lock"));
+    if(!lockFile.tryLock(1)){
+        QMessageBox msgBox;
+        msgBox.setIcon(QMessageBox::Warning);
+        msgBox.setText("Приложение уже запущено.\nРазрешено запускать только один экземпляр приложения.");
+        msgBox.exec();
+        return 1;
+    }
+
     LegacyApp app;
     app.Init();
     return a.exec();

+ 4 - 0
src/networkdownloader.cpp

@@ -1,5 +1,6 @@
 #include "networkdownloader.h"
 #include <QEventLoop>
+#include <QApplication>
 
 NetworkDownloader::NetworkDownloader(QObject *parent) :QObject(parent), busy(false)
 {
@@ -56,6 +57,9 @@ void NetworkDownloader::stop()
 }
 
 void NetworkDownloader::onDownloadFinished(QNetworkReply*) {
+    if (m_CurrentReply)
+        m_CurrentReply->deleteLater();
+
     busy = false;
     emit downloadFinished();
 }