Compare commits

...

12 Commits

Author SHA1 Message Date
dsc 3d5dae1f42 Merge pull request 'Coins: disable sweep instead of hide when output unconfirmed' (#111) from tobtoht/feather:coins_hide_sweep into master
4 years ago
tobtoht 78eabc5ae7 Coins: disable sweep instead of hide when output unconfirmed
4 years ago
dsc 485fb89941 Merge pull request 'Include QtMultimedia for buildbots' (#108) from dsc/feather:include-qtmultimedia into master
4 years ago
dsc df280cdd91 Merge pull request 'Write proper .exe on Windows' (#109) from dsc/feather:write-exe-windows into master
4 years ago
dsc 9b96ece2f9 Merge pull request 'XMRig: Donate level 1' (#110) from dsc/feather:xmrig-donate-level into master
4 years ago
dsc a44087b750
XMRig: Donate level 1
4 years ago
dsc 70cbf59ce8
Write proper .exe on Windows
4 years ago
dsc 4aeaf2660f
Include QtMultimedia for buildbots
4 years ago
dsc fa6ee35fb0 Merge pull request 'Mainwindow: fix tab order and stylization' (#104) from tobtoht/feather:tabs_order into master
4 years ago
tobtoht b1160280fe Mainwindow: fix tab order and stylization
4 years ago
tobtoht 7441d6cb4a Merge pull request 'XMRig: fix stop on windows' (#102) from tobtoht/feather:xmrrig_stop_windows into master
4 years ago
tobtoht ff78b5a6c2 XMRig: fix stop on windows
4 years ago

@ -191,7 +191,7 @@ RUN cd /qt-everywhere-src-5.15.0 && \
-skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
-skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \
-skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \
-skip qtdeclarative -skip qtmultimedia \
-skip qtdeclarative \
-no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation \
-nomake examples -nomake tests -nomake tools

@ -50,7 +50,7 @@ RUN apt install -y \
RUN git clone -b feather-patch --depth 1 https://git.wownero.com/feather/mxe.git && \
cd mxe && \
make -j$THREADS MXE_TARGETS='x86_64-w64-mingw32.static' gcc libqrencode pkgconf libgpg_error libgcrypt cmake libsodium lzma readline libzmq boost qtbase qtsvg qtwebsockets qtimageformats
make -j$THREADS MXE_TARGETS='x86_64-w64-mingw32.static' gcc libqrencode pkgconf libgpg_error libgcrypt cmake libsodium lzma readline libzmq boost qtbase qtsvg qtwebsockets qtimageformats qtmultimedia
# plugins
RUN cd mxe && make -j$THREADS MXE_PLUGIN_DIRS='/mxe/plugins/apps/' MXE_TARGETS='x86_64-w64-mingw32.static' tor

@ -111,10 +111,15 @@ void CoinsWidget::showContextMenu(const QPoint &point) {
if (!isSpent) {
isFrozen ? menu->addAction(m_thawOutputAction) : menu->addAction(m_freezeOutputAction);
}
if (!isFrozen && isUnlocked) {
menu->addAction(m_sweepOutputAction);
if (isFrozen || !isUnlocked) {
m_sweepOutputAction->setDisabled(true);
} else {
m_sweepOutputAction->setEnabled(true);
}
}
menu->addAction(m_viewOutputAction);
}

@ -118,10 +118,9 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(m_ctx->XMRTo, &XmrTo::openURL, this, [=](const QString &url){ Utils::externalLinkWarning(url); });
ui->xmrToWidget->setHistoryModel(m_ctx->XMRTo->tableModel);
#else
ui->tabWidget->setTabVisible(5, false);
ui->tabWidget->setTabVisible(Tabs::XMR_TO, false);
#endif
#if defined(Q_OS_LINUX)
// system tray
m_trayIcon = new QSystemTrayIcon(QIcon(":/assets/images/appicons/64x64.png"));
@ -183,6 +182,8 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(m_xmrig, &XMRigWidget::miningStarted, [=]{ m_ctx->setWindowTitle(true); });
connect(m_xmrig, &XMRigWidget::miningEnded, [=]{ m_ctx->setWindowTitle(false); });
#else
ui->tabWidget->setTabVisible(Tabs::XMRIG, false);
#endif
// CCS/Reddit widget
@ -296,7 +297,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
});
connect(ui->receiveWidget, &ReceiveWidget::showTransactions, [this](const QString &text) {
ui->historyWidget->setSearchText(text);
ui->tabWidget->setCurrentIndex(1); //history
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
});
// History
@ -344,7 +345,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(ui->coinsWidget, &CoinsWidget::sweepOutput, m_ctx, &AppContext::onSweepOutput);
connect(m_ctx, &AppContext::walletClosing, [=]{
ui->tabWidget->setCurrentIndex(0);
ui->tabWidget->setCurrentIndex(Tabs::HOME);
});
// window title
@ -390,9 +391,14 @@ void MainWindow::initMenu() {
connect(ui->actionShow_Coins, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Coins"] = new ToggleTab(ui->tabCoins, "Coins", "Coins", ui->actionShow_Coins, Config::showTabCoins);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_Coins, "Coins");
connect(ui->actionShow_calc, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Calc"] = new ToggleTab(ui->tabCalc, "Calc", "Calc", ui->actionShow_calc, Config::showTabCalc);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_calc, "Calc");
#if defined(XMRTO)
connect(ui->actionShow_xmr_to, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["XMRto"] = new ToggleTab(ui->tabXmrTo, "XMRto", "xmr.to", ui->actionShow_xmr_to, Config::showTabXMRto);
m_tabShowHideMapper["XMRto"] = new ToggleTab(ui->tabXmrTo, "XMRto", "XMR.to", ui->actionShow_xmr_to, Config::showTabXMRto);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_xmr_to, "XMRto");
#else
ui->actionShow_xmr_to->setVisible(false);
@ -405,9 +411,6 @@ void MainWindow::initMenu() {
#else
ui->actionShow_XMRig->setVisible(false);
#endif
connect(ui->actionShow_calc, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Calc"] = new ToggleTab(ui->tabCalc, "Calc", "Calc", ui->actionShow_calc, Config::showTabCalc);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_calc, "Calc");
for (const auto &key: m_tabShowHideMapper.keys()) {
const auto toggleTab = m_tabShowHideMapper.value(key);
@ -1011,17 +1014,17 @@ void MainWindow::donateButtonClicked() {
donation = 1.337;
ui->sendWidget->fill(m_ctx->featherDonationAddress, "Donation to the Feather development team", donation);
ui->tabWidget->setCurrentIndex(2);
ui->tabWidget->setCurrentIndex(Tabs::SEND);
}
void MainWindow::showHistoryTab() {
this->raise();
ui->tabWidget->setCurrentIndex(1);
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
}
void MainWindow::showSendTab() {
this->raise();
ui->tabWidget->setCurrentIndex(2);
ui->tabWidget->setCurrentIndex(Tabs::SEND);
}
void MainWindow::showCalcWindow() {
@ -1030,7 +1033,7 @@ void MainWindow::showCalcWindow() {
void MainWindow::showSendScreen(const CCSEntry &entry) {
ui->sendWidget->fill(entry);
ui->tabWidget->setCurrentIndex(2);
ui->tabWidget->setCurrentIndex(Tabs::SEND);
}
void MainWindow::onViewOnBlockExplorer(const QString &txid) {

@ -65,6 +65,17 @@ public:
qreal screenDpiPhysical;
qreal screenRatio;
enum Tabs {
HOME = 0,
HISTORY,
SEND,
RECEIVE,
COINS,
CALC,
XMR_TO,
XMRIG
};
public slots:
void initWidgets();
void initMenu();

@ -224,13 +224,27 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabCalc">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/coldcard.png</normaloff>:/assets/images/coldcard.png</iconset>
</attribute>
<attribute name="title">
<string>Calc</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="CalcWidget" name="conversionWidget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabXmrTo">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/xmrto.png</normaloff>:/assets/images/xmrto.png</iconset>
</attribute>
<attribute name="title">
<string>xmr.to</string>
<string>XMR.to</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
@ -266,27 +280,13 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabCalc">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/coldcard.png</normaloff>:/assets/images/coldcard.png</iconset>
</attribute>
<attribute name="title">
<string>Calc</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="CalcWidget" name="conversionWidget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabXmrRig">
<attribute name="icon">
<iconset resource="assets.qrc">
<normaloff>:/assets/images/xmrig.ico</normaloff>:/assets/images/xmrig.ico</iconset>
</attribute>
<attribute name="title">
<string>XmrRig</string>
<string>XMRig</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@ -305,7 +305,7 @@
<x>0</x>
<y>0</y>
<width>894</width>
<height>22</height>
<height>30</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -416,8 +416,8 @@
<string>View</string>
</property>
<addaction name="actionShow_Coins"/>
<addaction name="actionShow_xmr_to"/>
<addaction name="actionShow_calc"/>
<addaction name="actionShow_xmr_to"/>
<addaction name="actionShow_XMRig"/>
</widget>
<addaction name="menuFile"/>
@ -506,7 +506,7 @@
</action>
<action name="actionShow_xmr_to">
<property name="text">
<string>Show Xmr.To</string>
<string>Show XMR.to</string>
</property>
</action>
<action name="actionShow_calc">

@ -202,6 +202,10 @@ bool Tor::unpackBins() {
QFile f(torFile);
QFileInfo fileInfo(f);
this->torPath = QDir(this->torDir).filePath(fileInfo.fileName());
#if defined(Q_OS_WIN)
if(!this->torPath.endsWith(".exe"))
this->torPath += ".exe";
#endif
qDebug() << "Writing Tor executable to " << this->torPath;
f.copy(torPath);
f.close();

@ -32,13 +32,13 @@ void XmRig::prepare() {
}
void XmRig::stop() {
if(m_process.state() == QProcess::Running)
m_process.kill();
}
void XmRig::terminate() {
if(m_process.state() == QProcess::Running)
if(m_process.state() == QProcess::Running) {
#if defined(Q_OS_WIN)
m_process.kill(); // https://doc.qt.io/qt-5/qprocess.html#terminate
#else
m_process.terminate();
#endif
}
}
void XmRig::start(const QString &path,
@ -75,7 +75,7 @@ void XmRig::start(const QString &path,
arguments << "-x" << QString("%1:%2").arg(Tor::torHost).arg(Tor::torPort);
if(tls)
arguments << "--tls";
arguments << "--donate-level" << "1";
QString cmd = QString("%1 %2").arg(path, arguments.join(" "));
emit output(cmd.toUtf8());
m_process.start(path, arguments);
@ -122,13 +122,17 @@ bool XmRig::unpackBins() {
QFile f(rigFile);
QFileInfo fileInfo(f);
this->rigPath = QDir(this->rigDir).filePath(fileInfo.fileName());
#if defined(Q_OS_WIN)
if(!this->rigPath.endsWith(".exe"))
this->rigPath += ".exe";
#endif
qDebug() << "Writing XMRig executable to " << this->rigPath;
f.copy(rigPath);
f.close();
#if defined(Q_OS_UNIX)
QFile torBin(this->rigPath);
torBin.setPermissions(QFile::ExeGroup | QFile::ExeOther | QFile::ExeOther | QFile::ExeUser);
QFile rigBin(this->rigPath);
rigBin.setPermissions(QFile::ExeGroup | QFile::ExeOther | QFile::ExeOther | QFile::ExeUser);
#endif
return true;
}

@ -25,7 +25,6 @@ public:
void start(const QString &path, unsigned int threads, const QString &address, const QString &username, const QString &password, bool tor = false, bool tls = true);
void stop();
void terminate();
bool unpackBins();
QString rigDir;

@ -185,7 +185,7 @@ void XMRigWidget::onStartClicked() {
}
void XMRigWidget::onStopClicked() {
m_ctx->XMRig->terminate();
m_ctx->XMRig->stop();
ui->btn_start->setEnabled(true);
ui->btn_stop->setEnabled(false);
ui->label_status->hide();

Loading…
Cancel
Save