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

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 15 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100644
File size: 1.6 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       
42        //Getters
43        QString getDeviceName();
44       
45        //Device information
46        bool isConnected();
47        bool isMounted();
48       
49        //Device Cleanup
50        void cleanup();
51       
52  private:
53        QWidget *frame;
54        QLabel* devLabel;
55        QLabel* devIcon;
56        QProgressBar* currentSpace;
57        QPushButton* pushMount;
58        QCheckBox* checkAutomount;
59
60        void mountItem();
61        void unmountItem();
62        void updateSizes();
63        QString getSizeDisplay(int);
64        bool checkSavedAutoMount();
65        QStringList systemCMD(QString);
66       
67  private slots:
68        void slotMountClicked();
69        void slotAutoMountToggled(bool);
70       
71  signals:
72        //Emits these signals whenever needed
73        void itemMounted(QString);      //device node (/dev/da*)
74        void itemUnmounted(QString);    //device node
75        void itemRemoved(QString);      //device node
76        void newMessage(QString, QString);      //message to be displayed
77
78};
79#endif
Note: See TracBrowser for help on using the repository browser.