summaryrefslogtreecommitdiffstats
path: root/src/qphotorec.cpp
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-08-09 13:09:40 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-08-09 13:09:40 +0200
commit5b33233ba5736706994b9e764fe99a28bf8e98bd (patch)
treee9782adb64461efdbde738fd79ff5fef81d74e01 /src/qphotorec.cpp
parenta0f10fb81fbfd5c7628b522e4446d97ea3e46350 (diff)
qphotorec: display partition list
Diffstat (limited to 'src/qphotorec.cpp')
-rw-r--r--src/qphotorec.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/qphotorec.cpp b/src/qphotorec.cpp
index e581850..821f8d8 100644
--- a/src/qphotorec.cpp
+++ b/src/qphotorec.cpp
@@ -43,7 +43,10 @@
#include "hdcache.h"
#include "hdaccess.h"
#include "fnctdsk.h"
+#include "filegen.h"
+#include "photorec.h"
#include "qphotorec.h"
+#include "intrf.h"
QPhotorec::QPhotorec(QWidget *my_parent) : QWidget(my_parent)
{
@@ -65,19 +68,54 @@ QPhotorec::QPhotorec(QWidget *my_parent) : QWidget(my_parent)
void QPhotorec::partition_selection(disk_t *disk)
{
- this->setWindowTitle(tr("QPhotoRec: partition selection"));
+ list_part_t *list_part;
+ list_part_t *element;
QLabel *t_copy = new QLabel("PhotoRec 6.14-WIP, Data Recovery Utility, May 2012\nChristophe GRENIER <grenier@cgsecurity.org>\nhttp://www.cgsecurity.org");
+ QLabel *t_disk = new QLabel(disk->description_short(disk));
+ QPushButton *button_proceed = new QPushButton("&Proceed");
QPushButton *button_quit= new QPushButton("&Quit");
+ QWidget *B_widget = new QWidget(this);
+ QHBoxLayout *B_layout = new QHBoxLayout(B_widget);
+ B_layout->addWidget(button_proceed);
+ B_layout->addWidget(button_quit);
+ B_widget->setLayout(B_layout);
+
+ PartListWidget= new QListWidget();
+ list_part=disk->arch->read_part(disk, 0, 0);
+ {
+ int insert_error=0;
+ partition_t *partition_wd;
+ partition_wd=new_whole_disk(disk);
+ list_part=insert_new_partition(list_part, partition_wd, 0, &insert_error);
+ if(insert_error>0)
+ {
+ free(partition_wd);
+ }
+ }
+ if(list_part==NULL)
+ return;
+ for(element=list_part; element!=NULL; element=element->next)
+ {
+ const char *msg;
+ msg=aff_part_aux(AFF_PART_ORDER|AFF_PART_STATUS, disk, element->part);
+ PartListWidget->addItem(msg);
+ }
+
clearWidgets();
QLayout *mainLayout = this->layout();
- QLabel *t_disk = new QLabel(disk->description_short(disk));
+// this->setWindowTitle(tr("QPhotoRec: partition selection"));
mainLayout->addWidget(t_copy);
mainLayout->addWidget(t_disk);
- mainLayout->addWidget(button_quit);
+ mainLayout->addWidget(PartListWidget);
+ mainLayout->addWidget(B_widget);
+
+ this->setLayout(mainLayout);
connect( button_quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
+// connect( button_proceed, SIGNAL(clicked()), this, SLOT(partition_selected()));
+// connect( PartListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(partition_selected()));
}
void QPhotorec::disk_selected()
@@ -159,7 +197,6 @@ void QPhotorec::disk_sel()
B_widget->setLayout(B_layout);
QVBoxLayout *mainLayout = new QVBoxLayout();
- //QLayout *mainLayout = this->layout();
mainLayout->addWidget(t_copy);
mainLayout->addWidget(t_free_soft);
mainLayout->addWidget(t_select);