|
@@ -121,18 +121,6 @@ public:
|
|
|
m_ComboSize.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::on_size_changed));
|
|
m_ComboSize.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::on_size_changed));
|
|
|
m_ToolbarTop.pack_start(m_ComboSize, Gtk::PACK_SHRINK, 5);
|
|
m_ToolbarTop.pack_start(m_ComboSize, Gtk::PACK_SHRINK, 5);
|
|
|
|
|
|
|
|
- // --- Added Select All / None Buttons ---
|
|
|
|
|
- m_ToolbarTop.pack_start(*Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL)), Gtk::PACK_SHRINK, 10);
|
|
|
|
|
-
|
|
|
|
|
- m_BtnSelectAll.set_label("Select All");
|
|
|
|
|
- m_BtnSelectAll.signal_clicked().connect([this](){ on_selection_change(true); });
|
|
|
|
|
- m_ToolbarTop.pack_start(m_BtnSelectAll, Gtk::PACK_SHRINK, 2);
|
|
|
|
|
-
|
|
|
|
|
- m_BtnSelectNone.set_label("Select None");
|
|
|
|
|
- m_BtnSelectNone.signal_clicked().connect([this](){ on_selection_change(false); });
|
|
|
|
|
- m_ToolbarTop.pack_start(m_BtnSelectNone, Gtk::PACK_SHRINK, 2);
|
|
|
|
|
- // ---------------------------------------
|
|
|
|
|
-
|
|
|
|
|
m_BtnUndo.set_label("Undo Last Rename");
|
|
m_BtnUndo.set_label("Undo Last Rename");
|
|
|
m_BtnUndo.set_sensitive(false);
|
|
m_BtnUndo.set_sensitive(false);
|
|
|
m_BtnUndo.signal_clicked().connect(sigc::mem_fun(*this, &RenamerWindow::on_undo_clicked));
|
|
m_BtnUndo.signal_clicked().connect(sigc::mem_fun(*this, &RenamerWindow::on_undo_clicked));
|
|
@@ -201,6 +189,21 @@ public:
|
|
|
m_IconView.set_selection_mode(Gtk::SELECTION_NONE);
|
|
m_IconView.set_selection_mode(Gtk::SELECTION_NONE);
|
|
|
m_IconView.set_reorderable(false);
|
|
m_IconView.set_reorderable(false);
|
|
|
|
|
|
|
|
|
|
+ // --- Context Menu Setup (Right Click) ---
|
|
|
|
|
+ m_MenuItemSelectAll.set_label("Select All");
|
|
|
|
|
+ m_MenuItemSelectAll.signal_activate().connect([this](){ on_selection_change(true); });
|
|
|
|
|
+ m_MenuPopup.append(m_MenuItemSelectAll);
|
|
|
|
|
+
|
|
|
|
|
+ m_MenuItemSelectNone.set_label("Select None");
|
|
|
|
|
+ m_MenuItemSelectNone.signal_activate().connect([this](){ on_selection_change(false); });
|
|
|
|
|
+ m_MenuPopup.append(m_MenuItemSelectNone);
|
|
|
|
|
+
|
|
|
|
|
+ m_MenuPopup.show_all();
|
|
|
|
|
+
|
|
|
|
|
+ // Connect Button Press Event for Right Click
|
|
|
|
|
+ m_IconView.signal_button_press_event().connect(sigc::mem_fun(*this, &RenamerWindow::on_iconview_button_press), false);
|
|
|
|
|
+ // ----------------------------------------
|
|
|
|
|
+
|
|
|
m_ScrolledWindow.add(m_IconView);
|
|
m_ScrolledWindow.add(m_IconView);
|
|
|
m_VBox.pack_start(m_ProgressBar, Gtk::PACK_SHRINK);
|
|
m_VBox.pack_start(m_ProgressBar, Gtk::PACK_SHRINK);
|
|
|
m_VBox.pack_end(m_Statusbar, Gtk::PACK_SHRINK);
|
|
m_VBox.pack_end(m_Statusbar, Gtk::PACK_SHRINK);
|
|
@@ -219,9 +222,6 @@ protected:
|
|
|
Gtk::Box m_VBox, m_ToolbarTop, m_ToolbarControls, m_BoxPattern, m_BoxReplace;
|
|
Gtk::Box m_VBox, m_ToolbarTop, m_ToolbarControls, m_BoxPattern, m_BoxReplace;
|
|
|
Gtk::Frame m_FrameControls;
|
|
Gtk::Frame m_FrameControls;
|
|
|
Gtk::Button m_BtnOpen, m_BtnRename, m_BtnUndo, m_BtnStopReload;
|
|
Gtk::Button m_BtnOpen, m_BtnRename, m_BtnUndo, m_BtnStopReload;
|
|
|
- // --- Added Buttons ---
|
|
|
|
|
- Gtk::Button m_BtnSelectAll, m_BtnSelectNone;
|
|
|
|
|
- // ---------------------
|
|
|
|
|
Gtk::Entry m_EntryPattern, m_EntryFind, m_EntryReplace;
|
|
Gtk::Entry m_EntryPattern, m_EntryFind, m_EntryReplace;
|
|
|
Gtk::ComboBoxText m_ComboSize, m_ComboSort, m_ComboMode;
|
|
Gtk::ComboBoxText m_ComboSize, m_ComboSort, m_ComboMode;
|
|
|
Gtk::SpinButton m_SpinStartNum;
|
|
Gtk::SpinButton m_SpinStartNum;
|
|
@@ -235,6 +235,12 @@ protected:
|
|
|
Gtk::CellRendererText m_cell_text;
|
|
Gtk::CellRendererText m_cell_text;
|
|
|
Gtk::CellRendererToggle m_cell_toggle;
|
|
Gtk::CellRendererToggle m_cell_toggle;
|
|
|
|
|
|
|
|
|
|
+ // --- Menu Members ---
|
|
|
|
|
+ Gtk::Menu m_MenuPopup;
|
|
|
|
|
+ Gtk::MenuItem m_MenuItemSelectAll;
|
|
|
|
|
+ Gtk::MenuItem m_MenuItemSelectNone;
|
|
|
|
|
+ // --------------------
|
|
|
|
|
+
|
|
|
struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
|
|
struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
ModelColumns() { add(m_col_path); add(m_col_filename); add(m_col_pixbuf); add(m_col_checked); add(m_col_markup); add(m_col_time); add(m_col_info_str); }
|
|
ModelColumns() { add(m_col_path); add(m_col_filename); add(m_col_pixbuf); add(m_col_checked); add(m_col_markup); add(m_col_time); add(m_col_info_str); }
|
|
|
Gtk::TreeModelColumn<std::string> m_col_path, m_col_filename, m_col_markup, m_col_info_str;
|
|
Gtk::TreeModelColumn<std::string> m_col_path, m_col_filename, m_col_markup, m_col_info_str;
|
|
@@ -271,7 +277,7 @@ protected:
|
|
|
if(it) { (*it)[m_Columns.m_col_checked] = !(*it)[m_Columns.m_col_checked]; update_preview(); }
|
|
if(it) { (*it)[m_Columns.m_col_checked] = !(*it)[m_Columns.m_col_checked]; update_preview(); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // --- Added Helper for Mass Selection ---
|
|
|
|
|
|
|
+ // --- Selection Helper ---
|
|
|
void on_selection_change(bool select_all) {
|
|
void on_selection_change(bool select_all) {
|
|
|
if (!m_RefListStore) return;
|
|
if (!m_RefListStore) return;
|
|
|
for (auto row : m_RefListStore->children()) {
|
|
for (auto row : m_RefListStore->children()) {
|
|
@@ -279,7 +285,16 @@ protected:
|
|
|
}
|
|
}
|
|
|
update_preview();
|
|
update_preview();
|
|
|
}
|
|
}
|
|
|
- // ---------------------------------------
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // --- Mouse Button Handler ---
|
|
|
|
|
+ bool on_iconview_button_press(GdkEventButton* event) {
|
|
|
|
|
+ if (event->type == GDK_BUTTON_PRESS && event->button == 3) { // Right Click
|
|
|
|
|
+ m_MenuPopup.popup(event->button, event->time);
|
|
|
|
|
+ return true; // We handled it
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // ----------------------------
|
|
|
|
|
|
|
|
void on_stop_reload_clicked() {
|
|
void on_stop_reload_clicked() {
|
|
|
if (m_is_loading) m_stop_flag = true;
|
|
if (m_is_loading) m_stop_flag = true;
|