remove KPart remains
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1134137
This commit is contained in:
parent
c37e28d3b8
commit
0a77bb6d8a
|
@ -82,12 +82,10 @@
|
|||
|
||||
/** Creates a new MainWindow instance.
|
||||
@param parent the parent widget
|
||||
@param coll an action collection if used as a KPart
|
||||
*/
|
||||
MainWindow::MainWindow(QWidget* parent, KActionCollection* coll) :
|
||||
MainWindow::MainWindow(QWidget* parent) :
|
||||
KXmlGuiWindow(parent),
|
||||
Ui::MainWindowBase(),
|
||||
m_ActionCollection(coll),
|
||||
m_OperationStack(new OperationStack(this)),
|
||||
m_OperationRunner(new OperationRunner(this, operationStack())),
|
||||
m_DeviceScanner(new DeviceScanner(this, operationStack())),
|
||||
|
@ -124,13 +122,7 @@ void MainWindow::init()
|
|||
listOperations().setActionCollection(actionCollection());
|
||||
pmWidget().init(&operationStack());
|
||||
|
||||
if (isKPart())
|
||||
{
|
||||
setupGUI(ToolBar | Keys | Save);
|
||||
statusBar()->hide();
|
||||
}
|
||||
else
|
||||
setupGUI(ToolBar | Keys | StatusBar | Save | Create);
|
||||
setupGUI();
|
||||
|
||||
loadConfig();
|
||||
|
||||
|
@ -387,8 +379,7 @@ void MainWindow::setupConnections()
|
|||
|
||||
void MainWindow::setupStatusBar()
|
||||
{
|
||||
if (!isKPart())
|
||||
statusBar()->addWidget(&statusText());
|
||||
statusBar()->addWidget(&statusText());
|
||||
}
|
||||
|
||||
void MainWindow::loadConfig()
|
||||
|
@ -460,8 +451,7 @@ void MainWindow::on_m_OperationStack_operationsChanged()
|
|||
// this will make sure that the info pane gets updated
|
||||
on_m_PartitionManagerWidget_selectedPartitionChanged(pmWidget().selectedPartition());
|
||||
|
||||
if (!isKPart())
|
||||
statusText().setText(i18ncp("@info:status", "One pending operation", "%1 pending operations", operationStack().size()));
|
||||
statusText().setText(i18ncp("@info:status", "One pending operation", "%1 pending operations", operationStack().size()));
|
||||
}
|
||||
|
||||
void MainWindow::on_m_OperationStack_devicesChanged()
|
||||
|
@ -558,12 +548,6 @@ void MainWindow::on_m_PartitionManagerWidget_selectedPartitionChanged(const Part
|
|||
enableActions();
|
||||
}
|
||||
|
||||
bool MainWindow::isKPart() const
|
||||
{
|
||||
// If we were instantiated with an action collection we're supposed to be a KPart
|
||||
return m_ActionCollection != NULL;
|
||||
}
|
||||
|
||||
void MainWindow::onShowMenuBar()
|
||||
{
|
||||
QAction* menuBarAction = actionCollection()->action(KStandardAction::name(KStandardAction::ShowMenubar));
|
||||
|
|
|
@ -54,7 +54,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
|||
Q_DISABLE_COPY(MainWindow)
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = NULL, KActionCollection* coll = NULL);
|
||||
explicit MainWindow(QWidget* parent = NULL);
|
||||
|
||||
protected:
|
||||
void init();
|
||||
|
@ -73,13 +73,9 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
|||
void closeEvent(QCloseEvent*);
|
||||
void changeEvent(QEvent* event);
|
||||
|
||||
bool isKPart() const;
|
||||
|
||||
void setSavedSelectedDeviceNode(const QString& s) { m_SavedSelectedDeviceNode = s; }
|
||||
const QString& savedSelectedDeviceNode() const { return m_SavedSelectedDeviceNode; }
|
||||
|
||||
KActionCollection* actionCollection() const { return m_ActionCollection != NULL ? m_ActionCollection : KXmlGuiWindow::actionCollection(); }
|
||||
|
||||
InfoPane& infoPane() { Q_ASSERT(m_InfoPane); return *m_InfoPane; }
|
||||
|
||||
PartitionManagerWidget& pmWidget() { Q_ASSERT(m_PartitionManagerWidget); return *m_PartitionManagerWidget; }
|
||||
|
@ -169,7 +165,6 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
|||
void onSelectedDeviceMenuTriggered(bool);
|
||||
|
||||
private:
|
||||
KActionCollection* m_ActionCollection;
|
||||
OperationStack* m_OperationStack;
|
||||
OperationRunner* m_OperationRunner;
|
||||
DeviceScanner* m_DeviceScanner;
|
||||
|
|
Loading…
Reference in New Issue