Qt: prevent playing movies directly after a refresh
This commit is contained in:
@@ -35,6 +35,15 @@ game_list::game_list() : QTableWidget(), game_list_base()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void game_list::stop_movie()
|
||||||
|
{
|
||||||
|
if (m_last_hover_item)
|
||||||
|
{
|
||||||
|
m_last_hover_item->set_active(false);
|
||||||
|
m_last_hover_item = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void game_list::sync_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility)
|
void game_list::sync_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility)
|
||||||
{
|
{
|
||||||
ensure(get_visibility);
|
ensure(get_visibility);
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class game_list : public QTableWidget, public game_list_base
|
|||||||
public:
|
public:
|
||||||
game_list();
|
game_list();
|
||||||
|
|
||||||
|
void stop_movie();
|
||||||
|
|
||||||
void sync_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility);
|
void sync_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility);
|
||||||
void create_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility, std::function<void(int, bool)> set_visibility);
|
void create_header_actions(std::map<int, QAction*>& actions, std::function<bool(int)> get_visibility, std::function<void(int, bool)> set_visibility);
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,17 @@ game_list_grid::game_list_grid()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void game_list_grid::stop_movie()
|
||||||
|
{
|
||||||
|
for (flow_widget_item* flow_item : items())
|
||||||
|
{
|
||||||
|
if (game_list_grid_item* item = static_cast<game_list_grid_item*>(flow_item))
|
||||||
|
{
|
||||||
|
item->set_active(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void game_list_grid::clear_list()
|
void game_list_grid::clear_list()
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
@@ -145,6 +156,9 @@ void game_list_grid::populate(
|
|||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
select_items(selected_items);
|
select_items(selected_items);
|
||||||
|
|
||||||
|
// Prevent playing unwanted movie
|
||||||
|
stop_movie();
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_list_grid::repaint_icons(std::vector<game_info>& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio)
|
void game_list_grid::repaint_icons(std::vector<game_info>& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ class game_list_grid : public flow_widget, public game_list_base
|
|||||||
public:
|
public:
|
||||||
explicit game_list_grid();
|
explicit game_list_grid();
|
||||||
|
|
||||||
|
void stop_movie();
|
||||||
|
|
||||||
void clear_list() override;
|
void clear_list() override;
|
||||||
|
|
||||||
void populate(
|
void populate(
|
||||||
|
|||||||
@@ -424,6 +424,9 @@ void game_list_table::populate(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Q_EMIT itemSelectionChanged();
|
Q_EMIT itemSelectionChanged();
|
||||||
|
|
||||||
|
// Prevent playing unwanted movie
|
||||||
|
stop_movie();
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_list_table::repaint_icons(std::vector<game_info>& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio)
|
void game_list_table::repaint_icons(std::vector<game_info>& game_data, const QColor& icon_color, const QSize& icon_size, qreal device_pixel_ratio)
|
||||||
|
|||||||
@@ -3543,10 +3543,10 @@ void main_window::CreateConnects()
|
|||||||
|
|
||||||
connect(ui->downloadIntegrityDbAct, &QAction::triggered, this, [this]()
|
connect(ui->downloadIntegrityDbAct, &QAction::triggered, this, [this]()
|
||||||
{
|
{
|
||||||
ensure(m_game_list_frame->GetIsoIntegrity())->download();
|
m_game_list_frame->GetIsoIntegrity()->download();
|
||||||
ensure(m_game_list_frame->GetPsnContentIntegrity())->download();
|
m_game_list_frame->GetPsnContentIntegrity()->download();
|
||||||
ensure(m_game_list_frame->GetPsnDlcIntegrity())->download();
|
m_game_list_frame->GetPsnDlcIntegrity()->download();
|
||||||
ensure(m_game_list_frame->GetPsnUpdateIntegrity())->download();
|
m_game_list_frame->GetPsnUpdateIntegrity()->download();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->downloadCompatDbAct, &QAction::triggered, this, [this]()
|
connect(ui->downloadCompatDbAct, &QAction::triggered, this, [this]()
|
||||||
|
|||||||
Reference in New Issue
Block a user