Skip to content

Commit f85a459

Browse files
committed
refactor(qt): move debug log action from General widget to File menu
1 parent 7839115 commit f85a459

File tree

6 files changed

+9
-51
lines changed

6 files changed

+9
-51
lines changed

src/qt/bitcoingui.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ void BitcoinGUI::createActions()
447447
openPeersAction->setStatusTip(tr("Show peers info"));
448448
openRepairAction = new QAction(tr("Wallet &Repair"), this);
449449
openRepairAction->setStatusTip(tr("Show wallet repair options"));
450+
openDebugLogAction = new QAction(tr("Open &debug log file"), this);
451+
openDebugLogAction->setStatusTip(tr("Open the debug log file from the current data directory"));
450452
openConfEditorAction = new QAction(tr("Open &wallet configuration file"), this);
451453
openConfEditorAction->setStatusTip(tr("Open configuration file"));
452454
// override TextHeuristicRole set by default which confuses this action with application settings
@@ -517,7 +519,8 @@ void BitcoinGUI::createActions()
517519
connect(openPeersAction, &QAction::triggered, this, &BitcoinGUI::showPeers);
518520
connect(openRepairAction, &QAction::triggered, this, &BitcoinGUI::showRepair);
519521

520-
// Open configs and backup folder from menu
522+
// Open logs, configs, and backup folder from menu
523+
connect(openDebugLogAction, &QAction::triggered, GUIUtil::openDebugLogfile);
521524
connect(openConfEditorAction, &QAction::triggered, this, &BitcoinGUI::showConfEditor);
522525
connect(showBackupsAction, &QAction::triggered, this, &BitcoinGUI::showBackups);
523526

@@ -640,6 +643,7 @@ void BitcoinGUI::createMenuBar()
640643
file->addAction(m_load_psbt_clipboard_action);
641644
file->addSeparator();
642645
}
646+
file->addAction(openDebugLogAction);
643647
file->addAction(openConfEditorAction);
644648
if(walletFrame) {
645649
file->addAction(showBackupsAction);
@@ -1142,6 +1146,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
11421146
repair_action = pmenu->addAction(openRepairAction->text(), openRepairAction, &QAction::trigger);
11431147
}
11441148
pmenu->addSeparator();
1149+
QAction* debuglog_action = pmenu->addAction(openDebugLogAction->text(), openDebugLogAction, &QAction::trigger);
11451150
QAction* conf_action = pmenu->addAction(openConfEditorAction->text(), openConfEditorAction, &QAction::trigger);
11461151
QAction* backups_action{nullptr};
11471152
if (enableWallet) {
@@ -1158,7 +1163,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
11581163
// Using QSystemTrayIcon::Context is not reliable.
11591164
// See https://bugreports.qt.io/browse/QTBUG-91697
11601165
pmenu, &QMenu::aboutToShow,
1161-
[this, show_hide_action, send_action, cj_send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action, repair_action, backups_action, info_action, graph_action, peer_action, conf_action] {
1166+
[this, show_hide_action, send_action, cj_send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action, repair_action, backups_action, info_action, graph_action, peer_action, debuglog_action, conf_action] {
11621167
if (m_node.shutdownRequested()) return; // nothing to do, node is shutting down.
11631168

11641169
if (show_hide_action) show_hide_action->setText(
@@ -1185,6 +1190,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
11851190
node_window_action->setEnabled(openRPCConsoleAction->isEnabled());
11861191
graph_action->setEnabled(openGraphAction->isEnabled());
11871192
peer_action->setEnabled(openPeersAction->isEnabled());
1193+
debuglog_action->setEnabled(openDebugLogAction->isEnabled());
11881194
conf_action->setEnabled(openConfEditorAction->isEnabled());
11891195
if (quit_action) quit_action->setEnabled(true);
11901196
}

src/qt/bitcoingui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ class BitcoinGUI : public QMainWindow
173173
QAction* openGraphAction = nullptr;
174174
QAction* openPeersAction = nullptr;
175175
QAction* openRepairAction = nullptr;
176+
QAction* openDebugLogAction = nullptr;
176177
QAction* openConfEditorAction = nullptr;
177178
QAction* showBackupsAction = nullptr;
178179
QAction* openAction = nullptr;

src/qt/forms/debugwindow.ui

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -138,43 +138,6 @@
138138
</widget>
139139
</widget>
140140
</item>
141-
<item>
142-
<layout class="QHBoxLayout" name="horizontalLayoutInfoFooter">
143-
<item>
144-
<spacer name="horizontalSpacerInfoFooter">
145-
<property name="orientation">
146-
<enum>Qt::Horizontal</enum>
147-
</property>
148-
<property name="sizeHint" stdset="0">
149-
<size>
150-
<width>40</width>
151-
<height>20</height>
152-
</size>
153-
</property>
154-
</spacer>
155-
</item>
156-
<item>
157-
<widget class="QLabel" name="labelDebugLogfile">
158-
<property name="text">
159-
<string>Debug log file</string>
160-
</property>
161-
</widget>
162-
</item>
163-
<item>
164-
<widget class="QPushButton" name="openDebugLogfileButton">
165-
<property name="toolTip">
166-
<string>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</string>
167-
</property>
168-
<property name="text">
169-
<string>&amp;Open</string>
170-
</property>
171-
<property name="autoDefault">
172-
<bool>false</bool>
173-
</property>
174-
</widget>
175-
</item>
176-
</layout>
177-
</item>
178141
</layout>
179142
</widget>
180143
<widget class="QWidget" name="pageConsole">

src/qt/res/css/general.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,10 +1753,6 @@ QWidget#RPCConsole QLabel#banHeading { /* Peers Info Header */
17531753
margin-bottom: 15px;
17541754
}
17551755

1756-
QWidget#RPCConsole QPushButton#openDebugLogfileButton {
1757-
max-width: 60px;
1758-
}
1759-
17601756
QWidget#RPCConsole QTextEdit#messagesWidget { /* Console Messages Window */
17611757
padding: 10px;
17621758
}

src/qt/rpcconsole.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
555555
+ ts.from + "\"" + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
556556
+ ts.no + "\"" + tr("no high bandwidth relay selected") + "</li></ul>"};
557557
ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list));
558-
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
559558

560559
setButtonIcons();
561560

@@ -1202,11 +1201,6 @@ void RPCConsole::on_stackedWidgetRPC_currentChanged(int index)
12021201
}
12031202
}
12041203

1205-
void RPCConsole::on_openDebugLogfileButton_clicked()
1206-
{
1207-
GUIUtil::openDebugLogfile();
1208-
}
1209-
12101204
void RPCConsole::scrollToEnd()
12111205
{
12121206
QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar();

src/qt/rpcconsole.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ private Q_SLOTS:
101101
void showInfoView(int index);
102102
void on_lineEdit_returnPressed();
103103
void on_stackedWidgetRPC_currentChanged(int index);
104-
/** open the debug.log from the current datadir */
105-
void on_openDebugLogfileButton_clicked();
106104
/** change the time range of the network traffic graph */
107105
void on_sldGraphRange_valueChanged(int value);
108106
void resizeEvent(QResizeEvent *event) override;

0 commit comments

Comments
 (0)