source: src-qt4/pc-mounttray/menuItem.h @ c69425e

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since c69425e was c69425e, checked in by Ken Moore <ken@…>, 14 months ago

Fix a bug with the mount tray where memory disks mounted outside the tray are automatically unmounted by the tray.
TRAC Ticket: https://trac.pcbsd.org/ticket/773

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 Sub-classed widget for a fancy item selector
3*/
4
5#ifndef MENU_ITEM_H
6#define MENU_ITEM_H
7
8#include <QWidgetAction>
9#include <QDir>
10#include <QFile>
11#include <QPushButton>
12#include <QProgressBar>
13#include <QGridLayout>
14#include <QCheckBox>
15#include <QDebug>
16#include <QLabel>
17#include <QTimer>
18
19extern bool DEBUG_MODE;
20extern QString DEVICEDIR;
21extern QString MOUNTDIR;
22
23class MenuItem : public QWidgetAction
24{
25        Q_OBJECT
26
27  public:
28        MenuItem(QWidget* parent = 0, QString newdevice="", QString newlabel="", QString newtype="", QString newfs="");
29        ~MenuItem();
30       
31        QString device;
32        QString devType;
33        QString filesystem;
34        QString mountpoint;
35        QString maxSize;  //number in KB saved as a QString
36        QString currentSize; //number in KB saved as a QString
37        QString AMFILE;
38       
39        //Setters
40        void updateItem();
41        void mountItem(); //be careful calling this on it's own
42 
43        //Getters
44        QString getDeviceName();
45       
46        //Device information
47        bool isConnected();
48        bool isMounted();
49       
50        //Device Cleanup
51        void cleanup();
52       
53  private:
54        QWidget *frame;
55        QLabel* devLabel;
56        QLabel* devIcon;
57        QProgressBar* currentSpace;
58        QPushButton* pushMount;
59        QCheckBox* checkAutomount;
60
61        //void mountItem();
62        void unmountItem(bool force = false);
63        void updateSizes();
64        QString getSizeDisplay(int);
65        bool checkSavedAutoMount();
66        QStringList systemCMD(QString);
67       
68  private slots:
69        void slotMountClicked();
70        void slotAutoMount();
71        void slotAutoMountToggled(bool);
72       
73  signals:
74        //Emits these signals whenever needed
75        void itemMounted(QString);      //device node (/dev/da*)
76        void itemUnmounted(QString);    //device node
77        void itemRemoved(QString);      //device node
78        void newMessage(QString, QString);      //message to be displayed
79
80};
81#endif
Note: See TracBrowser for help on using the repository browser.