Updated project added random

This commit is contained in:
Jared Bruni
2019-12-08 23:18:03 -08:00
parent bf6f931734
commit f763df7713
2 changed files with 14 additions and 0 deletions

View File

@@ -521,6 +521,12 @@ void AC_MainWindow::createMenu() {
set_newnames = new QAction(tr("Set Favorites"), this);
connect(set_newnames, SIGNAL(triggered()), this, SLOT(show_Favorites()));
controls_menu->addAction(set_newnames);
select_random_filter = new QAction(tr("Set Random Filter"), this);
connect(select_random_filter, SIGNAL(triggered()), this, SLOT(setRandomFilterValue()));
select_random_filter->setShortcut(tr("Space"));
controls_menu->addAction(select_random_filter);
}
void AC_MainWindow::showFull() {
@@ -1670,3 +1676,9 @@ void AC_MainWindow::save_CustomFile() {
Log(stream.str().c_str());
file_n.close();
}
void AC_MainWindow::setRandomFilterValue() {
menu_cat->setCurrentIndex(0);
std::string filter_name = ac::solo_filter[rand()%ac::solo_filter.size()-1];
filters->setCurrentIndex(ac::filter_map[filter_name]);
}

View File

@@ -59,6 +59,7 @@ public:
QAction *show_image_window;
QAction *show_options_window;
QAction *show_control_window;
QAction *select_random_filter;
double speed_actions[7];
QRadioButton *filter_single, *filter_custom;
void updateList();
@@ -126,6 +127,7 @@ public slots:
void showFull();
void showImageWindow();
void showPrefWindow();
void setRandomFilterValue();
private:
void createControls();
void createMenu();