добавлена возможность скрывать... 58/head
authorfsb4000 <fsb4000@yandex.ru>
Thu, 27 Nov 2014 15:20:35 +0000 (21:20 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Thu, 27 Nov 2014 15:20:35 +0000 (21:20 +0600)
столбцы "Адрес" и "Транзакция"

src/qt/locale/bitcoin_ru.ts
src/qt/mintingview.cpp
src/qt/mintingview.h

index 84d6844..70457fc 100644 (file)
       <translation>90 дней</translation>
     </message>
     <message>
-      <location filename="../mintingview.cpp" line="101"/>
+      <location filename="../mintingview.cpp" line="103"/>
       <source>Copy transaction ID of input</source>
       <translation>Скопировать ID транзакции входа</translation>
     </message>
     <message>
-      <location filename="../mintingview.cpp" line="102"/>
+      <location filename="../mintingview.cpp" line="104"/>
       <source>Copy address of input</source>
       <translation>Скопировать адрес входа</translation>
     </message>
     <message>
+      <location filename="../mintingview.cpp" line="105"/>
+      <source>Show/hide 'Address' column</source>
+      <translation>Показать/скрыть столбец 'Адрес'</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="106"/>
+      <source>Show/hide 'Transaction' column</source>
+      <translation>Показать/скрыть столбец 'Транзакция'</translation>
+    </message>
+    <message>
       <location filename="../mintingview.cpp" line="167"/>
       <source>Export Minting Data</source>
       <translation>Экспортировать данные таблицы</translation>
index a7825b7..9a227e8 100644 (file)
@@ -102,13 +102,19 @@ MintingView::MintingView(QWidget *parent) :
     // Actions
     QAction *copyTxIDAction = new QAction(tr("Copy transaction ID of input"), this);
     QAction *copyAddressAction = new QAction(tr("Copy address of input"), this);
+    QAction *showHideAddressAction = new QAction(tr("Show/hide 'Address' column"), this);
+    QAction *showHideTxIDAction = new QAction(tr("Show/hide 'Transaction' column"), this);
 
     contextMenu = new QMenu();
     contextMenu->addAction(copyAddressAction);
     contextMenu->addAction(copyTxIDAction);
+    contextMenu->addAction(showHideAddressAction);
+    contextMenu->addAction(showHideTxIDAction);
 
     connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
     connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
+    connect(showHideAddressAction, SIGNAL(triggered()), this, SLOT(showHideAddress()));
+    connect(showHideTxIDAction, SIGNAL(triggered()), this, SLOT(showHideTxID()));
 
     connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
 }
@@ -133,13 +139,13 @@ void MintingView::setModel(WalletModel *model)
         mintingView->verticalHeader()->hide();
 
         mintingView->horizontalHeader()->resizeSection(
-                MintingTableModel::Age, 120);
+                MintingTableModel::Age, 60);
         mintingView->horizontalHeader()->resizeSection(
-                MintingTableModel::Balance, 120);
+                MintingTableModel::Balance, 80);
         mintingView->horizontalHeader()->resizeSection(
-                MintingTableModel::CoinDay,120);
+                MintingTableModel::CoinDay,60);
         mintingView->horizontalHeader()->resizeSection(
-                MintingTableModel::MintProbability, 120);
+                MintingTableModel::MintProbability, 105);
 #if QT_VERSION < 0x050000
         mintingView->horizontalHeader()->setResizeMode(
                 MintingTableModel::MintReward, QHeaderView::Stretch);
@@ -148,15 +154,9 @@ void MintingView::setModel(WalletModel *model)
                 MintingTableModel::MintReward, QHeaderView::Stretch);
 #endif
         mintingView->horizontalHeader()->resizeSection(
-            MintingTableModel::Address, 0);
+            MintingTableModel::Address, 245);
         mintingView->horizontalHeader()->resizeSection(
-            MintingTableModel::TxHash, 0);
-        /*
-        mintingView->horizontalHeader()->setSectionHidden(
-            MintingTableModel::Address, true);
-                mintingView->horizontalHeader()->setSectionHidden(
-            MintingTableModel::TxHash, true);
-            */
+            MintingTableModel::TxHash, 75);
     }
 }
 
@@ -227,6 +227,18 @@ void MintingView::copyAddress()
     GUIUtil::copyEntryData(mintingView, MintingTableModel::Address, 0 );
 }
 
+void MintingView::showHideAddress()
+{
+    mintingView->horizontalHeader()->setSectionHidden(MintingTableModel::Address, 
+        !(mintingView->horizontalHeader()->isSectionHidden(MintingTableModel::Address)));
+}
+
+void MintingView::showHideTxID()
+{
+    mintingView->horizontalHeader()->setSectionHidden(MintingTableModel::TxHash, 
+        !(mintingView->horizontalHeader()->isSectionHidden(MintingTableModel::TxHash)));
+}
+
 void MintingView::contextualMenu(const QPoint &point)
 {
     QModelIndex index = mintingView->indexAt(point);
index 3ab3ab7..f318011 100644 (file)
@@ -47,6 +47,8 @@ public slots:
     void chooseMintingInterval(int idx);
     void copyTxID();
     void copyAddress();
+    void showHideAddress();
+    void showHideTxID();
     void contextualMenu(const QPoint &point);
 };