Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Dev] Documenting Feathercoin Specific Software settings - Part 5

    Technical Development
    2
    26
    7392
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wrapper
      wrapper Moderators last edited by wrapper

      Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

      add qrcode : - commit

      https://github.com/FeatherCoin/Feathercoin/commit/6f0ff3bb8b59d5955d1fcb9614ed9259061ca882

      src/qt/qrcodedialog.cpp

      Include QR codes zxing.

      New file 173 lines of code.

       + #include "qrcodedialog.h"
       + #include "ui_qrcodedialog.h"
       + 
       + #include "bitcoinunits.h"
       + #include "guiconstants.h"
       + #include "guiutil.h"
       + #include "optionsmodel.h"
       + 
       + #include <QPixmap>
       + #if QT_VERSION < 0x050000
       + #include <QUrl>
       + #endif
       + 
       + #include <qrencode.h>
       + 
       + QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) :
       +     QDialog(parent),
      

      Start of code on new file

      1 Reply Last reply Reply Quote 0
      • wrapper
        wrapper Moderators last edited by wrapper

        Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

        Add QR-Snap : - commit

        https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

        configure.ac

        Include QR codes zxing.

         +define(_USE_ZXING,1)
        

        Add zxing code

         +AC_DEFINE(USE_ZXING, _USE_ZXING,[Define to 1 libzxing must be available for support])
        

        Code added

         +AC_SUBST(USE_ZXING, _USE_ZXING)
        

        zxing code added

        1 Reply Last reply Reply Quote 0
        • wrapper
          wrapper Moderators last edited by wrapper

          Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

          Add QR-Snap : - commit

          https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

          src/qt/Makefile.am

          Include QR codes zxing.

           +   forms/qrcodedialog.ui \
           +   forms/snapwidget.ui \
          
           +   moc_qrcodedialog.cpp \
           +   moc_snapwidget.cpp \
          
           +   qrcodedialog.h \
           +   snapwidget.h \
           +   qimagesource.h \
          
           +   qrcodedialog.cpp \
          
           +   snapwidget.cpp \
           +   qimagesource.cpp \
          

          zxing Code added

          1 Reply Last reply Reply Quote 0
          • wrapper
            wrapper Moderators last edited by

            Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

            Add QR-Snap : - commit

            https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

            src/qt/feathercoin.qrc

            Include QR codes zxing.

             +    <file alias="merchant_bit">res/images/bittrex.png</file>
            
            1 Reply Last reply Reply Quote 0
            • wrapper
              wrapper Moderators last edited by

              Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

              Add QR-Snap : - commit

              https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

              src/qt/forms/merchantlist.ui

              Include QR codes zxing.

               +         <layout class="QHBoxLayout" name="horizontalLayout_6">
               +          <item>
               +           <widget class="QLabel" name="label_left_5">
               +            <property name="cursor">
               +             <cursorShape>PointingHandCursor</cursorShape>
               +            </property>
               +            <property name="toolTip">
               +             <string>a altcoin currency exchange</string>
               +            </property>
               +            <property name="text">
               +             <string/>
               +            </property>
               +            <property name="pixmap">
               +             <pixmap resource="../feathercoin.qrc">:/images/merchant_bit</pixmap>
               +            </property>
               +           </widget>
               +          </item>
               +          <item>
               +           <widget class="QLabel" name="label_left_6">
               +            <property name="text">
               +             <string/>
               +            </property>
               +           </widget>
               +          </item>
               +         </layout>
               +        </item>
               +        <item>
              

              Code included

               -        <layout class="QHBoxLayout" name="horizontalLayout_6">
               -         <item>
               -          <widget class="QLabel" name="label_left_5">
               -           <property name="text">
               -            <string/>
               -           </property>
               -          </widget>
               -         </item>
               -         <item>
               -          <widget class="QLabel" name="label_left_6">
               -           <property name="text">
               -            <string/>
               -           </property>
               -          </widget>
               -         </item>
               -        </layout>
               -       </item>
               -       <item>
              

              Code removed

              1 Reply Last reply Reply Quote 0
              • wrapper
                wrapper Moderators last edited by wrapper

                Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                Add QR-Snap : - commit

                https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                src/qt/forms/sendcoinsdialog.ui

                Include QR codes zxing. User interface changes

                 +     <property name="margin">
                

                Code added

                 -           <property name="leftMargin">
                 -            <number>0</number>
                 -           </property>
                 -           <property name="topMargin">
                 -            <number>0</number>
                 -           </property>
                 -           <property name="rightMargin">
                 -            <number>0</number>
                 -           </property>
                 -           <property name="bottomMargin">
                

                Code removed

                 +        <height>177</height>
                

                Code added

                 -       <property name="leftMargin">
                 -        <number>0</number>
                 -       </property>
                 -       <property name="topMargin">
                 -        <number>0</number>
                 -       </property>
                 -       <property name="rightMargin">
                 -        <number>0</number>
                 -       </property>
                 -       <property name="bottomMargin">
                

                Code removed

                 +         <iconset resource="../feathercoin.qrc">
                
                 +         <iconset resource="../feathercoin.qrc">
                
                 +         <iconset resource="../feathercoin.qrc">
                

                Code replaced

                 +       <widget class="QPushButton" name="sendQRButton">
                 +        <property name="text">
                 +         <string>Send To &amp;QR</string>
                 +        </property>
                 +        <property name="icon">
                 +         <iconset resource="../feathercoin.qrc">
                 +          <normaloff>:/icons/qrcode</normaloff>:/icons/qrcode</iconset>
                 +        </property>
                 +       </widget>
                 +      </item>
                 +      <item>
                

                Code added

                 +  <include location="../feathercoin.qrc"/>
                

                Code replaced

                1 Reply Last reply Reply Quote 0
                • wrapper
                  wrapper Moderators last edited by

                  Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                  Add QR-Snap : - commit

                  https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                  src/qt/merchantlist.cpp

                   +     ui->label_left_5->installEventFilter(this);
                   +     ui->label_left_6->installEventFilter(this);
                  

                  Code replaced

                   +     if (obj == ui->label_left_5) { 
                   +    QDesktopServices::openUrl(QUrl("https://bittrex.com/Market/?MarketName=BTC-FTC"));
                   +     return true; 
                   +     }
                  

                  Code added

                  1 Reply Last reply Reply Quote 0
                  • wrapper
                    wrapper Moderators last edited by wrapper

                    Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                    Add QR-Snap : - commit

                    https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                    src/qt/qimagesource.cpp

                    New file addition

                     + #include "qimagesource.h"
                     + #include <QColor>
                     + 
                     + QImageLuminanceSource::QImageLuminanceSource(QImage& _image) : LuminanceSource(_image.width(), _image.height())
                     + {
                     +     image = _image.copy();
                     + }
                     + 
                     + 
                     + ArrayRef<char> QImageLuminanceSource::getRow(int y, ArrayRef<char> _row) const
                     + {
                     +     for (int x = 0; x < this->getWidth(); x     +      + )
                     +         _row[x] = qGray(image.pixel(x, y));
                     +     return _row;
                     + }
                     + 
                     + ArrayRef<char> QImageLuminanceSource::getMatrix() const
                     + {
                     +     ArrayRef<char> mymatrix(width*height);
                     +     for (int y = 0; y < height; y     +      + )
                     +     {
                     +         for (int x = 0; x < width; x     +      + ) {
                     +             mymatrix[y*width     + x] = qGray(image.pixel(x, y));
                     +         }
                     +     }
                     +     return mymatrix;
                     + }
                     + 
                    

                    New file code

                    1 Reply Last reply Reply Quote 0
                    • wrapper
                      wrapper Moderators last edited by

                      Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                      Add QR-Snap : - commit

                      https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                      src/qt/qimagesource.h

                      New file addition

                       + #ifndef QIMAGELUMINANCESOURCE_H
                       + #define QIMAGELUMINANCESOURCE_H
                       + 
                       + #include <QImage>
                       + #include <QString>
                       + #include <zxing/LuminanceSource.h>
                       + 
                       + using namespace zxing;
                       + 
                       + class QImageLuminanceSource : public LuminanceSource
                       + {
                       + public:
                       +     QImageLuminanceSource(QImage& image);
                       +     ArrayRef<char> getMatrix() const;
                       +     ArrayRef<char> getRow(int y, ArrayRef<char> row) const;
                       +    
                       + private:
                       +     QImage image;
                       + };
                       + 
                       + #endif //QIMAGELUMINANCESOURCE_H
                      

                      New file code

                      1 Reply Last reply Reply Quote 0
                      • wrapper
                        wrapper Moderators last edited by

                        Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                        Add QR-Snap : - commit

                        https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                        src/qt/res/images/*

                          +   src/qt/res/images/bittrex.png
                        

                        New image file addition

                        1 Reply Last reply Reply Quote 0
                        • wrapper
                          wrapper Moderators last edited by

                          Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                          Add QR-Snap : - commit

                          https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                          src/qt/sendcoinsdialog.cpp*

                           + #include <QClipboard>
                          
                          
                           + #ifdef USE_ZXING
                           + #include "snapwidget.h"
                           + #endif
                           +  
                          

                          New code

                           +    ui->sendQRButton->setIcon(QIcon());
                          

                          Code replaced

                           + #ifndef USE_ZXING
                           +     this->ui->sendQRButton->hide();
                           + #endif
                           + 
                          

                          Code added

                           + void SendCoinsDialog::on_sendQRButton_clicked()
                           + {
                           + #ifdef USE_ZXING
                           +     SnapWidget* snap = new SnapWidget(this);
                           +     connect(snap, SIGNAL(finished(QString)), this, SLOT(onSnapClosed(QString)));
                           + #endif
                           + }
                           + 
                           + void SendCoinsDialog::onSnapClosed(QString s)
                           + {
                           +     emit sendCoins(s);
                           + }
                           + 
                          

                          Code added

                          1 Reply Last reply Reply Quote 0
                          • wrapper
                            wrapper Moderators last edited by

                            Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                            Add QR-Snap : - commit

                            https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                            src/qt/sendcoinsdialog.h*

                             +     /** Scan of QR code finished */
                             +     void onSnapClosed(QString s);
                             +     
                            
                             +     void on_sendQRButton_clicked();
                            
                             +     void signMessage(QString addr);
                             +     void verifyMessage(QString addr);
                             +     void sendCoins(QString addr);
                            

                            Code added

                            1 Reply Last reply Reply Quote 0
                            • wrapper
                              wrapper Moderators last edited by

                              Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                              Add QR-Snap : - commit

                              https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                              qt/sendcoinsentry.cpp*

                               -    ui->payTo->setText(address);
                              

                              Code removed

                               +     //may have been scanned in so it must be parsed first
                               +     if (address.size() > 34) {
                               +         QString _address;
                               +         QString _label;
                               +         QString _amount;     
                               +         int x = address.indexOf(":", 0, Qt::CaseInsensitive);
                               +         if (x) 
                               +             _address = address.mid(x     + 1, 34); 
                               +         //Todo: parse out label and amount from incoming string
                               +         ui->payTo->setText(_address);
                               +     }
                               +     else {
                               +         ui->payTo->setText(address);
                               +     }
                              

                              Code replaced

                              1 Reply Last reply Reply Quote 0
                              • wrapper
                                wrapper Moderators last edited by wrapper

                                Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                Add QR-Snap : - commit

                                https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                src/qt/snapwidget.cpp

                                New file

                                 + // Copyright (c) 2013-2014 The Feathercoin developers
                                 + 
                                 + #include "snapwidget.h"
                                 + #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
                                 + #include <QtWidgets>
                                 + #include <QDialog>
                                 + #else
                                 + #include <QDesktopWidget>
                                 + #endif
                                 + #include <zxing/common/GlobalHistogramBinarizer.h>
                                 + #include <zxing/Binarizer.h>
                                 + #include <zxing/BinaryBitmap.h>
                                 + #include <zxing/MultiFormatReader.h>
                                 + #include "qimagesource.h"
                                 + 
                                 + 
                                 + //////////////////  SnapWidget Class
                                 + SnapWidget::SnapWidget(QWidget* _parent)
                                 + #ifdef Q_OS_MAC
                                

                                Start of new file code 114 lines

                                1 Reply Last reply Reply Quote 0
                                • wrapper
                                  wrapper Moderators last edited by

                                  Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                  Add QR-Snap : - commit

                                  https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                  src/qt/snapwidget.h

                                  New file

                                   + // Copyright (c) 2013-2014 The Feathercoin developers
                                   + 
                                   + #ifndef SNAPWIDGET_H
                                   + #define SNAPWIDGET_H
                                   + #include "ui_snapwidget.h"
                                   + #include "addressbookpage.h"
                                   + 
                                   + class SnapWidget :public QDialog, public Ui::SnapWidget
                                   + {
                                   +     Q_OBJECT
                                   + public:
                                   + 
                                   +     SnapWidget(QWidget* _parent);
                                   +     ~SnapWidget();
                                   +     void prepareMask();
                                   +     virtual void closeEvent(QCloseEvent *event);
                                   +     void resizeEvent(QResizeEvent*);
                                   +     public slots:
                                   +     void on_cancelButton_clicked();
                                   +     void on_snapButton_clicked();
                                   + 
                                   + 
                                   + signals:
                                   +     void finished(QString s);
                                   + 
                                   + public:
                                   +     QString decodedString;
                                   + 
                                   + };
                                   + #endif // SNAPWIDGET_H
                                  

                                  New file code

                                  1 Reply Last reply Reply Quote 0
                                  • wrapper
                                    wrapper Moderators last edited by wrapper

                                    Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                    Add QR-Snap : - commit

                                    https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                    src/qt/walletmodel.cpp

                                     +#include "init.h"
                                    

                                    Code added

                                     +     // Get required locks upfront. This avoids the GUI from getting stuck on
                                     +     // periodical polls if the core is holding the locks for a longer time -
                                     +     // for example, during a wallet rescan.
                                     +     TRY_LOCK(cs_main, lockMain);
                                     +     if(!lockMain)
                                     +         return;
                                     +     TRY_LOCK(wallet->cs_wallet, lockWallet);
                                     +     if(!lockWallet)
                                     +         return;
                                     + 
                                    

                                    Code added

                                     + 
                                         checkBalanceChanged();
                                     +         if(transactionTableModel)
                                     +             transactionTableModel->updateConfirmations();
                                    

                                    Code added

                                     + bool WalletModel::importPrivateKey(QString privKey)
                                     + {
                                     +     CBitcoinSecret vchSecret;
                                     +     bool fGood = vchSecret.SetString(privKey.toStdString());
                                     +     if (!fGood)
                                     +         return false;
                                     +     CKey key = vchSecret.GetKey();
                                     +     CPubKey pubkey = key.GetPubKey();
                                     +     CKeyID vchAddress = pubkey.GetID();
                                     +     {
                                     +         LOCK2(cs_main, pwalletMain->cs_wallet);
                                     +         pwalletMain->MarkDirty();
                                     +         pwalletMain->SetAddressBook(vchAddress, ("imported wallet"),"send");
                                     +         if (!pwalletMain->AddKeyPubKey(key, pubkey))
                                     +             return false;
                                     +         pwalletMain->ScanForWalletTransactions(chainActive.Genesis(), true);
                                     +         pwalletMain->ReacceptWalletTransactions();
                                     +         //printf("importing walling with public key %s\n", vchAddress.ToString().c_str()); 
                                     +     }
                                     +     return true;
                                     + }
                                     + 
                                    

                                    Code added

                                     +     LOCK2(cs_main, wallet->cs_wallet);
                                    
                                     +     LOCK2(cs_main, wallet->cs_wallet);
                                    
                                     +     LOCK2(cs_main, wallet->cs_wallet); // ListLockedCoins, mapWallet
                                    

                                    Wallet lock interface change, numerous lock -> lock2 updates.

                                    1 Reply Last reply Reply Quote 0
                                    • wrapper
                                      wrapper Moderators last edited by wrapper

                                      Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                      Add QR-Snap : - commit

                                      https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                      src/qt/walletmodel.h

                                       +#pragma warning(disable:4717)  //bogus warning from MS
                                      

                                      Add code

                                       +		bool importPrivateKey(QString privKey);
                                      

                                      Add code

                                      1 Reply Last reply Reply Quote 0
                                      • wrapper
                                        wrapper Moderators last edited by wrapper

                                        Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                        Add QR-Snap : - commit

                                        https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                        src/qt/walletview.cpp

                                         +     connect(receiveCoinsPage, SIGNAL(importWallet(QString)), this, SLOT(importWallet(QString)));
                                         +     // Clicking on "Send to QR" sends you to the send coins tab after snapping and reading image
                                         +     connect(sendCoinsPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString)));
                                        

                                        Code added

                                         -        connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
                                        +        connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));    
                                        

                                        Code replaced ??

                                         + void WalletView::importWallet(QString privateKey)
                                         + {
                                         +     if(!walletModel)
                                         +         return;
                                         +         
                                         +     bool b =walletModel->importPrivateKey(privateKey);   
                                         + }
                                         + 
                                        

                                        Code added

                                        1 Reply Last reply Reply Quote 0
                                        • wrapper
                                          wrapper Moderators last edited by

                                          Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                          Add QR-Snap : - commit

                                          https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4

                                          src/qt/walletview.h

                                          QR codes first commit

                                           +    /** Import a wallet from a string */
                                           +    void importWallet(QString privateKey);
                                          

                                          Code added

                                          1 Reply Last reply Reply Quote 0
                                          • Wellenreiter
                                            Wellenreiter Moderators @wrapper last edited by

                                            @wrapper

                                            • Copyright was updated in a later commit
                                            • the zxing flag was removed in a later commit
                                              • qrflag triggers use of zxing then

                                            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                                            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post