source: src-qt4/pc-controlpanel/item.h @ 18c4ab8

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

Fix compilation warnings for pc-controlpanel on 10.x

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**************************************************************************
2*   Copyright (C) 2011 by Yuri Momotyuk                                   *
3*   yurkis@gmail.com                                                      *
4*                                                                         *
5*   Permission is hereby granted, free of charge, to any person obtaining *
6*   a copy of this software and associated documentation files (the       *
7*   "Software"), to deal in the Software without restriction, including   *
8*   without limitation the rights to use, copy, modify, merge, publish,   *
9*   distribute, sublicense, and/or sell copies of the Software, and to    *
10*   permit persons to whom the Software is furnished to do so, subject to *
11*   the following conditions:                                             *
12*                                                                         *
13*   The above copyright notice and this permission notice shall be        *
14*   included in all copies or substantial portions of the Software.       *
15*                                                                         *
16*   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
17*   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
18*   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
19*   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
20*   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
21*   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
22*   OTHER DEALINGS IN THE SOFTWARE.                                       *
23***************************************************************************/
24
25#ifndef ITEM_H
26#define ITEM_H
27
28#include <QListWidget>
29#include <QSettings>
30#include <QStringList>
31#include "pbiinfo.h"
32#include "deinfo.h"
33class QCPItem : public QListWidgetItem
34{
35public:
36        QCPItem();
37
38        /**
39          * Read .desktop file.
40          *
41          * Set item text, icon from file, check item visibility, and store
42          * execute command and executable path
43          *
44          * @param FileName - name of .desktop file to read
45          *
46          * @return TRUE if success and item is visible
47          */
48        bool readDE(QString FileName, const QVector<QString>& vEnabledDE);
49
50        /**
51          * Check for valid data
52          *
53          * @return TRUE if we got right data from file and item must be visible
54          */
55        bool isValid();
56
57        /**
58          * Launch control panel item executable
59          *
60          * @return TRUE if success
61          */
62        bool launch();
63
64        /**
65          Set displaying DE name in item text
66
67          @param isDisplay - True if DE name is displayed
68        */
69        void setDisplayDEName(bool isDisplay);
70
71        /**
72          Returnes item name that was readed from .desktop file
73         */
74        QString itemName() {return mName; }
75
76        /**
77          Returnes original (untranslated) item name
78          */
79        QString itemOriginalName() {return mOriginalName;};
80
81        QStringList tags() {return mTags;}
82
83        bool isSudoRequired() {return isSudo;}
84
85        bool isRootRequired() {return isRequireRoot;}
86
87protected:
88        QString mName;
89        QString mOriginalName;
90        QString mFileName;
91        QString mExecCommand;
92        QString mPath;
93        QString mPBIPath;
94        bool    misValid;
95        QString mIconFile;
96        bool    misMsgBox;
97        QString mMsgBoxText;
98        bool    misUseXDG;
99        bool    misXDGLaunch;
100        QString mRequiredDE;
101        bool    misSubstFound;
102        QVector<QString> mvEnabledDE;
103        bool isRequireRoot;
104        bool isSudo;
105        QStringList mTags;
106
107        bool getLocalizedField(const QSettings& Reader,
108                               const QString& FieldName,
109                               QString& RetVal);
110        bool launchOwn();
111        bool launchXDG();
112};
113
114#endif // ITEM_H
Note: See TracBrowser for help on using the repository browser.