mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-31 04:44:13 +00:00
commit
66661417d7
@ -2,6 +2,7 @@
|
||||
|
||||
#include "QMessageBox"
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
TunnelPane::TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunnelConfig_, QWidget* wrongInputPane_, QLabel* wrongInputLabel_, MainWindow* mainWindow_):
|
||||
QObject(),
|
||||
@ -184,6 +185,7 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters,
|
||||
|
||||
void TunnelPane::updated() {
|
||||
std::string oldName=tunnelConfig->getName();
|
||||
//validate and show red if invalid
|
||||
if(!applyDataFromUIToTunnelConfig())return;
|
||||
tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
|
||||
}
|
||||
@ -231,6 +233,9 @@ void TunnelPane::deleteTunnelForm() {
|
||||
void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) {
|
||||
wrongInputPane->setVisible(true);
|
||||
wrongInputLabel->setText(warningText);
|
||||
if(controlWithWrongInput)controlWithWrongInput->setFocus();
|
||||
if(controlWithWrongInput){
|
||||
mainWindow->ui->tunnelsScrollArea->ensureWidgetVisible(controlWithWrongInput);
|
||||
controlWithWrongInput->setFocus();
|
||||
}
|
||||
mainWindow->showTunnelsPage();
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
|
||||
tunnelPanes.push_back(tunnelPane);
|
||||
if(name==tunnelNameToFocus){
|
||||
tunnelPane->getNameLineEdit()->setFocus();
|
||||
//todo ui->settingsScrollArea->###scroll
|
||||
ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -719,7 +719,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
|
||||
tunnelPanes.push_back(tunnelPane);
|
||||
if(name==tunnelNameToFocus){
|
||||
tunnelPane->getNameLineEdit()->setFocus();
|
||||
//todo ui->settingsScrollArea->###scroll
|
||||
ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -765,15 +765,6 @@ void MainWindow::reloadTunnelsConfigAndUI(std::string tunnelNameToFocus) {
|
||||
void MainWindow::SaveTunnelsConfig() {
|
||||
std::stringstream out;
|
||||
|
||||
//validate and show red if wrong
|
||||
for (std::list<TunnelPane*>::iterator it=tunnelPanes.begin(); it!=tunnelPanes.end(); ++it) {
|
||||
TunnelPane* tunpane = *it;
|
||||
if(!tunpane->applyDataFromUIToTunnelConfig()) {
|
||||
//!valid
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (std::map<std::string,TunnelConfig*>::iterator it=tunnelConfigs.begin(); it!=tunnelConfigs.end(); ++it) {
|
||||
const std::string& name = it->first;
|
||||
TunnelConfig* tunconf = it->second;
|
||||
@ -863,6 +854,6 @@ void MainWindow::backClickedFromChild() {
|
||||
void MainWindow::highlightWrongInput(QString warningText, QWidget* widgetToFocus) {
|
||||
ui->wrongInputLabel->setVisible(true);
|
||||
ui->wrongInputLabel->setText(warningText);
|
||||
if(widgetToFocus)widgetToFocus->setFocus();
|
||||
if(widgetToFocus){ui->settingsScrollArea->ensureWidgetVisible(widgetToFocus);widgetToFocus->setFocus();}
|
||||
showSettingsPage();
|
||||
}
|
||||
|
@ -441,11 +441,12 @@ private:
|
||||
QMenu *trayIconMenu;
|
||||
#endif
|
||||
|
||||
public:
|
||||
Ui::MainWindow* ui;
|
||||
Ui::StatusButtonsForm* statusButtonsUI;
|
||||
Ui::routerCommandsWidget* routerCommandsUI;
|
||||
Ui::GeneralSettingsContentsForm* uiSettings;
|
||||
|
||||
private:
|
||||
TextBrowserTweaked1 * textBrowser;
|
||||
QWidget * routerCommandsParent;
|
||||
PageWithBackButton * pageWithBackButton;
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>908</width>
|
||||
<height>550</height>
|
||||
<height>554</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
@ -50,7 +50,7 @@
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>888</width>
|
||||
<height>555</height>
|
||||
<height>531</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
@ -624,7 +624,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="statusPage">
|
||||
<property name="sizePolicy">
|
||||
|
Loading…
x
Reference in New Issue
Block a user