~ubuntu-branches/ubuntu/oneiric/partitionmanager/oneiric

« back to all changes in this revision

Viewing changes to src/gui/partpropsdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2009-01-23 17:57:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090123175736-2ltrhgg3m55dokbm
Tags: upstream-1.0.0~beta1a
ImportĀ upstreamĀ versionĀ 1.0.0~beta1a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2008 by Volker Lanz <vl@fidra.de>                       *
 
3
 *                                                                         *
 
4
 *   This program is free software; you can redistribute it and/or modify  *
 
5
 *   it under the terms of the GNU General Public License as published by  *
 
6
 *   the Free Software Foundation; either version 2 of the License, or     *
 
7
 *   (at your option) any later version.                                   *
 
8
 *                                                                         *
 
9
 *   This program is distributed in the hope that it will be useful,       *
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
12
 *   GNU General Public License for more details.                          *
 
13
 *                                                                         *
 
14
 *   You should have received a copy of the GNU General Public License     *
 
15
 *   along with this program; if not, write to the                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
 
18
 ***************************************************************************/
 
19
 
 
20
#if !defined(PARTPROPSDIALOG__H)
 
21
 
 
22
#define PARTPROPSDIALOG__H
 
23
 
 
24
#include "fs/filesystem.h"
 
25
 
 
26
#include "core/partitiontable.h"
 
27
 
 
28
#include <kdialog.h>
 
29
 
 
30
class Device;
 
31
class Partition;
 
32
class PartPropsWidget;
 
33
 
 
34
class QWidget;
 
35
class QString;
 
36
 
 
37
 
 
38
/** @brief Show Partition properties.
 
39
 
 
40
        Dialog that shows a Partition's properties and allows the user to change (or recreate)
 
41
        the Partition's FileSystem, its label and its flags.
 
42
 
 
43
        @author vl@fidra.de
 
44
*/
 
45
class PartPropsDialog : public KDialog
 
46
{
 
47
        Q_OBJECT
 
48
 
 
49
        public:
 
50
                PartPropsDialog(QWidget* parent, Device& d, Partition& p);
 
51
                ~PartPropsDialog();
 
52
 
 
53
        public:
 
54
                QString newLabel() const;
 
55
                PartitionTable::Flags newFlags() const;
 
56
                FileSystem::Type newFileSystemType() const;
 
57
                bool forceRecreate() const { return m_ForceRecreate; } /**< @return true if user wants to recreate the FileSystem on the Partition */
 
58
 
 
59
        protected:
 
60
                void setupDialog();
 
61
                void setupConnections();
 
62
                void setupFileSystemComboBox();
 
63
                void setupFlagsList();
 
64
                void updateHideAndShow();
 
65
 
 
66
                bool warnFileSystemChange() const { return m_WarnFileSystemChange; }
 
67
                void setWarnFileSystemChange() { m_WarnFileSystemChange = true; }
 
68
 
 
69
                Device& device() { return m_Device; }
 
70
                const Device& device() const { return m_Device; }
 
71
                
 
72
                Partition& partition() { return m_Partition; }
 
73
                const Partition& partition() const { return m_Partition; }
 
74
 
 
75
                PartPropsWidget& dialogWidget() { Q_ASSERT(m_DialogWidget); return *m_DialogWidget; }
 
76
                const PartPropsWidget& dialogWidget() const { Q_ASSERT(m_DialogWidget); return *m_DialogWidget; }
 
77
 
 
78
                bool isReadOnly() const { return m_ReadOnly; }
 
79
                void setForceRecreate(bool b) { m_ForceRecreate = b; }
 
80
 
 
81
        protected slots:
 
82
                void setDirty();
 
83
                void onFilesystemChanged(int idx);
 
84
                void onRecreate(int);
 
85
 
 
86
        private:
 
87
                Device& m_Device;
 
88
                Partition& m_Partition;
 
89
                bool m_WarnFileSystemChange;
 
90
                PartPropsWidget* m_DialogWidget;
 
91
                bool m_ReadOnly;
 
92
                bool m_ForceRecreate;
 
93
};
 
94
 
 
95
#endif