X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Ftransactionview.cpp;h=92dda5784c04b3bf9f5e0aeeb2bd314f5d97c6d8;hb=527137e3ee542da5ecd4d04364fac0eb0067a2a4;hp=0b2a3e6092067110b55b2f39f8f868b4bbca6ac8;hpb=856aacf388b2dd4c8213e699ff6377203a9194cc;p=novacoin.git diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 0b2a3e6..92dda57 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -38,13 +38,20 @@ TransactionView::TransactionView(QWidget *parent) : QHBoxLayout *hlayout = new QHBoxLayout(); hlayout->setContentsMargins(0,0,0,0); +#ifdef Q_WS_MAC + hlayout->setSpacing(5); + hlayout->addSpacing(26); +#else hlayout->setSpacing(0); - hlayout->addSpacing(23); +#endif dateWidget = new QComboBox(this); - dateWidget->setMaximumWidth(120); - dateWidget->setMinimumWidth(120); +#ifdef Q_WS_MAC + dateWidget->setFixedWidth(121); +#else + dateWidget->setFixedWidth(120); +#endif dateWidget->addItem(tr("All"), All); dateWidget->addItem(tr("Today"), Today); dateWidget->addItem(tr("This week"), ThisWeek); @@ -55,8 +62,11 @@ TransactionView::TransactionView(QWidget *parent) : hlayout->addWidget(dateWidget); typeWidget = new QComboBox(this); - typeWidget->setMaximumWidth(120); - typeWidget->setMinimumWidth(120); +#ifdef Q_WS_MAC + typeWidget->setFixedWidth(121); +#else + typeWidget->setFixedWidth(120); +#endif typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES); typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) | @@ -71,16 +81,19 @@ TransactionView::TransactionView(QWidget *parent) : addressWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 - addressWidget->setPlaceholderText("Enter address or label to search"); + addressWidget->setPlaceholderText(tr("Enter address or label to search")); #endif hlayout->addWidget(addressWidget); amountWidget = new QLineEdit(this); #if QT_VERSION >= 0x040700 - amountWidget->setPlaceholderText("Min amount"); + amountWidget->setPlaceholderText(tr("Min amount")); +#endif +#ifdef Q_WS_MAC + amountWidget->setFixedWidth(97); +#else + amountWidget->setFixedWidth(100); #endif - amountWidget->setMaximumWidth(100); - amountWidget->setMinimumWidth(100); amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this)); hlayout->addWidget(amountWidget); @@ -96,7 +109,11 @@ TransactionView::TransactionView(QWidget *parent) : vlayout->setSpacing(0); int width = view->verticalScrollBar()->sizeHint().width(); // Cover scroll bar width with spacing +#ifdef Q_WS_MAC + hlayout->addSpacing(width+2); +#else hlayout->addSpacing(width); +#endif // Always show scroll bar view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); view->setTabKeyNavigation(false); @@ -105,10 +122,10 @@ TransactionView::TransactionView(QWidget *parent) : transactionView = view; // Actions - QAction *copyAddressAction = new QAction("Copy address", this); - QAction *copyLabelAction = new QAction("Copy label", this); - QAction *editLabelAction = new QAction("Edit label", this); - QAction *showDetailsAction = new QAction("Show details...", this); + QAction *copyAddressAction = new QAction(tr("Copy address"), this); + QAction *copyLabelAction = new QAction(tr("Copy label"), this); + QAction *editLabelAction = new QAction(tr("Edit label"), this); + QAction *showDetailsAction = new QAction(tr("Show details..."), this); contextMenu = new QMenu(); contextMenu->addAction(copyAddressAction); @@ -251,13 +268,13 @@ void TransactionView::exportClicked() // name, column, role writer.setModel(transactionProxyModel); - writer.addColumn("Confirmed", 0, TransactionTableModel::ConfirmedRole); - writer.addColumn("Date", 0, TransactionTableModel::DateRole); - writer.addColumn("Type", TransactionTableModel::Type, Qt::EditRole); - writer.addColumn("Label", 0, TransactionTableModel::LabelRole); - writer.addColumn("Address", 0, TransactionTableModel::AddressRole); - writer.addColumn("Amount", 0, TransactionTableModel::FormattedAmountRole); - writer.addColumn("ID", 0, TransactionTableModel::TxIDRole); + writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole); + writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole); + writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole); + writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole); + writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole); + writer.addColumn(tr("Amount"), 0, TransactionTableModel::FormattedAmountRole); + writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole); if(!writer.write()) { @@ -349,7 +366,7 @@ QWidget *TransactionView::createDateRangeWidget() QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); layout->setContentsMargins(0,0,0,0); layout->addSpacing(23); - layout->addWidget(new QLabel("Range:")); + layout->addWidget(new QLabel(tr("Range:"))); dateFrom = new QDateTimeEdit(this); dateFrom->setDisplayFormat("dd/MM/yy"); @@ -357,7 +374,7 @@ QWidget *TransactionView::createDateRangeWidget() dateFrom->setMinimumWidth(100); dateFrom->setDate(QDate::currentDate().addDays(-7)); layout->addWidget(dateFrom); - layout->addWidget(new QLabel("to")); + layout->addWidget(new QLabel(tr("to"))); dateTo = new QDateTimeEdit(this); dateTo->setDisplayFormat("dd/MM/yy");