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

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

Fix the mount tray message clicked functionality, it should now either mount the device and/or open up where the device is mounted in the file manager.

  • 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();
63        void updateSizes();
64        QString getSizeDisplay(int);
65        bool checkSavedAutoMount();
66        QStringList systemCMD(QString);
67       
68  private slots:
69        void slotMountClicked();
70        void slotAutoMountToggled(bool);
71       
72  signals:
73        //Emits these signals whenever needed
74        void itemMounted(QString);      //device node (/dev/da*)
75        void itemUnmounted(QString);    //device node
76        void itemRemoved(QString);      //device node
77        void newMessage(QString, QString);      //message to be displayed
78
79};
80#endif
Note: See TracBrowser for help on using the repository browser.