diff --git a/src/main_window.cpp b/src/main_window.cpp index d911550..f679acd 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -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]); +} diff --git a/src/main_window.h b/src/main_window.h index e0a7499..5511be1 100644 --- a/src/main_window.h +++ b/src/main_window.h @@ -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();