trikRuntime
wiFiModeWidget.h
Go to the documentation of this file.
1 /* Copyright 2014 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/qglobal.h>
18 
19 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
20  #include <QtGui/QWidget>
21  #include <QtGui/QLabel>
22  #include <QtGui/QVBoxLayout>
23  #include <QtGui/QListWidget>
24 #else
25  #include <QtWidgets/QWidget>
26  #include <QtWidgets/QLabel>
27  #include <QtWidgets/QVBoxLayout>
28  #include <QtWidgets/QListWidget>
29 #endif
30 
31 #include <QtCore/QString>
32 
33 #include <trikKernel/rcReader.h>
34 #include <trikWiFi/trikWiFi.h>
35 #include "trikGuiDialog.h"
36 
37 namespace trikGui {
38 
41 {
42  Q_OBJECT
43 
44 public:
45  enum class Mode {
47  , client
48  , unknown
49  };
50 
53  explicit WiFiModeWidget(trikWiFi::TrikWiFi &wiFi, QWidget *parent = 0);
54 
56  static QString menuEntry();
57 
58  void renewFocus() override;
59 
60 protected:
61  void keyPressEvent(QKeyEvent *event) override;
62 
63 private:
64  void setMode(Mode mode);
65 
66  trikWiFi::TrikWiFi &mWiFi;
67  trikKernel::RcReader mRcReader;
68  QVBoxLayout mLayout;
69  QLabel mTitle;
70  QListWidget mModes;
71 };
72 
73 }
void keyPressEvent(QKeyEvent *event) override
Definition: wiFiModeWidget.cpp:57
Base class for all trikGui dialog widgets.
Definition: trikGuiDialog.h:24
static QString menuEntry()
Returns menu entry for this widget.
Definition: wiFiModeWidget.cpp:47
Widget which allows to set wi-fi mode (client or access point) and then opens corresponding configura...
Definition: wiFiModeWidget.h:40
Class for WiFi management.
Definition: trikWiFi.h:31
Mode
Definition: wiFiModeWidget.h:45
Definition: abstractIndicator.h:21
void renewFocus() override
Set focus properly on this widget or one of its children.
Definition: wiFiModeWidget.cpp:52
WiFiModeWidget(trikWiFi::TrikWiFi &wiFi, QWidget *parent=0)
Constructor.
Definition: wiFiModeWidget.cpp:28
Simple trikrc file parser.
Definition: rcReader.h:25