Skip to content

Commit

Permalink
Fixed: recorded games right clic menu doesn't work
Browse files Browse the repository at this point in the history
Added: icon in right clic menu
  • Loading branch information
Aztorius committed Aug 1, 2016
1 parent 65572a2 commit ebc626b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ void MainWindow::slot_customcontextmenu(QPoint point)
Q_UNUSED(point);

QMenu *menu = new QMenu("Options", this);
menu->addAction(tr("Replay"));
menu->addAction(QIcon(":/open_replay.png"), tr("Replay"));
menu->addAction(tr("Stats"));
menu->addSeparator();
menu->addAction(tr("Delete"));
Expand All @@ -1884,7 +1884,7 @@ void MainWindow::slot_customcontextmenu(QPoint point)
void MainWindow::slot_custommenutriggered(QAction *action)
{
if(ui->tabWidget->currentIndex() == 0){
if(ui->tabWidget_2->currentIndex() == 0){
if(ui->tabWidget_2->currentIndex() == 1){
if(!ui->tableWidget_recordedgames->selectedItems().isEmpty()){
QString path = replaydirectory + "/" + recordedgames_filename.at(ui->tableWidget_recordedgames->selectedItems().first()->row());
if(action->text() == tr("Delete")){
Expand All @@ -1894,6 +1894,9 @@ void MainWindow::slot_custommenutriggered(QAction *action)
else if(!QFile::remove(path)){
log("Unable to remove the file : " + path);
}
else if(QFile::exists(path)){
log("Unable to remove the file : " + path);
}
}
else if(action->text() == tr("Replay")){
replay_launch(path);
Expand Down Expand Up @@ -1926,7 +1929,7 @@ void MainWindow::slot_custommenutriggered(QAction *action)
}
}
}
else if(ui->tabWidget_2->currentIndex() == 1){
else if(ui->tabWidget_2->currentIndex() == 0){
if(!ui->tableWidget_yourgames->selectedItems().isEmpty()){
QString path = replaydirectory + "/" + ui->tableWidget_yourgames->item(ui->tableWidget_yourgames->selectedItems().first()->row(), 4)->text();
if(action->text() == tr("Delete")){
Expand All @@ -1936,6 +1939,9 @@ void MainWindow::slot_custommenutriggered(QAction *action)
else if(!QFile::remove(path)){
log("Unable to remove the file : " + path);
}
else if(QFile::exists(path)){
log("Unable to remove the file : " + path);
}
}
else if(action->text() == tr("Replay")){
replay_launch(path);
Expand Down
8 changes: 4 additions & 4 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
</column>
<column>
<property name="text">
<string>Encryptionkey</string>
<string>Datetime</string>
</property>
</column>
</widget>
Expand Down Expand Up @@ -1098,10 +1098,10 @@
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_pbename">
<property name="text">
<string>Not working</string>
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
Expand All @@ -1115,7 +1115,7 @@
<item row="3" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit_pbeid">
<property name="text">
<string>Not working</string>
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
Expand Down

0 comments on commit ebc626b

Please sign in to comment.