edit mobilewidget.ui, main and wifi tab now only will be update if they

are active
This commit is contained in:
arcan1s 2015-08-19 00:42:29 +03:00
parent e67493f5c0
commit 5efb25dca3
5 changed files with 20 additions and 13 deletions

View File

@ -94,8 +94,10 @@ void MainWidget::update()
{ {
if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG;
if (mainWindow->currentTab() == 0) {
updateMainTab(); updateMainTab();
updateMenuMain(); updateMenuMain();
}
if (timer.interval() != 0) return timer.start(); if (timer.interval() != 0) return timer.start();
} }

View File

@ -111,6 +111,14 @@ MainWindow::~MainWindow()
} }
int MainWindow::currentTab()
{
if (debug) qDebug() << PDEBUG;
return ui->stackedWidget->currentIndex();
}
Qt::ToolBarArea MainWindow::getToolBarArea() Qt::ToolBarArea MainWindow::getToolBarArea()
{ {
if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG;

View File

@ -42,11 +42,12 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
explicit MainWindow(QWidget *parent = 0, explicit MainWindow(QWidget *parent = nullptr,
const QVariantMap args = QVariantMap(), const QVariantMap args = QVariantMap(),
QTranslator *qtAppTranslator = 0, QTranslator *qtAppTranslator = nullptr,
QTranslator *appTranslator = 0); QTranslator *appTranslator = nullptr);
~MainWindow(); ~MainWindow();
int currentTab();
Qt::ToolBarArea getToolBarArea(); Qt::ToolBarArea getToolBarArea();
void emitNeedToBeConfigured(); void emitNeedToBeConfigured();
QStringList printSettings(); QStringList printSettings();

View File

@ -89,9 +89,6 @@
<property name="toolTip"> <property name="toolTip">
<string>The username and password to connect with</string> <string>The username and password to connect with</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -125,9 +122,6 @@
<property name="toolTip"> <property name="toolTip">
<string>The access point (apn) to connect on</string> <string>The access point (apn) to connect on</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -75,8 +75,10 @@ void WiFiMenuWidget::update()
{ {
if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG;
if (mainWindow->currentTab() == 2) {
updateWifiTab(); updateWifiTab();
updateMenuWifi(); updateMenuWifi();
}
if (timer.interval() != 0) return timer.start(); if (timer.interval() != 0) return timer.start();
} }