From 90720ad383973d126804470db1b8cc4d30352a6a Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Mon, 18 Jan 2010 13:46:45 +0000 Subject: [PATCH] hard code some size hint into the file system support dialog so it doesn't open way too small on first time. also, add some const accessors to the class while we're at it. svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1076607 --- TODO | 2 -- src/gui/filesystemsupportdialog.cpp | 7 +++++-- src/gui/filesystemsupportdialog.h | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 3dc6d02..d039121 100644 --- a/TODO +++ b/TODO @@ -23,8 +23,6 @@ Random plans and ideas for 1.1 and beyond: hopefully be able to get meaningful progress status reporting while resizing, checking and so on. -* Default size of File System Support dialog window. - * Re-design partition list. Maybe include all disks into the list and drop the devices panel? diff --git a/src/gui/filesystemsupportdialog.cpp b/src/gui/filesystemsupportdialog.cpp index 428fe53..a44d00a 100644 --- a/src/gui/filesystemsupportdialog.cpp +++ b/src/gui/filesystemsupportdialog.cpp @@ -39,8 +39,6 @@ FileSystemSupportDialog::FileSystemSupportDialog(QWidget* parent) : setCaption(i18nc("@title:window", "File System Support")); setButtons(KDialog::Ok); - resize(dialogWidget().width(), dialogWidget().height()); - setupDialog(); setupConnections(); @@ -54,6 +52,11 @@ FileSystemSupportDialog::~FileSystemSupportDialog() saveDialogSize(kcg); } +QSize FileSystemSupportDialog::sizeHint() const +{ + return QSize(690, 490); +} + void FileSystemSupportDialog::setupDialog() { QPixmap yes(BarIcon("dialog-ok")); diff --git a/src/gui/filesystemsupportdialog.h b/src/gui/filesystemsupportdialog.h index 17e3eb7..612bfc2 100644 --- a/src/gui/filesystemsupportdialog.h +++ b/src/gui/filesystemsupportdialog.h @@ -48,18 +48,24 @@ class FileSystemSupportDialog : public KDialog public: QTreeWidget& tree() { Q_ASSERT(m_Tree); return *m_Tree; } + const QTreeWidget& tree() const { Q_ASSERT(m_Tree); return *m_Tree; } KPushButton& buttonRescan() { Q_ASSERT(m_ButtonRescan); return *m_ButtonRescan; } + const KPushButton& buttonRescan() const { Q_ASSERT(m_ButtonRescan); return *m_ButtonRescan; } }; public: FileSystemSupportDialog(QWidget* parent); ~FileSystemSupportDialog(); + public: + QSize sizeHint() const; + protected slots: void onButtonRescanClicked(); protected: FileSystemSupportDialogWidget& dialogWidget() { Q_ASSERT(m_FileSystemSupportDialogWidget); return *m_FileSystemSupportDialogWidget; } + const FileSystemSupportDialogWidget& dialogWidget() const { Q_ASSERT(m_FileSystemSupportDialogWidget); return *m_FileSystemSupportDialogWidget; } void setupDialog(); void setupConnections();