Skip to content

Commit

Permalink
Turnover menu and opening of Compute window by this menu
Browse files Browse the repository at this point in the history
  • Loading branch information
manantsoa committed Mar 16, 2015
1 parent 9e9d458 commit 77a4bde
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 18 deletions.
5 changes: 5 additions & 0 deletions src/gui/dialogs/computeturnoverdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "computeturnoverdialog.h"
#include "ui_computeturnoverdialog.h"


namespace Gui {
namespace Dialogs {
ComputeTurnoverDialog::ComputeTurnoverDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ComputeTurnoverDialog)
Expand All @@ -12,3 +15,5 @@ ComputeTurnoverDialog::~ComputeTurnoverDialog()
{
delete ui;
}
}
}
10 changes: 10 additions & 0 deletions src/gui/dialogs/computeturnoverdialog.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#ifndef COMPUTETURNOVERDIALOG_H
#define COMPUTETURNOVERDIALOG_H

#include "database/projectdatabase.h"
#include <QDialog>

namespace Ui {
class ComputeTurnoverDialog;
}

namespace Gui {
namespace Dialogs {
/**
* @author Manantsoa Razanajatovo
* @brief The ComputeTurnoverDialog class window
* to compute a turnover with a period
*/
class ComputeTurnoverDialog : public QDialog
{
Q_OBJECT
Expand All @@ -18,5 +26,7 @@ class ComputeTurnoverDialog : public QDialog
private:
Ui::ComputeTurnoverDialog *ui;
};
}
}

#endif // COMPUTETURNOVERDIALOG_H
7 changes: 7 additions & 0 deletions src/gui/mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ void MainWindow::openPdf()

}

void MainWindow::computeTurnover()
{
ComputeTurnoverDialog cp;

cp.exec();
}

void MainWindow::search(QString text)
{
updateUI(text);
Expand Down
8 changes: 8 additions & 0 deletions src/gui/mainwindow/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include "gui/dialogs/dialogaddcustomer.h"
#include "gui/dialogs/addprojectdialog.h"
#include "gui/dialogs/addquotedialog.h"
#include "gui/dialogs/computeturnoverdialog.h"
#include "gui/docks/searchdock.h"


#include "exceptions/fileexception.h"

#include "utils/pointers.h"
Expand Down Expand Up @@ -198,6 +200,12 @@ public slots:
*/
void openPdf();

/**
* @brief MainWindow::computeTurnover open window to allow computation
* of a period turnover
*/
void computeTurnover();

private slots:
/**
* @brief MainWindow::openContextualMenuTable open contextual menu
Expand Down
65 changes: 47 additions & 18 deletions src/gui/mainwindow/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
<x>0</x>
<y>0</y>
<width>1413</width>
<height>22</height>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menuFichier">
Expand All @@ -384,9 +384,9 @@
<string>Client</string>
</property>
<addaction name="actNew"/>
<addaction name="actResearch"/>
<addaction name="actionNewBill"/>
<addaction name="actionNewQuote"/>
<addaction name="actResearch"/>
</widget>
<widget class="QMenu" name="menuA_propos">
<property name="title">
Expand All @@ -403,9 +403,16 @@
</property>
<addaction name="actAddProject"/>
</widget>
<widget class="QMenu" name="menuStatistiques">
<property name="title">
<string>Statistiques</string>
</property>
<addaction name="actComputeTurnover"/>
</widget>
<addaction name="menuFichier"/>
<addaction name="menuClient"/>
<addaction name="menuProjets"/>
<addaction name="menuStatistiques"/>
<addaction name="menuA_propos"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
Expand Down Expand Up @@ -679,6 +686,11 @@
<string>Nouveau projet</string>
</property>
</action>
<action name="actComputeTurnover">
<property name="text">
<string>Calculer CA d'une période</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down Expand Up @@ -967,8 +979,8 @@
<slot>addProject()</slot>
<hints>
<hint type="sourcelabel">
<x>499</x>
<y>130</y>
<x>483</x>
<y>114</y>
</hint>
<hint type="destinationlabel">
<x>797</x>
Expand All @@ -983,8 +995,8 @@
<slot>editProject()</slot>
<hints>
<hint type="sourcelabel">
<x>499</x>
<y>130</y>
<x>483</x>
<y>114</y>
</hint>
<hint type="destinationlabel">
<x>738</x>
Expand All @@ -999,8 +1011,8 @@
<slot>removeProject()</slot>
<hints>
<hint type="sourcelabel">
<x>499</x>
<y>130</y>
<x>483</x>
<y>114</y>
</hint>
<hint type="destinationlabel">
<x>0</x>
Expand Down Expand Up @@ -1095,8 +1107,8 @@
<slot>editDoc()</slot>
<hints>
<hint type="sourcelabel">
<x>411</x>
<y>542</y>
<x>576</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>319</x>
Expand All @@ -1111,8 +1123,8 @@
<slot>removeDoc()</slot>
<hints>
<hint type="sourcelabel">
<x>525</x>
<y>529</y>
<x>756</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>609</x>
Expand Down Expand Up @@ -1143,8 +1155,8 @@
<slot>openPdf()</slot>
<hints>
<hint type="sourcelabel">
<x>828</x>
<y>522</y>
<x>1091</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>827</x>
Expand Down Expand Up @@ -1191,8 +1203,8 @@
<slot>billingIsPaid()</slot>
<hints>
<hint type="sourcelabel">
<x>742</x>
<y>533</y>
<x>978</x>
<y>677</y>
</hint>
<hint type="destinationlabel">
<x>733</x>
Expand All @@ -1207,15 +1219,31 @@
<slot>copyDoc()</slot>
<hints>
<hint type="sourcelabel">
<x>645</x>
<y>527</y>
<x>892</x>
<y>676</y>
</hint>
<hint type="destinationlabel">
<x>666</x>
<y>643</y>
</hint>
</hints>
</connection>
<connection>
<sender>actComputeTurnover</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>computeTurnover()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>706</x>
<y>359</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>addCustomer()</slot>
Expand Down Expand Up @@ -1251,5 +1279,6 @@
<slot>openPdf()</slot>
<slot>billingIsPaid()</slot>
<slot>copyDoc()</slot>
<slot>computeTurnover()</slot>
</slots>
</ui>

0 comments on commit 77a4bde

Please sign in to comment.