Add "elfzip" target to make which creates a zip of all elf files, as mapzip does...
[maemo-rb.git] / rbutil / rbutilqt / uninstallwindow.cpp
blobfc47840b78712b9b21ee4f6ba6976d88e7b7db91
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Riebeling
10 * $Id$
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #include "uninstallwindow.h"
21 #include "ui_uninstallfrm.h"
22 #include "rbsettings.h"
24 UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent)
26 ui.setupUi(this);
27 ui.UninstalllistWidget->setAlternatingRowColors(true);
28 connect(ui.UninstalllistWidget,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged()));
29 connect(ui.CompleteRadioBtn,SIGNAL(toggled(bool)),this,SLOT(UninstallMethodChanged(bool)));
31 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
33 uninstaller = new Uninstaller(this,mountpoint);
34 logger = new ProgressLoggerGui(this);
35 connect(uninstaller, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
36 connect(uninstaller, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
37 connect(uninstaller, SIGNAL(logFinished(void)), logger, SLOT(setFinished(void)));
38 connect(logger, SIGNAL(closed()), this, SLOT(close()));
40 // disable smart uninstall, if not possible
41 if(!uninstaller->uninstallPossible())
43 ui.smartRadioButton->setEnabled(false);
44 ui.smartGroupBox->setEnabled(false);
45 ui.CompleteRadioBtn->setChecked(true);
47 else // fill in installed parts
49 ui.smartRadioButton->setChecked(true);
50 ui.UninstalllistWidget->addItems(uninstaller->getAllSections());
56 void UninstallWindow::accept()
58 logger->show();
60 if(ui.CompleteRadioBtn->isChecked())
62 uninstaller->deleteAll();
64 else
66 uninstaller->uninstall();
72 void UninstallWindow::selectionChanged()
74 QList<QListWidgetItem *> itemlist = ui.UninstalllistWidget->selectedItems();
75 QStringList seletedStrings;
76 for(int i=0;i < itemlist.size(); i++ )
78 seletedStrings << itemlist.at(i)->text();
81 uninstaller->setSections(seletedStrings);
84 void UninstallWindow::UninstallMethodChanged(bool complete)
86 if(complete)
87 ui.smartGroupBox->setEnabled(false);
88 else
89 ui.smartGroupBox->setEnabled(true);