create and handle info pane just like the other dock widget content widgets

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1134148
This commit is contained in:
Volker Lanz 2010-06-03 14:27:11 +00:00
parent 0a77bb6d8a
commit 6508ad1d71
4 changed files with 15 additions and 11 deletions

View File

@ -48,7 +48,7 @@ InfoPane::InfoPane(QWidget* parent) :
/** Clears the InfoPane, leaving it empty */
void InfoPane::clear()
{
parentWidget()->setWindowTitle(i18nc("@title:window", "Information"));
parentWidget()->parentWidget()->setWindowTitle(i18nc("@title:window", "Information"));
qDeleteAll(findChildren<QLabel*>());
qDeleteAll(findChildren<QFrame*>());
}
@ -108,7 +108,7 @@ void InfoPane::createLabels(const QString& title, const QString& value, const in
void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
{
clear();
parentWidget()->setWindowTitle(i18nc("@title:window", "Partition Information"));
parentWidget()->parentWidget()->setWindowTitle(i18nc("@title:window", "Partition Information"));
int x = 0;
int y = createHeader(p.deviceNode(), cols(area));
@ -128,7 +128,7 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
void InfoPane::showDevice(Qt::DockWidgetArea area, const Device& d)
{
clear();
parentWidget()->setWindowTitle(i18nc("@title:window", "Device Information"));
parentWidget()->parentWidget()->setWindowTitle(i18nc("@title:window", "Device Information"));
int x = 0;
int y = createHeader(d.name(), cols(area));

View File

@ -91,8 +91,7 @@ MainWindow::MainWindow(QWidget* parent) :
m_DeviceScanner(new DeviceScanner(this, operationStack())),
m_ApplyProgressDialog(new ApplyProgressDialog(this, operationRunner())),
m_ScanProgressDialog(new ScanProgressDialog(this)),
m_StatusText(new QLabel(this)),
m_InfoPane(new InfoPane(this))
m_StatusText(new QLabel(this))
{
setupObjectNames();
setupUi(this);
@ -126,10 +125,6 @@ void MainWindow::init()
loadConfig();
dockInformation().setWidget(&infoPane());
infoPane().clear();
scanDevices();
}

View File

@ -171,7 +171,6 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
ApplyProgressDialog* m_ApplyProgressDialog;
ScanProgressDialog* m_ScanProgressDialog;
QLabel* m_StatusText;
InfoPane* m_InfoPane;
QString m_SavedSelectedDeviceNode;
};

View File

@ -64,7 +64,11 @@
<number>1</number>
</attribute>
<widget class="QWidget" name="m_DockInformationContents">
<layout class="QGridLayout" name="dockInformationLayout"/>
<layout class="QGridLayout" name="dockInformationLayout">
<item row="0" column="0">
<widget class="InfoPane" name="m_InfoPane" native="true"/>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="m_DockLog">
@ -111,6 +115,12 @@
<header>gui/treelog.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>InfoPane</class>
<extends>QWidget</extends>
<header>gui/infopane.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>