Skip to content

Commit

Permalink
Removed all close buttoms from InvoiceEditor, InvoiceSearchResult, Vo…
Browse files Browse the repository at this point in the history
…lumeReport and UnpaidsReport
  • Loading branch information
j2sg committed Jul 19, 2015
1 parent a8428b6 commit dbc9a47
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 48 deletions.
2 changes: 0 additions & 2 deletions include/view/invoicing/invoiceeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ namespace View
void saved(const Model::Domain::Invoice &invoice);
void deleted(const Model::Domain::Invoice &invoice);
void entityAdded(const Model::Domain::Invoice &invoice);
void finished();
private slots:
void invoiceModified(bool modified = true);
void print();
Expand All @@ -83,7 +82,6 @@ namespace View
QPushButton *_printButton;
QPushButton *_saveButton;
QPushButton *_deleteButton;
QPushButton *_finishButton;
Model::Domain::Invoice *_invoice;
int _id;
};
Expand Down
1 change: 0 additions & 1 deletion include/view/invoicing/invoicesearchresult.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ namespace View
QTableView *_invoicesTableView;
InvoiceModel *_invoiceModel;
QPushButton *_loadPushButton;
QPushButton *_closePushButton;
};
}
}
Expand Down
3 changes: 0 additions & 3 deletions include/view/report/unpaidsreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

QT_BEGIN_NAMESPACE
class QTabWidget;
class QPushButton;
QT_END_NAMESPACE

namespace Model
Expand Down Expand Up @@ -61,12 +60,10 @@ namespace View
QList<Model::Domain::Invoice *> *saleInvoices,
Model::Report::UnpaidStatistics buyStatistics,
Model::Report::UnpaidStatistics saleStatistics);
void createConnections();

QTabWidget *_tabWidget;
UnpaidsReportTab *_unpaidsReportBuyTab;
UnpaidsReportTab *_unpaidsReportSaleTab;
QPushButton *_closePushButton;
};
}
}
Expand Down
3 changes: 0 additions & 3 deletions include/view/report/volumereport.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
QT_BEGIN_NAMESPACE
class QTabWidget;
class QLabel;
class QPushButton;
QT_END_NAMESPACE

namespace View
Expand Down Expand Up @@ -58,7 +57,6 @@ namespace View
Model::Report::VolumeReportByEntityResult *reportByEntity,
Model::Report::VolumeReportByProductResult *reportByProduct,
Model::Report::VolumeReportStatistics statistics);
void createConnections();

QTabWidget *_tabWidget;
VolumeReportByDateTab *_volumeReportByDateTab;
Expand All @@ -76,7 +74,6 @@ namespace View
QLabel *_dailyAvgLabelValue;
QLabel *_greatTotalLabel;
QLabel *_greatTotalLabelValue;
QPushButton *_closePushButton;
};
}
}
Expand Down
8 changes: 1 addition & 7 deletions src/view/invoicing/invoiceeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,11 @@ void View::Invoicing::InvoiceEditor::createWidgets()
_deleteButton -> setIcon(QIcon(":/images/delete.png"));
_deleteButton -> setEnabled(!IS_NEW(_invoice -> id()));

_finishButton = new QPushButton(tr("&Finish"));
_finishButton -> setIcon(QIcon(":/images/exit.png"));

QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout -> addWidget(_printButton);
bottomLayout -> addStretch();
bottomLayout -> addWidget(_saveButton);
bottomLayout -> addWidget(_deleteButton);
bottomLayout -> addWidget(_finishButton);
bottomLayout -> addWidget(_saveButton);

QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout -> addWidget(_tabWidget);
Expand All @@ -161,8 +157,6 @@ void View::Invoicing::InvoiceEditor::createConnections()
this, SLOT(save()));
connect(_deleteButton, SIGNAL(clicked()),
this, SLOT(_delete()));
connect(_finishButton, SIGNAL(clicked()),
this, SIGNAL(finished()));
}

void View::Invoicing::InvoiceEditor::setTitle()
Expand Down
7 changes: 0 additions & 7 deletions src/view/invoicing/invoicesearchresult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,8 @@ void View::Invoicing::InvoiceSearchResult::createWidgets(QList<Model::Domain::In
QGroupBox *topGroupBox = new QGroupBox(type ? tr("Sale Invoices") : tr("Buy Invoices"));
topGroupBox -> setLayout(topLayout);

_closePushButton = new QPushButton(tr("&Close"));
_closePushButton -> setIcon(QIcon(":/images/ok.png"));
_closePushButton -> setFixedSize(_closePushButton -> sizeHint());

QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout -> addWidget(topGroupBox);
mainLayout -> addWidget(_closePushButton, 0, Qt::AlignRight);

setLayout(mainLayout);
}
Expand All @@ -109,6 +104,4 @@ void View::Invoicing::InvoiceSearchResult::createConnections()
this, SLOT(load()));
connect(_loadPushButton, SIGNAL(clicked()),
this, SLOT(load()));
connect(_closePushButton, SIGNAL(clicked()),
this, SLOT(close()));
}
2 changes: 0 additions & 2 deletions src/view/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,6 @@ View::Invoicing::InvoiceEditor *View::MainWindow::createInvoiceEditor(Model::Dom
this, SLOT(invoiceDeleted(const Model::Domain::Invoice &)));
connect(editor, SIGNAL(entityAdded(const Model::Domain::Invoice &)),
this, SLOT(invoiceHasAddedNewEntity(const Model::Domain::Invoice &)));
connect(editor, SIGNAL(finished()),
_mdiArea, SLOT(closeActiveSubWindow()));

return editor;
}
Expand Down
11 changes: 0 additions & 11 deletions src/view/report/unpaidsreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ View::Report::UnpaidsReport::UnpaidsReport(QList<Model::Domain::Invoice *> *buyI
: QWidget(parent)
{
createWidgets(buyInvoices,saleInvoices, buyStatistics, saleStatistics);
createConnections();
setWindowTitle(tr("Unpaids Report"));
setWindowIcon(QIcon(":/images/unpaid.png"));
setMinimumWidth(UNPAIDS_REPORT_MINIMUM_WIDTH);
Expand All @@ -51,19 +50,9 @@ void View::Report::UnpaidsReport::createWidgets(QList<Model::Domain::Invoice *>
_tabWidget -> addTab(_unpaidsReportBuyTab, tr("Buy"));
_tabWidget -> addTab(_unpaidsReportSaleTab, tr("Sale"));

_closePushButton = new QPushButton(tr("&Close"));
_closePushButton -> setIcon(QIcon(":/images/ok.png"));
_closePushButton -> setFixedSize(_closePushButton -> sizeHint());

QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout -> addWidget(_tabWidget);
mainLayout -> addWidget(_closePushButton, 0, Qt::AlignRight);

setLayout(mainLayout);
}

void View::Report::UnpaidsReport::createConnections()
{
connect(_closePushButton, SIGNAL(clicked()),
this, SLOT(close()));
}
12 changes: 0 additions & 12 deletions src/view/report/volumereport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ View::Report::VolumeReport::VolumeReport(Model::Domain::InvoiceType type,
: QWidget(parent)
{
createWidgets(type, reportByDate, reportByEntity, reportByProduct, statistics);
createConnections();
setWindowTitle(tr("Volume %1 Report").arg(type ? tr("Sale") : tr("Buy")));
setWindowIcon(QIcon(type ? ":/images/volumesale.png" : ":/images/volumebuy.png"));
setMinimumWidth(VOLUME_REPORT_MINIMUM_WIDTH);
Expand Down Expand Up @@ -94,20 +93,9 @@ void View::Report::VolumeReport::createWidgets(Model::Domain::InvoiceType type,
QGroupBox *statisticsGroupBox = new QGroupBox(tr("Daily Statistics"));
statisticsGroupBox -> setLayout(statisticsLayout);

_closePushButton = new QPushButton(tr("&Close"));
_closePushButton -> setIcon(QIcon(":/images/ok.png"));
_closePushButton -> setFixedSize(_closePushButton -> sizeHint());

QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout -> addWidget(_tabWidget);
mainLayout -> addWidget(statisticsGroupBox);
mainLayout -> addWidget(_closePushButton, 0, Qt::AlignRight);

setLayout(mainLayout);
}

void View::Report::VolumeReport::createConnections()
{
connect(_closePushButton, SIGNAL(clicked()),
this, SLOT(close()));
}

0 comments on commit dbc9a47

Please sign in to comment.