# HG changeset patch
# User unc0rr
# Date 1200835044 0
# Node ID 97a9d67d5c3eed644ad73ce74cd46f30f4cda9fd
# Parent bea32693bd7ab244b18762af8af8c61b3e3fe3bb
- Add 'Delete' button to demos and saves pages
- Set version to 0.9.2
diff -r bea32693bd7a -r 97a9d67d5c3e CMakeLists.txt
--- a/CMakeLists.txt Sun Jan 20 12:50:26 2008 +0000
+++ b/CMakeLists.txt Sun Jan 20 13:17:24 2008 +0000
@@ -22,7 +22,7 @@
set(CPACK_PACKAGE_VENDOR "Hedgewars")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "9")
-set(CPACK_PACKAGE_VERSION_PATCH "0")
+set(CPACK_PACKAGE_VERSION_PATCH "2")
set(CPACK_PACKAGE_FILE_NAME "hedgewars-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "hedgewars")
diff -r bea32693bd7a -r 97a9d67d5c3e QTfrontend/about.cpp
--- a/QTfrontend/about.cpp Sun Jan 20 12:50:26 2008 +0000
+++ b/QTfrontend/about.cpp Sun Jan 20 13:17:24 2008 +0000
@@ -35,7 +35,7 @@
lbl1->setOpenExternalLinks(true);
lbl1->setText(
"
Hedgewars
" +
- QLabel::tr("
Version 0.9
") +
+ QLabel::tr("
Version 0.9.2
") +
"
http://www.hedgewars.org/
" +
QLabel::tr("This program is distributed under the GNU General Public License") +
"
"
diff -r bea32693bd7a -r 97a9d67d5c3e QTfrontend/playrecordpage.cpp
--- a/QTfrontend/playrecordpage.cpp Sun Jan 20 12:50:26 2008 +0000
+++ b/QTfrontend/playrecordpage.cpp Sun Jan 20 13:17:24 2008 +0000
@@ -35,27 +35,32 @@
pageLayout->setColumnStretch(0, 1);
pageLayout->setColumnStretch(1, 2);
pageLayout->setColumnStretch(2, 1);
+ pageLayout->setRowStretch(2, 100);
BtnBack = new QPushButton(this);
BtnBack->setFont(*font14);
BtnBack->setText(QPushButton::tr("Back"));
- pageLayout->addWidget(BtnBack, 2, 0);
+ pageLayout->addWidget(BtnBack, 3, 0);
BtnPlayDemo = new QPushButton(this);
BtnPlayDemo->setFont(*font14);
BtnPlayDemo->setText(QPushButton::tr("Play demo"));
- pageLayout->addWidget(BtnPlayDemo, 2, 2);
+ pageLayout->addWidget(BtnPlayDemo, 3, 2);
BtnRenameRecord = new QPushButton(this);
-// BtnRenameRecord->setFont(*font14);
BtnRenameRecord->setText(QPushButton::tr("Rename"));
pageLayout->addWidget(BtnRenameRecord, 0, 2);
+ BtnRemoveRecord = new QPushButton(this);
+ BtnRemoveRecord->setText(QPushButton::tr("Delete"));
+ pageLayout->addWidget(BtnRemoveRecord, 1, 2);
+
DemosList = new QListWidget(this);
DemosList->setGeometry(QRect(170, 10, 311, 311));
- pageLayout->addWidget(DemosList, 0, 1, 2, 1);
+ pageLayout->addWidget(DemosList, 0, 1, 3, 1);
connect(BtnRenameRecord, SIGNAL(clicked()), this, SLOT(renameRecord()));
+ connect(BtnRemoveRecord, SIGNAL(clicked()), this, SLOT(removeRecord()));
}
void PagePlayDemo::FillFromDir(RecordType rectype)
@@ -124,3 +129,27 @@
FillFromDir(recType);
}
}
+
+void PagePlayDemo::removeRecord()
+{
+ QListWidgetItem * curritem = DemosList->currentItem();
+ if (!curritem)
+ {
+ QMessageBox::critical(this,
+ tr("Error"),
+ tr("Please, select record from the list"),
+ tr("OK"));
+ return ;
+ }
+ QFile rfile(curritem->data(Qt::UserRole).toString());
+
+ QFileInfo finfo(rfile);
+
+ bool ok;
+
+ ok = rfile.remove();
+ if(!ok)
+ QMessageBox::critical(this, tr("Error"), tr("Cannot delete file"));
+ else
+ FillFromDir(recType);
+}
diff -r bea32693bd7a -r 97a9d67d5c3e QTfrontend/playrecordpage.h
--- a/QTfrontend/playrecordpage.h Sun Jan 20 12:50:26 2008 +0000
+++ b/QTfrontend/playrecordpage.h Sun Jan 20 13:17:24 2008 +0000
@@ -42,6 +42,7 @@
QPushButton *BtnBack;
QPushButton *BtnPlayDemo;
QPushButton *BtnRenameRecord;
+ QPushButton *BtnRemoveRecord;
QListWidget *DemosList;
private:
@@ -49,6 +50,7 @@
private slots:
void renameRecord();
+ void removeRecord();
};
diff -r bea32693bd7a -r 97a9d67d5c3e hedgewars/hwengine.dpr
--- a/hedgewars/hwengine.dpr Sun Jan 20 12:50:26 2008 +0000
+++ b/hedgewars/hwengine.dpr Sun Jan 20 13:17:24 2008 +0000
@@ -288,8 +288,8 @@
////////////////////////////////////////////////////////////////////////////////
begin
-WriteLnToConsole('-= HedgeWars 0.9 =-');
-WriteLnToConsole(' -= by unC0Rr =- ');
+WriteLnToConsole('-= HedgeWars 0.9.2 =-');
+WriteLnToConsole(' -= by unC0Rr =- ');
GetParams;
Randomize;