When removing a record, set selection on the next item in the list
authorunc0rr
Thu, 12 Jul 2012 23:31:06 +0400
changeset 7382 b158940f83e2
parent 7378 ac9ce7f033df
child 7385 4acb5c021cb9
When removing a record, set selection on the next item in the list
QTfrontend/ui/page/pageplayrecord.cpp
--- a/QTfrontend/ui/page/pageplayrecord.cpp	Thu Jul 12 06:19:32 2012 -0400
+++ b/QTfrontend/ui/page/pageplayrecord.cpp	Thu Jul 12 23:31:06 2012 +0400
@@ -169,7 +169,11 @@
     if(!ok)
         QMessageBox::critical(this, tr("Error"), tr("Cannot delete file"));
     else
-        FillFromDir(recType);
+    {
+        int i = DemosList->row(curritem);
+        delete curritem;
+        DemosList->setCurrentRow(i < DemosList->count() ? i : DemosList->count() - 1);
+    }
 }
 
 bool PagePlayDemo::isSave()