Merge pull request #119 from fsb4000/Android
author0xDEADFACE <masmfan@gmail.com>
Fri, 23 Jan 2015 08:39:01 +0000 (11:39 +0300)
committer0xDEADFACE <masmfan@gmail.com>
Fri, 23 Jan 2015 08:39:01 +0000 (11:39 +0300)
Android, AboutDialog, Copyright

COPYING
doc/building novacoin-qt for android under Windows.txt
src/compat.h
src/netbase.cpp
src/qt/aboutdialog.cpp
src/qt/aboutdialog.h
src/qt/bitcoingui.cpp
src/qt/bitcoingui.h
src/qt/forms/aboutdialog.ui
src/qt/locale/bitcoin_ru.ts
src/util.cpp

diff --git a/COPYING b/COPYING
index 42b288f..c22b37d 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,8 @@
-Copyright (c) 2013 NovaCoin Developers
-Copyright (c) 2011-2012 PPCoin Developers
-Copyright (c) 2009-2012 Bitcoin Developers
+\feffCopyright © 2009-2015 The Bitcoin developers
+Copyright © 2011-2012 The PPCoin Developers
+Copyright © 2014 The Peerunity Developers
+Copyright © 2014 The EmerCoin Developers
+Copyright © 2012-2015 The NovaCoin developers
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
index bae9d77..778dfbc 100644 (file)
@@ -145,25 +145,6 @@ TARGET_OS=OS_ANDROID_CROSSCOMPILE make libleveldb.a libmemenv.a
 3. Компиляция
 3.1 Собираем Novacoin QT
 
-Откройте файл src\compat.h
-Измените #include <sys/fcntl.h> на #include <fcntl.h>
-
-Откройте файл src\util.cpp
-Закоментируйте строки с 59 по 61
-//#ifndef WIN32
-//#include <execinfo.h>
-//#endif
-Закоментируйте строки с 1062 по 1067
-//#ifndef WIN32
-//        void* pszBuffer[32];
-//        size_t size;
-//        size = backtrace(pszBuffer, 32);
-//        backtrace_symbols_fd(pszBuffer, size, fileno(fileout));
-//#endif
-
-Откройте файл src\netbase.cpp
-Измените #include <sys/fcntl.h> на #include <fcntl.h>
-
 Откройте файл novacoin-qt.pro
 Вместо 
 
index 3c95e37..67fe63d 100644 (file)
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
+#ifdef ANDROID
+#include <fcntl.h>
+#else
 #include <sys/fcntl.h>
+#endif
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <net/if.h>
index 59e5d70..3c83b19 100644 (file)
@@ -9,8 +9,12 @@
 #include "hash.h"
 
 #ifndef WIN32
+#ifdef ANDROID
+#include <fcntl.h>
+#else
 #include <sys/fcntl.h>
 #endif
+#endif
 
 #ifdef _MSC_VER
 #include <BaseTsd.h>
index 7c6a42e..a66287d 100644 (file)
@@ -7,8 +7,10 @@
 
 #include "version.h"
 
+#include <QKeyEvent>
+
 AboutDialog::AboutDialog(QWidget *parent) :
-    QDialog(parent, DIALOGWINDOWHINTS),
+    QWidget(parent, DIALOGWINDOWHINTS),
     ui(new Ui::AboutDialog)
 {
     ui->setupUi(this);
@@ -31,3 +33,18 @@ void AboutDialog::on_buttonBox_accepted()
 {
     close();
 }
+
+void AboutDialog::keyPressEvent(QKeyEvent *event)
+{
+#ifdef ANDROID
+    if(event->key() == Qt::Key_Back)
+    {
+        close();
+    }
+#else
+    if(event->key() == Qt::Key_Escape)
+    {
+        close();
+    }
+#endif
+}
\ No newline at end of file
index 2ed9e9e..714970f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ABOUTDIALOG_H
 #define ABOUTDIALOG_H
 
-#include <QDialog>
+#include <QWidget>
 
 namespace Ui {
     class AboutDialog;
@@ -9,7 +9,7 @@ namespace Ui {
 class ClientModel;
 
 /** "About" dialog box */
-class AboutDialog : public QDialog
+class AboutDialog : public QWidget
 {
     Q_OBJECT
 
@@ -21,6 +21,8 @@ public:
 private:
     Ui::AboutDialog *ui;
 
+    void keyPressEvent(QKeyEvent *);
+
 private slots:
     void on_buttonBox_accepted();
 };
index 6b6b9e7..f9b6da6 100644 (file)
@@ -83,7 +83,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
     aboutQtAction(0),
     trayIcon(0),
     notificator(0),
-    rpcConsole(0)
+    rpcConsole(0),
+    aboutDialog(0)
 {
     resize(850, 550);
     setWindowTitle(tr("NovaCoin") + " - " + tr("Wallet"));
@@ -200,6 +201,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
     rpcConsole = new RPCConsole(0);
     connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
 
+    aboutDialog = new AboutDialog(0);
+
     // Clicking on "Verify Message" in the address book sends you to the verify message tab
     connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString)));
     // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab
@@ -217,6 +220,7 @@ BitcoinGUI::~BitcoinGUI()
 #endif
 
     delete rpcConsole;
+    delete aboutDialog;
 }
 
 void BitcoinGUI::createActions()
@@ -538,9 +542,9 @@ void BitcoinGUI::optionsClicked()
 
 void BitcoinGUI::aboutClicked()
 {
-    AboutDialog dlg;
-    dlg.setModel(clientModel);
-    dlg.exec();
+    aboutDialog->setModel(clientModel);
+    aboutDialog->setWindowModality(Qt::ApplicationModal);
+    aboutDialog->show();
 }
 
 void BitcoinGUI::setNumConnections(int count)
index 58cf842..8b8daf9 100644 (file)
@@ -16,6 +16,7 @@ class SignVerifyMessageDialog;
 class MultisigDialog;
 class Notificator;
 class RPCConsole;
+class AboutDialog;
 
 QT_BEGIN_NAMESPACE
 class QLabel;
@@ -108,6 +109,7 @@ private:
     TransactionView *transactionView;
     MintingView *mintingView;
     RPCConsole *rpcConsole;
+    AboutDialog *aboutDialog;
 
     QMovie *syncIconMovie;
 
index 13b0acf..d912c88 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog">
+ <widget class="QWidget" name="AboutDialog">
   <property name="geometry">
    <rect>
     <x>0</x>
         <cursorShape>IBeamCursor</cursorShape>
        </property>
        <property name="text">
-        <string>Copyright © 2009-2014 The Bitcoin developers
-Copyright © 2012-2014 The NovaCoin developers</string>
+        <string>Copyright © 2009-2015 The Bitcoin developers
+Copyright © 2011-2012 The PPCoin Developers
+Copyright © 2014 The Peerunity Developers
+Copyright © 2014 The EmerCoin Developers
+Copyright © 2012-2015 The NovaCoin developers</string>
        </property>
        <property name="textInteractionFlags">
         <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
index 13cd474..50c8336 100644 (file)
@@ -495,10 +495,16 @@ Reduce the number of addresses involved in the address creation.</source>
     </message>
     <message>
         <location line="+41"/>
-        <source>Copyright © 2009-2014 The Bitcoin developers
-Copyright © 2012-2014 The NovaCoin developers</source>
-        <translation>Все права защищены © 2009-2014 Разработчики Bitcoin
-Все права защищены © 2012-2014 Разработчики NovaCoin</translation>
+        <source>Copyright © 2009-2015 The Bitcoin developers
+Copyright © 2011-2012 The PPCoin Developers
+Copyright © 2014 The Peerunity Developers
+Copyright © 2014 The EmerCoin Developers
+Copyright © 2012-2015 The NovaCoin developers</source>
+        <translation>Все права защищены © 2009-2015 Разработчики Bitcoin
+Все права защищены © 2011-2012 Разработчики PPCoin
+Все права защищены © 2014 Разработчики Peerunity
+Все права защищены © 2014 Разработчики EmerCoin
+Все права защищены © 2012-2015 Разработчики NovaCoin</translation>
     </message>
     <message>
         <location line="+13"/>
index 583d5e5..be1339f 100644 (file)
@@ -56,7 +56,7 @@ namespace boost {
 # include <sys/prctl.h>
 #endif
 
-#ifndef WIN32
+#if !defined(WIN32) && !defined(ANDROID)
 #include <execinfo.h>
 #endif
 
@@ -1059,7 +1059,7 @@ void LogStackTrace() {
     printf("\n\n******* exception encountered *******\n");
     if (fileout)
     {
-#ifndef WIN32
+#if !defined(WIN32) && !defined(ANDROID)
         void* pszBuffer[32];
         size_t size;
         size = backtrace(pszBuffer, 32);