CuteLogger
Fast and simple logging solution for Qt based applications
newprojectfolder.h
1 /*
2  * Copyright (c) 2018-2024 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef NEWPROJECTFOLDER_H
19 #define NEWPROJECTFOLDER_H
20 
21 #include <QWidget>
22 #include <QModelIndex>
23 #include <QStandardItemModel>
24 #include <QMenu>
25 #include <QString>
26 
27 namespace Ui {
28 class NewProjectFolder;
29 }
30 
31 class QAction;
32 class QActionGroup;
33 
34 class NewProjectFolder : public QWidget
35 {
36  Q_OBJECT
37 
38 public:
39  explicit NewProjectFolder(QWidget *parent = 0);
40  ~NewProjectFolder();
41 
42 protected:
43  void showEvent(QShowEvent *);
44  void hideEvent(QHideEvent *);
45  bool event(QEvent *event);
46 
47 public slots:
48  void updateRecentProjects();
49 
50 signals:
51  void deletedProject(const QString &);
52 
53 private slots:
54  void on_projectsFolderButton_clicked();
55 
56  void on_videoModeButton_clicked();
57 
58  void onProfileTriggered(QAction *action);
59 
60  void on_actionAddCustomProfile_triggered();
61 
62  void on_actionProfileRemove_triggered();
63 
64  void on_startButton_clicked();
65 
66  void on_projectNameLineEdit_textChanged(const QString &arg1);
67 
68  void on_recentListView_clicked(const QModelIndex &index);
69 
70  void on_recentListView_doubleClicked(const QModelIndex &index);
71 
72  void on_recentListView_customContextMenuRequested(const QPoint &pos);
73 
74  void on_actionRecentRemove_triggered();
75 
76 private:
77  void setColors();
78  void setProjectFolderButtonText(const QString &text);
79 
80  Ui::NewProjectFolder *ui;
81  QActionGroup *m_profileGroup;
82  QMenu m_videoModeMenu;
83  QMenu *m_customProfileMenu;
84  QString m_profile;
85  QStandardItemModel m_model;
86  QString m_projectName;
87  bool m_isOpening;
88 };
89 
90 #endif // NEWPROJECTFOLDER_H