trikRuntime
startWidget.h
Go to the documentation of this file.
1 /* Copyright 2013 Roman Kurbatov
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  * This file was modified by Yurii Litvinov to make it comply with the requirements of trikRuntime
16  * project. See git revision history for detailed changes. */
17 
18 #pragma once
19 
20 #include <QtCore/qglobal.h>
21 
22 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
23  #include <QtGui/QWidget>
24  #include <QtGui/QVBoxLayout>
25  #include <QtGui/QLabel>
26  #include <QtGui/QListView>
27 #else
28  #include <QtWidgets/QWidget>
29  #include <QtWidgets/QVBoxLayout>
30  #include <QtWidgets/QLabel>
31  #include <QtWidgets/QListView>
32 #endif
33 
34 #include <QtGui/QStandardItem>
35 #include <QtGui/QStandardItemModel>
36 #include <QtCore/QList>
37 #include <QtCore/QString>
38 #include <QtCore/QMap>
39 
40 #include "wiFiModeWidget.h"
41 #include "mainWidget.h"
42 #include "controller.h"
43 #include "networkWidget.h"
44 
45 
46 namespace trikGui {
47 
49 class StartWidget : public MainWidget
50 {
51  Q_OBJECT
52 
53 public:
58  explicit StartWidget(Controller &controller, QWidget *parent = 0);
59 
60  ~StartWidget() override;
61 
62  void renewFocus() override;
63 
64 private slots:
66  void changeFileManagerRoot(MainWidget::FileManagerRootType const& path);
67 
68 private:
69  void keyPressEvent(QKeyEvent *event) override;
70 
71  void launch();
72 
73  void setRootIndex(const QModelIndex &index);
74 
75  void goHome();
76 
77  QVBoxLayout mLayout;
78  QLabel mTitleLabel;
79  NetworkWidget mNetworkWidget;
80  QListView mMenuView;
81  QStandardItemModel mMenuModel;
82  Controller &mController;
83  MainWidget::FileManagerRootType mFileManagerRoot; // current FilesManegerRoot
84 
86  QMap<QPersistentModelIndex, QPersistentModelIndex> mSelections;
87 };
88 
89 }
Main widget for trikGui application, displays menu which allows to open other widgets.
Definition: startWidget.h:49
Provides backend features like Qt Script runner for frontend.
Definition: controller.h:35
Abstract class for widgets which will be used for conversation with user.
Definition: mainWidget.h:28
~StartWidget() override
Definition: startWidget.cpp:101
Definition: abstractIndicator.h:21
Widget, that shows current state of the network – hostname and IP-address.
Definition: networkWidget.h:24
StartWidget(Controller &controller, QWidget *parent=0)
Constructor.
Definition: startWidget.cpp:46
void renewFocus() override
Set focus properly on this widget or one of its children.
Definition: startWidget.cpp:105
FileManagerRootType
Definition: mainWidget.h:33