remove KCM: it isn't building, it won't work after the refactoring and it

appears no one really wants it.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095115
This commit is contained in:
Volker Lanz 2010-02-23 17:25:53 +00:00
parent ccdf62fe1e
commit 488178c823
6 changed files with 0 additions and 418 deletions

2
TODO
View File

@ -23,7 +23,5 @@ Random plans and ideas for 1.1 and beyond:
* Check if no of sectors fits in an unsigned 32 bit int for msdos partition tables.
* The KCM neither compiles or works right now.
* The KPart works but had problems: The context menus don't show up, the status
bar is missing, maybe more.

View File

@ -85,23 +85,3 @@ if(PARTMAN_KPART)
endif(PARTMAN_KPART)
############################################
option(PARTMAN_KCM "Build a kcm for KDE Partition Manager" OFF)
if(PARTMAN_KCM)
file(GLOB partitionmanagerkcm_SRCS kcm/partitionmanagerkcm.cpp)
kde4_add_plugin(kcm_partitionmanager ${partitionmanagerkcm_SRCS})
target_link_libraries(kcm_partitionmanager
${KDE4_KUTILS_LIBS}
${KDE4_KDEUI_LIBS}
partitionmanagerprivate
)
install(TARGETS kcm_partitionmanager DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES kcm/kcm_partitionmanager.desktop DESTINATION ${SERVICES_INSTALL_DIR})
endif(PARTMAN_KCM)

View File

@ -1,89 +0,0 @@
[Desktop Entry]
Exec=kcmshell4 kcm_partitionmanager
Icon=partitionmanager
Type=Service
X-KDE-Library=kcm_partitionmanager
X-KDE-RootOnly=true
X-KDE-ServiceTypes=KCModule
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=system
X-KDE-SubstituteUID=true
Name=Partition Manager
Name[bg]=Управление на дялове
Name[ca]=Gertor de particions
Name[ca@valencia]=Gertor de particions
Name[cs]=Správce diskových oddílů
Name[da]=Partitionshåndtering
Name[de]=Partitionsmanager
Name[el]=Διαχειριστής κατατμήσεων
Name[en_GB]=Partition Manager
Name[es]=Gestor de particiones
Name[et]=Partitsioonide haldur
Name[fr]=Gestionnaire de partitions
Name[hr]=Upravitelj particijama
Name[it]=Gestore delle partizioni
Name[km]=កម្មវិធី​គ្រប់គ្រង​ការ​ចែកភាគ​ថាស
Name[lt]=Skaidinių tvarkykė
Name[ms]=Pengurus Partisyen
Name[nb]=Partisjonshåndtering
Name[nds]=Partitschonenpleger
Name[nl]=Partitiebeheer
Name[nn]=Partisjonshandtering
Name[pa]=ਪਾਰਟੀਸ਼ਨ ਮੈਨੇਜਰ
Name[pt]=Gestor de Partições
Name[pt_BR]=Gerenciador de partições
Name[ro]=Gestionar de partiții
Name[ru]=Управление разделами
Name[sk]=Správca partícií
Name[sr]=Менаџер партиција
Name[sr@ijekavian]=Менаџер партиција
Name[sr@ijekavianlatin]=Menadžer particija
Name[sr@latin]=Menadžer particija
Name[sv]=Partitionshanterare
Name[tr]=Partition Manager
Name[uk]=Керування розділами диска
Name[x-test]=xxPartition Managerxx
Name[zh_CN]=分区管理器
Name[zh_TW]=分割區管理員
Comment=Manage disks, partitions and file systems
Comment[bg]=Управлява размерите на дискове, дялове и операционни системи
Comment[ca]=Gestioneu discos, particions i sistemes de fitxers
Comment[ca@valencia]=Gestioneu discos, particions i sistemes de fitxers
Comment[cs]=Spravujte disky, oddíly a souborové systémy
Comment[da]=Håndterer diske, partitioner og filsystemer
Comment[de]=Verwaltung von Festplatten, Partitionen und Dateisystemen
Comment[el]=Διαχείριση δίσκων, κατατμήσεων και συστημάτων αρχείων
Comment[en_GB]=Manage disks, partitions and file systems
Comment[es]=Gestionar discos, particiones y sistemas de archivos
Comment[et]=Ketaste, partitsioonide ja failisüsteemide haldamine
Comment[fr]=Gérez vos disques, partitions et systèmes de fichiers
Comment[ga]=Bainistigh dioscaí, deighiltí agus córais comhad
Comment[gl]=Xestiona os discos, particións e sistemas de ficheiros
Comment[it]=Gestisci dischi, partizioni e filesystem
Comment[ja]=ディスク、パーティション、ファイルシステムを管理します
Comment[km]=គ្រប់គ្រង​ថាស ការ​ចែកភាគ​ថាស និង​ប្រព័ន្ធ​ឯកសារ
Comment[lv]=Pārvaldīt diskus, partīcijas un failu sistēmas
Comment[ms]=Urs cakera, partisyen dan sistem fail
Comment[nb]=Styr disker, partisjoner og filsystemer
Comment[nds]=Fastplaten, Partitschonen un Dateisystemen plegen
Comment[nl]=Beheer schijven, partities en bestandssystemen
Comment[nn]=Handter diskar, partisjonar og filsystem
Comment[pa]=ਡਿਸਕਾਂ, ਪਾਰਟੀਸ਼ਨਾਂ ਅਤੇ ਫਾਇਲ ਸਿਸਟਮਾਂ ਦਾ ਪਰਬੰਧ ਕਰੋ
Comment[pt]=Faz a gestão de discos, partições e sistemas de ficheiros
Comment[pt_BR]=Gerencie discos, partições e sistemas de arquivo
Comment[ro]=Gestionează discurile, partițiile și sistemele de fișiere
Comment[ru]=Управление дисками, разделами и файловыми системами
Comment[sk]=Spravuje disky, partície a súborové systémy
Comment[sr]=Управљајте дисковима, партицијама и фајл системима
Comment[sr@ijekavian]=Управљајте дисковима, партицијама и фајл системима
Comment[sr@ijekavianlatin]=Upravljajte diskovima, particijama i fajl sistemima
Comment[sr@latin]=Upravljajte diskovima, particijama i fajl sistemima
Comment[sv]=Hantera hårddiskar, partitioner och filsystem
Comment[tr]=Diskleri, disk bölümlerini ve dosya sistemlerini yönet
Comment[uk]=Керуйте дисками, розділами та файловими системами
Comment[x-test]=xxManage disks, partitions and file systemsxx
Comment[zh_CN]=管理磁盘、分区和文件系统
Comment[zh_TW]=管理磁碟、分割區與檔案系統

View File

@ -1,158 +0,0 @@
/***************************************************************************
* Copyright (C) 2009 by Volker Lanz <vl@fidra.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "kcm/partitionmanagerkcm.h"
#include "gui/partitionmanagerwidget.h"
#include "gui/listdevices.h"
#include "util/helpers.h"
#include <config.h>
#include <kgenericfactory.h>
#include <klocale.h>
#include <kactioncollection.h>
#include <ktoolbar.h>
#include <kapplication.h>
#include <kcmultidialog.h>
#include <QTimer>
#include <QReadLocker>
K_PLUGIN_FACTORY(
PartitionManagerKCMFactory,
registerPlugin<PartitionManagerKCM>();
)
K_EXPORT_PLUGIN(
PartitionManagerKCMFactory("kcm_partitionmanager", "partitionmanager")
)
PartitionManagerKCM::PartitionManagerKCM(QWidget* parent, const QVariantList&) :
KCModule(PartitionManagerKCMFactory::componentData(), parent),
Ui::PartitionManagerKCMBase(),
m_ActionCollection(new KActionCollection(this, PartitionManagerKCMFactory::componentData()))
{
setupUi(this);
connect(GlobalLog::instance(), SIGNAL(newMessage(Log::Level, const QString&)), SLOT(onNewLogMessage(Log::Level, const QString&)));
// workaround for https://bugs.launchpad.net/kdesudo/+bug/272427
unblockSigChild();
registerMetaTypes();
setButtons(Apply);
setupConnections();
listDevices().setActionCollection(actionCollection());
listOperations().setActionCollection(actionCollection());
pmWidget().init(actionCollection(), "kcm_partitionmanagerrc");
const char* actionNames[] =
{
"newPartition",
"resizePartition",
"deletePartition",
"copyPartition",
"pastePartition",
"checkPartition",
"propertiesPartition",
"backupPartition",
"restorePartition",
"",
"createNewPartitionTable",
"refreshDevices"
};
for (size_t i = 0; i < sizeof(actionNames) / sizeof(actionNames[0]); i++)
if (strlen(actionNames[i]) > 0)
toolBar().addAction(actionCollection()->action(actionNames[i]));
else
toolBar().addSeparator();
toolBar().setIconSize(QSize(22, 22));
toolBar().setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
splitterHorizontal().setStretchFactor(0, 1);
splitterHorizontal().setStretchFactor(1, 4);
splitterVertical().setStretchFactor(0, 1);
splitterVertical().setStretchFactor(1, 3);
setupKCMWorkaround();
setAboutData(createPartitionManagerAboutData());
}
void PartitionManagerKCM::onNewLogMessage(Log::Level, const QString& s)
{
kDebug() << s;
}
void PartitionManagerKCM::setupConnections()
{
connect(&listDevices(), SIGNAL(selectionChanged(const QString&)), &pmWidget(), SLOT(setSelectedDevice(const QString&)));
connect(&listDevices(), SIGNAL(deviceDoubleClicked(const QString&)), &pmWidget(), SLOT(onPropertiesDevice(const QString&)));
}
void PartitionManagerKCM::on_m_PartitionManagerWidget_operationsChanged()
{
listOperations().updateOperations(pmWidget().operations());
emit changed(pmWidget().numPendingOperations() > 0);
}
void PartitionManagerKCM::on_m_PartitionManagerWidget_devicesChanged()
{
QReadLocker lockDevices(&pmWidget().operationStack().lock());
listDevices().updateDevices(pmWidget().previewDevices());
}
void PartitionManagerKCM::setupKCMWorkaround()
{
// The Partition Manager kcm must be run as root, for obvious reasons. system-settings will
// open kcms that require root privileges in a separate kcmshell4 process with a window of
// its own. This window (a KDialog, actually) has a couple of buttons at the bottom, one of
// them an Ok-button. The user will expect to have his changes applied if he clicks that button.
// Unfortunately, we cannot do that: The kcmshell will kill us and our OperationRunner thread
// without asking us as soon as we return from PartitionManagerKCM::save(). Even worse, we
// have no way to find out if PartitionMangerKCM::save() was called because the user clicked
// on "Ok" or "Apply" -- if we had that way we could at least do nothing in the case of the
// Ok button...
// Anyway, there seems to be no other solution than find the KDialog and turn off all buttons we
// cannot handle... Nasty, but effective for now.
foreach(QWidget* w, KApplication::topLevelWidgets())
{
KCMultiDialog* dlg = qobject_cast<KCMultiDialog*>(w);
if (dlg != NULL)
{
dlg->setButtons(KDialog::Cancel|KDialog::Apply);
dlg->enableButtonApply(false);
connect(dlg, SIGNAL(applyClicked()), SLOT(onApplyClicked()));
}
}
}
void PartitionManagerKCM::onApplyClicked()
{
if (pmWidget().numPendingOperations() > 0)
actionCollection()->action("applyAllOperations")->trigger();
QTimer::singleShot(0, this, SLOT(on_m_PartitionManagerWidget_operationsChanged()));
}

View File

@ -1,75 +0,0 @@
/***************************************************************************
* Copyright (C) 2009 by Volker Lanz <vl@fidra.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#if !defined(PARTITIONMANAGERKCM__H)
#define PARTITIONMANAGERKCM__H
#include "ui_partitionmanagerkcmbase.h"
#include "util/globallog.h"
#include <kcmodule.h>
#include <kdebug.h>
class PartitionManagerWidget;
class ListDevices;
class KActionCollection;
class Device;
class KToolBar;
class PartitionManagerKCM : public KCModule, public Ui::PartitionManagerKCMBase
{
Q_OBJECT
Q_DISABLE_COPY(PartitionManagerKCM)
public:
PartitionManagerKCM(QWidget* parent, const QVariantList& args);
virtual ~PartitionManagerKCM() {}
public:
void load() {}
void save() {}
protected:
void setupConnections();
void setupKCMWorkaround();
PartitionManagerWidget& pmWidget() { Q_ASSERT(m_PartitionManagerWidget); return *m_PartitionManagerWidget; }
ListDevices& listDevices() { Q_ASSERT(m_ListDevices); return *m_ListDevices; }
ListOperations& listOperations() { Q_ASSERT(m_ListOperations); return *m_ListOperations; }
QSplitter& splitterHorizontal() { Q_ASSERT(m_SplitterHorizontal); return *m_SplitterHorizontal; }
QSplitter& splitterVertical() { Q_ASSERT(m_SplitterVertical); return *m_SplitterVertical; }
KToolBar& toolBar() { Q_ASSERT(m_ToolBar); return *m_ToolBar; }
KActionCollection* actionCollection() { return m_ActionCollection; }
protected slots:
void onNewLogMessage(Log::Level logLevel, const QString& s);
void onApplyClicked();
void on_m_PartitionManagerWidget_devicesChanged();
void on_m_PartitionManagerWidget_operationsChanged();
private:
KActionCollection* m_ActionCollection;
};
#endif

View File

@ -1,74 +0,0 @@
<ui version="4.0" >
<class>PartitionManagerKCMBase</class>
<widget class="QWidget" name="PartitionManagerKCMBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>684</width>
<height>684</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QSplitter" name="m_SplitterHorizontal" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<widget class="QSplitter" name="m_SplitterVertical" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<widget class="ListDevices" native="1" name="m_ListDevices" >
<property name="minimumSize" >
<size>
<width>170</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="ListOperations" native="1" name="m_ListOperations" />
</widget>
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="KToolBar" native="1" name="m_ToolBar" />
</item>
<item>
<widget class="PartitionManagerWidget" native="1" name="m_PartitionManagerWidget" />
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PartitionManagerWidget</class>
<extends>QWidget</extends>
<header>gui/partitionmanagerwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ListDevices</class>
<extends>QWidget</extends>
<header>gui/listdevices.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ListOperations</class>
<extends>QWidget</extends>
<header>gui/listoperations.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KToolBar</class>
<extends>QWidget</extends>
<header location="global" >ktoolbar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>