Added dashboard to Shop plugin.
							parent
							
								
									22936f2a3f
								
							
						
					
					
						commit
						653f8eac30
					
				
											
												Binary file not shown.
											
										
									
								| 
		 After Width: | Height: | Size: 2.3 KiB  | 
@ -0,0 +1,28 @@
 | 
			
		||||
#include "shopoverview.h"
 | 
			
		||||
#include "ui_shopoverview.h"
 | 
			
		||||
#include "shop-odb.hxx"
 | 
			
		||||
#include "shopservice.h"
 | 
			
		||||
 | 
			
		||||
ShopOverview::ShopOverview(QWidget *parent) :
 | 
			
		||||
    QFrame(parent),
 | 
			
		||||
    ui(new Ui::ShopOverview)
 | 
			
		||||
{
 | 
			
		||||
    ui->setupUi(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ShopOverview::~ShopOverview()
 | 
			
		||||
{
 | 
			
		||||
    delete ui;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ShopOverview::refresh()
 | 
			
		||||
{
 | 
			
		||||
    ShopService srv;
 | 
			
		||||
 | 
			
		||||
    VoucherSum unpaid = srv.unpaidSummary();
 | 
			
		||||
    VoucherSum unsend = srv.unsendEET();
 | 
			
		||||
 | 
			
		||||
    ui->labelUnapiedCount->setText(QString::number(unpaid.m_count));
 | 
			
		||||
    ui->labelUnpaiedAmount->setText(QString::number(unpaid.totalPrice().toDouble()));
 | 
			
		||||
    ui->labelUnsendEET->setText(QString::number(unsend.m_count));
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,27 @@
 | 
			
		||||
#ifndef SHOPOVERVIEW_H
 | 
			
		||||
#define SHOPOVERVIEW_H
 | 
			
		||||
 | 
			
		||||
#include <QFrame>
 | 
			
		||||
#include <idashboardwidget.h>
 | 
			
		||||
 | 
			
		||||
namespace Ui {
 | 
			
		||||
class ShopOverview;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class ShopOverview : public QFrame, public IDashboardWidget
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    explicit ShopOverview(QWidget *parent = 0);
 | 
			
		||||
    ~ShopOverview();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Ui::ShopOverview *ui;
 | 
			
		||||
 | 
			
		||||
    // IDashboardWidget interface
 | 
			
		||||
public:
 | 
			
		||||
    virtual void refresh() override;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // SHOPOVERVIEW_H
 | 
			
		||||
@ -0,0 +1,139 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<ui version="4.0">
 | 
			
		||||
 <class>ShopOverview</class>
 | 
			
		||||
 <widget class="QFrame" name="ShopOverview">
 | 
			
		||||
  <property name="geometry">
 | 
			
		||||
   <rect>
 | 
			
		||||
    <x>0</x>
 | 
			
		||||
    <y>0</y>
 | 
			
		||||
    <width>908</width>
 | 
			
		||||
    <height>95</height>
 | 
			
		||||
   </rect>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="windowTitle">
 | 
			
		||||
   <string>Frame</string>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="frameShape">
 | 
			
		||||
   <enum>QFrame::StyledPanel</enum>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="frameShadow">
 | 
			
		||||
   <enum>QFrame::Raised</enum>
 | 
			
		||||
  </property>
 | 
			
		||||
  <layout class="QHBoxLayout" name="horizontalLayout">
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QLabel" name="label">
 | 
			
		||||
     <property name="text">
 | 
			
		||||
      <string/>
 | 
			
		||||
     </property>
 | 
			
		||||
     <property name="pixmap">
 | 
			
		||||
      <pixmap resource="shoprc.qrc">:/icons/shop_64x64.png</pixmap>
 | 
			
		||||
     </property>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QWidget" name="widget" native="true">
 | 
			
		||||
     <layout class="QFormLayout" name="formLayout">
 | 
			
		||||
      <item row="0" column="0">
 | 
			
		||||
       <widget class="QLabel" name="label_2">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>Unpaid vouchers: </string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="0" column="1">
 | 
			
		||||
       <widget class="QLabel" name="labelUnapiedCount">
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>90</width>
 | 
			
		||||
          <height>0</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>TextLabel</string>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="alignment">
 | 
			
		||||
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="1" column="0">
 | 
			
		||||
       <widget class="QLabel" name="label_4">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>Unpaid amount:</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="1" column="1">
 | 
			
		||||
       <widget class="QLabel" name="labelUnpaiedAmount">
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>90</width>
 | 
			
		||||
          <height>0</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>TextLabel</string>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="alignment">
 | 
			
		||||
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="2" column="0">
 | 
			
		||||
       <widget class="QLabel" name="label_6">
 | 
			
		||||
        <property name="font">
 | 
			
		||||
         <font>
 | 
			
		||||
          <weight>75</weight>
 | 
			
		||||
          <bold>true</bold>
 | 
			
		||||
         </font>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>Unsend to EET:</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="2" column="1">
 | 
			
		||||
       <widget class="QLabel" name="labelUnsendEET">
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>90</width>
 | 
			
		||||
          <height>0</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="font">
 | 
			
		||||
         <font>
 | 
			
		||||
          <weight>75</weight>
 | 
			
		||||
          <bold>true</bold>
 | 
			
		||||
         </font>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>TextLabel</string>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="alignment">
 | 
			
		||||
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
     </layout>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item>
 | 
			
		||||
    <spacer name="horizontalSpacer">
 | 
			
		||||
     <property name="orientation">
 | 
			
		||||
      <enum>Qt::Horizontal</enum>
 | 
			
		||||
     </property>
 | 
			
		||||
     <property name="sizeHint" stdset="0">
 | 
			
		||||
      <size>
 | 
			
		||||
       <width>40</width>
 | 
			
		||||
       <height>20</height>
 | 
			
		||||
      </size>
 | 
			
		||||
     </property>
 | 
			
		||||
    </spacer>
 | 
			
		||||
   </item>
 | 
			
		||||
  </layout>
 | 
			
		||||
 </widget>
 | 
			
		||||
 <resources>
 | 
			
		||||
  <include location="shoprc.qrc"/>
 | 
			
		||||
 </resources>
 | 
			
		||||
 <connections/>
 | 
			
		||||
</ui>
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue