From 488178c823041179045ac5da9714340b15f72819 Mon Sep 17 00:00:00 2001 From: Volker Lanz Date: Tue, 23 Feb 2010 17:25:53 +0000 Subject: [PATCH] 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 --- TODO | 2 - src/CMakeLists.txt | 20 ---- src/kcm/kcm_partitionmanager.desktop | 89 --------------- src/kcm/partitionmanagerkcm.cpp | 158 --------------------------- src/kcm/partitionmanagerkcm.h | 75 ------------- src/kcm/partitionmanagerkcmbase.ui | 74 ------------- 6 files changed, 418 deletions(-) delete mode 100644 src/kcm/kcm_partitionmanager.desktop delete mode 100644 src/kcm/partitionmanagerkcm.cpp delete mode 100644 src/kcm/partitionmanagerkcm.h delete mode 100644 src/kcm/partitionmanagerkcmbase.ui diff --git a/TODO b/TODO index 2e00496..268b096 100644 --- a/TODO +++ b/TODO @@ -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. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 00578d6..fcc575c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) - diff --git a/src/kcm/kcm_partitionmanager.desktop b/src/kcm/kcm_partitionmanager.desktop deleted file mode 100644 index f86d8f0..0000000 --- a/src/kcm/kcm_partitionmanager.desktop +++ /dev/null @@ -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]=管理磁碟、分割區與檔案系統 diff --git a/src/kcm/partitionmanagerkcm.cpp b/src/kcm/partitionmanagerkcm.cpp deleted file mode 100644 index 4eb9ad4..0000000 --- a/src/kcm/partitionmanagerkcm.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Volker Lanz * - * * - * 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 - -#include -#include -#include -#include -#include -#include - -#include -#include - -K_PLUGIN_FACTORY( - PartitionManagerKCMFactory, - registerPlugin(); -) -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(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())); -} - diff --git a/src/kcm/partitionmanagerkcm.h b/src/kcm/partitionmanagerkcm.h deleted file mode 100644 index 6eec547..0000000 --- a/src/kcm/partitionmanagerkcm.h +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Volker Lanz * - * * - * 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 -#include - -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 diff --git a/src/kcm/partitionmanagerkcmbase.ui b/src/kcm/partitionmanagerkcmbase.ui deleted file mode 100644 index 98a457c..0000000 --- a/src/kcm/partitionmanagerkcmbase.ui +++ /dev/null @@ -1,74 +0,0 @@ - - PartitionManagerKCMBase - - - - 0 - 0 - 684 - 684 - - - - - - - Qt::Horizontal - - - - Qt::Vertical - - - - - 170 - 0 - - - - - - - - - - - - - - - - - - - - - - PartitionManagerWidget - QWidget -
gui/partitionmanagerwidget.h
- 1 -
- - ListDevices - QWidget -
gui/listdevices.h
- 1 -
- - ListOperations - QWidget -
gui/listoperations.h
- 1 -
- - KToolBar - QWidget -
ktoolbar.h
- 1 -
-
- - -