mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
qt log viewer now works
This commit is contained in:
parent
f8fe124428
commit
ed2818eaa2
12 changed files with 335 additions and 40 deletions
|
@ -27,15 +27,19 @@
|
|||
#include "DaemonQT.h"
|
||||
#include "SignatureTypeComboboxFactory.h"
|
||||
|
||||
#include "logviewermanager.h"
|
||||
|
||||
std::string programOptionsWriterCurrentSection;
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
,logStream(logStream_)
|
||||
#ifndef ANDROID
|
||||
,quitting(false)
|
||||
#endif
|
||||
,wasSelectingAtStatusMainPage(false)
|
||||
,showHiddenInfoStatusMainPage(false)
|
||||
,logViewerManagerPtr(nullptr)
|
||||
,ui(new Ui::MainWindow)
|
||||
,statusButtonsUI(new Ui::StatusButtonsForm)
|
||||
,routerCommandsUI(new Ui::routerCommandsWidget)
|
||||
|
@ -132,6 +136,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
QObject::connect(routerCommandsUI->acceptTransitTunnelsPushButton, SIGNAL(released()), this, SLOT(enableTransit()));
|
||||
QObject::connect(routerCommandsUI->declineTransitTunnelsPushButton, SIGNAL(released()), this, SLOT(disableTransit()));
|
||||
|
||||
QObject::connect(ui->logViewerPushButton, SIGNAL(released()), this, SLOT(showLogViewerPage()));
|
||||
|
||||
QObject::connect(ui->settingsPagePushButton, SIGNAL(released()), this, SLOT(showSettingsPage()));
|
||||
|
||||
QObject::connect(ui->tunnelsPagePushButton, SIGNAL(released()), this, SLOT(showTunnelsPage()));
|
||||
|
@ -299,6 +305,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
trayIcon->show();
|
||||
#endif
|
||||
|
||||
logViewerManagerPtr=new LogViewerManager(logStream_,ui->logViewerTextEdit,this);
|
||||
assert(logViewerManagerPtr!=nullptr);
|
||||
onLoggingOptionsChange();
|
||||
//QMetaObject::connectSlotsByName(this);
|
||||
}
|
||||
|
||||
|
@ -333,10 +342,11 @@ void MainWindow::showStatusPage(StatusPage newStatusPage){
|
|||
}
|
||||
wasSelectingAtStatusMainPage=false;
|
||||
}
|
||||
void MainWindow::showSettingsPage(){ui->stackedWidget->setCurrentIndex(1);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showTunnelsPage(){ui->stackedWidget->setCurrentIndex(2);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showRestartPage(){ui->stackedWidget->setCurrentIndex(3);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showQuitPage(){ui->stackedWidget->setCurrentIndex(4);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showLogViewerPage(){ui->stackedWidget->setCurrentIndex(1);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showSettingsPage(){ui->stackedWidget->setCurrentIndex(2);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showTunnelsPage(){ui->stackedWidget->setCurrentIndex(3);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showRestartPage(){ui->stackedWidget->setCurrentIndex(4);setStatusButtonsVisible(false);}
|
||||
void MainWindow::showQuitPage(){ui->stackedWidget->setCurrentIndex(5);setStatusButtonsVisible(false);}
|
||||
|
||||
void MainWindow::setStatusButtonsVisible(bool visible) {
|
||||
ui->statusButtonsPane->setVisible(visible);
|
||||
|
@ -631,6 +641,8 @@ void MainWindow::loadAllConfigs(){
|
|||
}
|
||||
|
||||
ReadTunnelsConfig();
|
||||
|
||||
onLoggingOptionsChange();
|
||||
}
|
||||
/** returns false iff not valid items present and save was aborted */
|
||||
bool MainWindow::saveAllConfigs(){
|
||||
|
@ -668,6 +680,8 @@ bool MainWindow::saveAllConfigs(){
|
|||
|
||||
SaveTunnelsConfig();
|
||||
|
||||
onLoggingOptionsChange();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue