source: lumina/lumina-fm/MainUI.h @ 4333764

releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since 4333764 was 4333764, checked in by Ken Moore <ken@…>, 9 months ago

Update Lumina-fm.

*Clean up the new widget usage/visiblity while loading
*Enable the multimedia player functionality (still in testing with various file formats)

NOTE: This now uses the phonon framework for Qt. Make sure you catch the change in dependencies!

  • Property mode set to 100644
File size: 5.0 KB
Line 
1//===========================================
2//  Lumina-DE source code
3//  Copyright (c) 2014, Ken Moore
4//  Available under the 3-clause BSD license
5//  See the LICENSE file for full details
6//===========================================
7//  This is the main interface for the Lumina File Manager (Insight)
8//===========================================
9#ifndef _LUMINA_FILE_MANAGER_UI_H
10#define _LUMINA_FILE_MANAGER_UI_H
11// Qt includes
12#include <QMainWindow>
13#include <QTabBar>
14#include <QLineEdit>
15#include <QFileSystemModel>
16#include <QStringList>
17#include <QDebug>
18#include <QAction>
19#include <QProcess>
20#include <QSettings>
21#include <QInputDialog>
22#include <QMessageBox>
23#include <QDir>
24#include <QTimer>
25#include <QDateTime>
26#include <QShortcut>
27#include <QCompleter>
28#include <QClipboard>
29#include <QMimeData>
30#include <QTreeWidgetItem>
31#include <QListWidgetItem>
32#include <QRadioButton>
33#include <QWidgetAction>
34#include <QFileSystemWatcher>
35#include <QImageReader>
36
37//Phonon widgets
38#include <Phonon/MediaObject>
39#include <Phonon/VideoWidget>
40#include <Phonon/AudioOutput>
41#include <Phonon/SeekSlider>
42#include <Phonon/MediaSource>
43
44// libLumina includes
45#include <LuminaXDG.h>
46#include <LuminaOS.h>
47
48// Local includes
49#include "FODialog.h" //file operation dialog
50#include "BMMDialog.h" //bookmark manager dialog
51
52namespace Ui{
53        class MainUI;
54};
55
56class MainUI : public QMainWindow{
57        Q_OBJECT
58public:
59        MainUI();
60        ~MainUI();
61
62        void OpenDirs(QStringList); //called from the main.cpp after initialization
63
64private:
65        Ui::MainUI *ui;
66        //Internal non-ui widgets
67        QTabBar *tabBar;
68        QLineEdit *currentDir;
69        QFileSystemModel *fsmod, *snapmod;
70        QMenu *contextMenu;
71        QRadioButton *radio_view_details, *radio_view_list, *radio_view_icons;
72        QWidgetAction *detWA, *listWA, *icoWA;
73
74        //Phonon Widgets for the multimedia player
75        Phonon::MediaObject *mediaObj;
76        Phonon::VideoWidget *videoDisplay;
77        Phonon::AudioOutput *audioOut;
78        Phonon::SeekSlider *playerSlider;
79        QFile *playerFile;
80
81        //Internal variables
82        QStringList snapDirs; //internal saved variable for the discovered zfs snapshot dirs
83        QString CItem; //the item that was right-clicked (for the context menu)
84        QStringList imgFilter, multiFilter; //image/multimedia filters
85        QSettings *settings;
86        QShortcut *nextTabLShort, *nextTabRShort, *closeTabShort, *copyFilesShort, *pasteFilesShort, *deleteFilesShort;
87        QCompleter *dirCompleter;
88        QFileSystemWatcher *dirWatcher;
89        bool isUserWritable, keepFocus;
90
91        //Simplification Functions
92        void setupIcons();                      //used during initialization
93        void setupConnections();        //used during initialization
94        void loadSettings();            //used during initialization
95       
96        void RebuildBookmarksMenu();
97        void RebuildDeviceMenu();
98       
99        bool checkUserPerms();
100        QString bytesToText(qint64 bytes);
101        QString msToText(qint64 ms);
102       
103        //Common functions for browser info/usage
104        QString getCurrentDir();
105        void setCurrentDir(QString);
106        QStringList getSelectedItems();
107
108private slots:
109        void slotSingleInstance(const QString &in){
110          this->show();
111          this->raise();
112          this->OpenDirs(in.split("\n"));
113        }
114       
115        //General button check functions (start in a new thread!)
116        void checkForMultimediaFiles();
117        void checkForBackups();
118        void checkForPictures();
119       
120        //General page switching
121        void goToMultimediaPage();
122        void goToRestorePage();
123        void goToSlideshowPage();
124        void goToBrowserPage();
125       
126        //Menu Actions
127        void on_actionNew_Tab_triggered();
128        void on_actionClose_triggered();
129        void on_actionView_Hidden_Files_triggered();
130        void goToBookmark(QAction*);
131        void goToDevice(QAction*);
132        void viewModeChanged(bool);
133       
134        //Toolbar Actions
135        void on_actionBack_triggered();
136        void on_actionUpDir_triggered();
137        void on_actionHome_triggered();
138        void on_actionBookMark_triggered();
139
140        //Browser Functions
141        void startEditDir(QWidget *old, QWidget *now);
142        void goToDirectory(); //go to a manually typed in directory
143        void loadDirectory(); //Update the widget with the dir contents
144        void on_tool_addToDir_clicked();
145        void tabChanged(int tab);
146        void tabClosed(int tab = -1);
147        void prevTab();
148        void nextTab();
149        void ItemRun( const QModelIndex&);
150        void ItemRun(QTreeWidgetItem *item);
151        void ItemRun(QListWidgetItem *item);
152        void OpenContextMenu(const QPoint&);
153
154        //Slideshow Functions
155        void showNewPicture();
156        void firstPicture();
157        void prevPicture();
158        void nextPicture();
159        void lastPicture();
160       
161        //ZFS Restore Functions
162        void snapshotLoaded();
163        void showSnapshot();
164        void nextSnapshot();
165        void prevSnapshot();
166        void restoreItems();
167       
168        //Multimedia Player Functions
169        void playerStart();
170        void playerStop();
171        void playerPause();
172        void playerNext();
173        void playerPrevious();
174        void playerFinished();
175        void playerStateChanged(Phonon::State newstate, Phonon::State oldstate);
176        void playerTimeChanged(qint64 ctime);
177        void playerFileChanged();
178       
179        //Context Menu Actions
180         // - single item actions
181        void OpenItem(); //run "lumina-open" on it
182        void OpenItemWith(); //run "lumina-open -select" on it
183        void OpenDir(); //open the dir in a new tab
184        void RemoveItem(); //Remove the item permanently
185        void RenameItem();
186         // - full selection actions
187        void CutItems();
188        void CopyItems();
189        void PasteItems();
190
191};
192
193#endif
Note: See TracBrowser for help on using the repository browser.