source: src-qt4/pc-updatecenter/syscontroller.h @ c21cafa

releng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since c21cafa was c21cafa, checked in by yurkis <yurkis@…>, 9 months ago

Update center - current base system update description showing

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/**************************************************************************
2*   Copyright (C) 2013- 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 SYSCONTROLLER_H
26#define SYSCONTROLLER_H
27
28#include "updatecontroller.h"
29#include "utils.h"
30
31#include <QProcess>
32#include <QString>
33#include <QVector>
34#include <QDate>
35
36class CSysController : public CAbstractUpdateController
37{
38    Q_OBJECT
39
40
41public:
42    CSysController();
43
44    typedef enum{
45        eSYSUPDATE,
46        ePATCH,
47        eFBSDUPDATE
48    }ESysUpdate;
49
50    typedef struct _SSystemUpdate
51    {
52        ESysUpdate mType;
53        QString mName;
54        QString mTag;
55        QString mDetails; // For patch only
56        QString mSize;    // For patch only
57        QString mVersion; // For sysupdates only
58        QDate   mDate;    // For patch only       
59        bool   misStandalone;
60        bool   misRequiresReboot;
61
62        _SSystemUpdate()
63        {
64            misStandalone= false;
65            misRequiresReboot= false;
66        }
67    }SSystemUpdate;
68
69    typedef struct _SFbsdUpdatesDescription
70    {
71        QString mRelease;
72        int     mUpdateNo;
73        QString mDescription;
74
75        _SFbsdUpdatesDescription():mUpdateNo(-1){;}
76
77    }SFbsdUpdatesDescription;
78   
79    QVector<SSystemUpdate> updates() {return mvUpdates;}
80    QStringList filesToUpdate()      {return mFilesToUpdate;}
81    QStringList filesToDelete()      {return mFilesToRemove;}
82    QStringList fileslocalyModifyed(){return mFilesLocallyModifyed;}
83    bool        rebootRequired();
84    QVector<SFbsdUpdatesDescription> updateDescriptions(QString RelName = QString(), bool isForse = false);
85
86    void updateSelected(QVector<SSystemUpdate> selectedUpdates);
87
88protected:
89    virtual void onCheckUpdates();
90    virtual void onUpdateAll();
91    virtual void checkShellCommand(QString& cmd, QStringList& args);
92    virtual void updateShellCommand(QString& cmd, QStringList& args);
93
94    void onReadCheckLine(QString line);
95    void onReadUpdateLine(QString line);
96    virtual void onReadProcessChar(char character);
97
98    virtual void onCheckProcessfinished(int exitCode);
99    virtual void onUpdateProcessfinished(int exitCode);
100    virtual void onCancel();
101
102private:
103    bool misFREEBSDCheck;
104    QVector<SSystemUpdate> mvUpdates;
105    QStringList mFilesLocallyModifyed;
106    QStringList mFilesToRemove;
107    QStringList mFilesToUpdate;
108    bool        misFBSDRebootRequired;
109    bool        misRebootRequired;
110
111    QVector<SSystemUpdate> mvUpdatesToApply;
112    int                    mCurrentUpdate;
113
114    QVector<SFbsdUpdatesDescription> mvFbsdUpdateDescriptions;
115    QString mCurrentFbsdDescription;
116
117    void parseCheckPCBSDLine(QString line);
118    void parseCheckFREEBSDLine(QString line);
119
120    void parsePatchUpdateLine(QString line);
121    void parseUpgradeLine(QString line);
122    void parseFreeBSDUpdateLine(QString line);
123
124    QString fbsdUpdateDescription(QString line);
125
126
127};
128
129#endif // SYSCONTROLLER_H
Note: See TracBrowser for help on using the repository browser.