Преглед на файлове

added welcome message on home wigdet

fiffty-50 преди 4 години
родител
ревизия
36dc0a748e
променени са 5 файла, в които са добавени 43 реда и са изтрити 32 реда
  1. BIN
      assets/database/logbook.db
  2. 1 1
      mainwindow.ui
  3. 6 0
      src/gui/widgets/totalswidget.cpp
  4. 1 0
      src/gui/widgets/totalswidget.h
  5. 35 31
      src/gui/widgets/totalswidget.ui

BIN
assets/database/logbook.db


+ 1 - 1
mainwindow.ui

@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>openLog v0.5</string>
+   <string>openPilotLog v0.6</string>
   </property>
   <widget class="QWidget" name="centralwidget">
    <layout class="QGridLayout" name="gridLayout">

+ 6 - 0
src/gui/widgets/totalswidget.cpp

@@ -16,6 +16,12 @@ TotalsWidget::TotalsWidget(QWidget *parent) :
         auto line_edit = parent->findChild<QLineEdit *>(field.first + "LineEdit");
         line_edit->setText(field.second);
     }
+    QSettings settings;
+    QString name = settings.value("userdata/picfirstname").toString();
+    if(!name.isEmpty()) {
+        QString salutation = "Welcome to openPilotLog, " + name + QLatin1Char('!');
+        ui->welcomeLabel->setText(salutation);
+    }
 }
 
 TotalsWidget::~TotalsWidget()

+ 1 - 0
src/gui/widgets/totalswidget.h

@@ -5,6 +5,7 @@
 #include <QStackedLayout>
 #include <QLabel>
 #include <QLineEdit>
+#include <QSettings>
 #include "src/database/db.h"
 #include "src/classes/stat.h"
 

+ 35 - 31
src/gui/widgets/totalswidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>604</width>
-    <height>386</height>
+    <width>639</width>
+    <height>453</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -15,42 +15,16 @@
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
    <item row="0" column="0">
-    <widget class="QLabel" name="label_17">
-     <property name="font">
-      <font>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
-     </property>
+    <widget class="QLabel" name="welcomeLabel">
      <property name="text">
-      <string>Your Totals</string>
+      <string>Welcome to openPilotLog!</string>
      </property>
      <property name="alignment">
       <set>Qt::AlignCenter</set>
      </property>
     </widget>
    </item>
-   <item row="1" column="0">
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>65</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0">
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0">
+   <item row="4" column="0">
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="totalLabel">
@@ -470,6 +444,36 @@
      </item>
     </layout>
    </item>
+   <item row="2" column="0">
+    <widget class="QLabel" name="totalsLabel">
+     <property name="font">
+      <font>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
+     <property name="text">
+      <string>Your Totals</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="Line" name="line_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>