<commit_before>/*
 * Qt4 bitcoin GUI.
 *
 * <NAME> 2011-2012
 * The Bitcoin Developers 2011-2012
 */
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
#include "signverifymessagedialog.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "transactiondescdialog.h"
#include "addresstablemodel.h"
#include "transactionview.h"
#include "overviewpage.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "askpassphrasedialog.h"
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
//#include "banner.h"
#include "wallet.h"
#include "bitcoinrpc.h"

#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif

#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QLocale>
#include <QMessageBox>
#include <QProgressBar>
#include <QStackedWidget>
#include <QDateTime>
#include <QMovie>
#include <QFileDialog>
#include <QPicture>

#if QT_VERSION < 0x050000
#include <QDesktopServices>
#else
#include <QStandardPaths>
#endif

#include <QTimer>
#include <QDragEnterEvent>
#include <QMimeData>
#include <QUrl>
#include <QStyle>

#include <iostream>

#include "stylesheeteditor.h"


extern CWallet *pwalletMain;
extern int64 nLastCoinStakeSearchInterval;
extern unsigned int nStakeTargetSpacing;

BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    lockWalletToggleAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("2GiveCoin") + " - " + tr("Wallet"));
    styleSheetEditor = new StyleSheetEditor(this);

    qApp->setStyleSheet(
                "QMainWindow { background: #e6e6e6;font-family:'Open Sans,sans-serif'; } " \
                "QCheckBox { spacing: 5px; } "\
                "QCheckBox::indicator { width: 24px; height: 24px; }" \
                "QCheckBox::indicator:unchecked { image: url(:/images/checkbox_unchecked); }" \
                "QCheckBox::indicator:checked { image: url(:/images/checkbox_checked); }" \
                "QComboBox  { border: 1px solid gray; border-radius: 3px; padding: 1px 18px 1px 3px; }" \
                "QComboBox:editable  { background: white; }" \
                "QComboBox:!editable, QComboBox::drop-down:editable { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); } " \
                "QComboBox:!editable:on, QComboBox::drop-down:editable:on  { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3D3D3, stop: 0.4 #D8D8D8, stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1); } " \
                "QComboBox:on  {  padding-top: 3px; padding-left: 4px; } " \
                "QComboBox::drop-down  { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid;  border-top-right-radius: 3px;  border-bottom-right-radius: 3px; } " \
                "QComboBox::down-arrow1  { image: url(:/icons/1downarrow.png); } " \
                "QComboBox::down-arrow:on  { top: 1px; left: 1px; }" \
                "QLineEdit { border: 1px solid #cccccc; border-radius: 4px; padding: 0px 4px; background: white; selection-background-color: #333333; color: 333333; margin: 6px; }" \
                "QLabel { color: #404041; font-family:Open Sans; } " \
                "QTableView { selection-background-color: #00ccff; background-color: #c7c8ca; border-color: #e8e8e8; margin: 6px; } " \
                "QTableView1 QHeaderView { } " \
                "QTableView1 QAbstractItemView { margin: 4px; min-height: 28px; border: 3px; } " \
                "QStatusBar { background: #a7aaac; } " \
                "#frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; border: 0px; border-color: yellow;} " \
                "#frameBlocks { border: 0px transparent; } " \
                "#frameTop { background-color: #ffffff; border: 2px solid #cccccc; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; } " \
                "#labelBalance, #labelStake, #labelUnconfirmed, #labelImmature { color: #333333 ; } " \
                "#labelStake1 { color: #333333 ; } " \
                "#labelUnconfirmed1 { color: #333333 ; } " \
                "#labelImmature1 { color: #333333 ; } " \
                "#listTransactions { background-color: #ffffff; border: 2px solid #cccccc; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; } " \
                "#listTransactions::item { background-color: #ffffff; } " \
                "#frame2 { background-color: #ffffff; } " \
                "#spacer { background:#a7aaac;border:none; } " \
                "QToolBar#toolbar2 { background-color: #00ccff; width: 72px; min-height: 80px; max-height: 80px; border: 0px; margin: -4px; padding: -4px; } " \
                "QToolBar#toolbar2 > QToolButton { background-color: #00ccff; height: 100%; width: 72px; icon-size: 72px; } " \
                "QToolBar#toolbar2 > QToolButton:disabled { background-color: #00ccff; height: 100%; } " \
                "QToolBar#toolbar { min-height: 80px; max-height: 80px; padding1-top:0px; background: #1d1d1d; max-width:1200px; border: none; margin: -4px; padding: -4px; } " \
                "QToolBar#toolbar > QToolButton { color: #00ccff; border: none; font-size:10px; height: 100%; font-family:Open Sans;padding-top:10px; width:72px; background-color: #1d1d1d } " \
                "QToolBar#toolbar > QToolButton:hover:!checked { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:pressed { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:checked { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:disabled { color: grey font-family:Open Sans; } "
                "#labelMiningIcon { padding-left:5px;font-family:Open Sans;width:100%;font-size:10px;text-align:center;color:grey; } " \
                "QToolButton { min-height: 22px; background-color: #333333; color: white; border: 1px solid #cccccc; } " \
                "QMenu { background: #a7aaac; color: #404041; padding-bottom:10px; border: 1px solid grey; } " \
                "QMenu::item { color:#404041; background-color: transparent; } " \
                "QMenu::item:selected { color: #282828; background-color: #e8e8e8; } " \
                "QMenuBar { background: #a7aaac; color: #404041; } " \
                "QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:#282828; background-color: transparent; } " \
                "QMenuBar::item:selected { color: #e8e8e8; background-color: #282828; }" \
                "QTabWidget {background-color: #e8e8e8; }" \
                "#debug QLabel {color: white; }" \
                "QDateTime {}"
    );

#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon<commit_msg>Rediculous broken stylesheet code to enable labels on windows -- not worth replicating for WIN32 atm<commit_after>/*
 * Qt4 bitcoin GUI.
 *
 * <NAME> 2011-2012
 * The Bitcoin Developers 2011-2012
 */
#include "bitcoingui.h"
#include "transactiontablemodel.h"
#include "addressbookpage.h"
#include "sendcoinsdialog.h"
#include "signverifymessagedialog.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "transactiondescdialog.h"
#include "addresstablemodel.h"
#include "transactionview.h"
#include "overviewpage.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "askpassphrasedialog.h"
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
//#include "banner.h"
#include "wallet.h"
#include "bitcoinrpc.h"

#ifdef Q_OS_MAC
#include "macdockiconhandler.h"
#endif

#include <QApplication>
#include <QMainWindow>
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QToolBar>
#include <QStatusBar>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QLocale>
#include <QMessageBox>
#include <QProgressBar>
#include <QStackedWidget>
#include <QDateTime>
#include <QMovie>
#include <QFileDialog>
#include <QPicture>

#if QT_VERSION < 0x050000
#include <QDesktopServices>
#else
#include <QStandardPaths>
#endif

#include <QTimer>
#include <QDragEnterEvent>
#include <QMimeData>
#include <QUrl>
#include <QStyle>

#include <iostream>

#include "stylesheeteditor.h"


extern CWallet *pwalletMain;
extern int64 nLastCoinStakeSearchInterval;
extern unsigned int nStakeTargetSpacing;

BitcoinGUI::BitcoinGUI(QWidget *parent):
    QMainWindow(parent),
    clientModel(0),
    walletModel(0),
    encryptWalletAction(0),
    changePassphraseAction(0),
    lockWalletToggleAction(0),
    aboutQtAction(0),
    trayIcon(0),
    notificator(0),
    rpcConsole(0)
{
    resize(850, 550);
    setWindowTitle(tr("2GiveCoin") + " - " + tr("Wallet"));
    styleSheetEditor = new StyleSheetEditor(this);

    qApp->setStyleSheet(
                "QMainWindow { background: #e6e6e6;font-family:'Open Sans,sans-serif'; } " \
                "QCheckBox { spacing: 5px; } "\
                "QCheckBox::indicator { width: 24px; height: 24px; }" \
                "QCheckBox::indicator:unchecked { image: url(:/images/checkbox_unchecked); }" \
                "QCheckBox::indicator:checked { image: url(:/images/checkbox_checked); }" \
                "QComboBox  { border: 1px solid gray; border-radius: 3px; padding: 1px 18px 1px 3px; }" \
                "QComboBox:editable  { background: white; }" \
                "QComboBox:!editable, QComboBox::drop-down:editable { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); } " \
                "QComboBox:!editable:on, QComboBox::drop-down:editable:on  { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #D3D3D3, stop: 0.4 #D8D8D8, stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1); } " \
                "QComboBox:on  {  padding-top: 3px; padding-left: 4px; } " \
                "QComboBox::drop-down  { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid;  border-top-right-radius: 3px;  border-bottom-right-radius: 3px; } " \
                "QComboBox::down-arrow1  { image: url(:/icons/1downarrow.png); } " \
                "QComboBox::down-arrow:on  { top: 1px; left: 1px; }" \
                "QLineEdit { border: 1px solid #cccccc; border-radius: 4px; padding: 0px 4px; background: white; selection-background-color: #333333; color: 333333; margin: 6px; }" \
                "QLabel { color: #404041; font-family:Open Sans; } " \
                "QTableView { selection-background-color: #00ccff; background-color: #c7c8ca; border-color: #e8e8e8; margin: 6px; } " \
                "QTableView1 QHeaderView { } " \
                "QTableView1 QAbstractItemView { margin: 4px; min-height: 28px; border: 3px; } " \
                "QStatusBar { background: #a7aaac; } " \
                "#frame { } QToolBar QLabel { padding-top:15px;padding-bottom:10px;margin:0px; border: 0px; border-color: yellow;} " \
                "#frameBlocks { border: 0px transparent; } " \
                "#frameTop { background-color: #ffffff; border: 2px solid #cccccc; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; } " \
                "#labelBalance, #labelStake, #labelUnconfirmed, #labelImmature { color: #333333 ; } " \
                "#labelStake1 { color: #333333 ; } " \
                "#labelUnconfirmed1 { color: #333333 ; } " \
                "#labelImmature1 { color: #333333 ; } " \
                "#listTransactions { background-color: #ffffff; border: 2px solid #cccccc; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; } " \
                "#listTransactions::item { background-color: #ffffff; } " \
                "#frame2 { background-color: #ffffff; } " \
                "#spacer { background:#a7aaac;border:none; } " \
                "QToolBar#toolbar2 { background-color: #00ccff; width: 72px; min-height: 80px; max-height: 80px; border: 0px; margin: -4px; padding: -4px; } " \
                "QToolBar#toolbar2 > QToolButton { background-color: #00ccff; height: 100%; width: 72px; icon-size: 72px; } " \
                "QToolBar#toolbar2 > QToolButton:disabled { background-color: #00ccff; height: 100%; } " \
                "QToolBar#toolbar { min-height: 80px; max-height: 80px; padding1-top:0px; background: #1d1d1d; max-width:1200px; border: none; margin: -4px; padding: -4px; } " \
                "QToolBar#toolbar > QToolButton { color: #00ccff; border: none; font-size:10px; height: 100%; font-family:Open Sans;padding-top:10px; width:72px; background-color: #1d1d1d } " \
                "QToolBar#toolbar > QToolButton:hover:!checked { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:pressed { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:checked { color: #ffffff; background-color: #00ccff; border: none; } " \
                "QToolBar#toolbar > QToolButton:disabled { color: grey font-family:Open Sans; } " \
                "#labelMiningIcon { padding-left:5px;font-family:Open Sans;width:100%;font-size:10px;text-align:center;color:grey; } " \
                "QToolButton { min-height: 22px; background-color: #333333; color: white; border: 1px solid #cccccc; } " \
                "QMenu { background: #a7aaac; color: #404041; padding-bottom:10px; border: 1px solid grey; } " \
                "QMenu::item { color:#404041; background-color: transparent; } " \
                "QMenu::item:selected { color: #282828; background-color: #e8e8e8; } " \
                "QMenuBar { background: #a7aaac; color: #404041; } " \
                "QMenuBar::item { font-size:12px;padding-bottom:12px;padding-top:12px;padding-left:15px;padding-right:15px;color:#282828; background-color: transparent; } " \
                "QMenuBar::item:selected { color: #e8e8e8; background-color: #282828; }" \
                "QTabWidget {background-color: #e8e8e8; }" \
                "#debug QLabel {color: white; }" \
                "QDateTime {}"
    );

#ifndef Q_OS_MAC
    qApp->setWindowIcon(QIcon(":icons/bitcoin"));
    setWindowIcon(QIcon(":icons/bitcoin"));
#else
    setUnifiedTitleAndToolBarOnMac(true);
    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif
    // Accept D&D of URIs
    setAcceptDrops(true);

    // Create actions for the toolbar, menu bar and tray/dock icon
{'fraction_non_alphanumeric': 0.14630235392213456, 'fraction_numerical': 0.04323006862933744, 'mean_word_length': 3.1689839572192513, 'pattern_counts': {'":': 4, '<': 63, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5286533', 'n_tokens_mistral': 5848, 'n_tokens_neox': 5335, 'n_words': 1093}