|
|
@@ -87,7 +87,6 @@ public:
|
|
|
m_ComboSort.append("Name (Natural)");
|
|
|
m_ComboSort.append("Date (Oldest First)");
|
|
|
m_ComboSort.append("Date (Newest First)");
|
|
|
- // [PATCH] Added Manual option
|
|
|
m_ComboSort.append("Manual (Drag & Drop)");
|
|
|
m_ComboSort.set_active(0);
|
|
|
m_ComboSort.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::on_sort_changed));
|
|
|
@@ -193,7 +192,7 @@ public:
|
|
|
|
|
|
m_RefListStore = Gtk::ListStore::create(m_Columns);
|
|
|
|
|
|
- // [PATCH] Connect signal to update sequence numbers on Drag & Drop
|
|
|
+ // Connect signal to update sequence numbers on Drag & Drop
|
|
|
m_RefListStore->signal_row_inserted().connect([this](const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&){
|
|
|
// When a row is dropped (inserted), refresh the numbering
|
|
|
update_preview();
|
|
|
@@ -222,7 +221,6 @@ public:
|
|
|
m_IconView.set_row_spacing(15);
|
|
|
m_IconView.set_tooltip_column(m_Columns.m_col_path.index());
|
|
|
|
|
|
- // [PATCH] Enable Reordering
|
|
|
m_IconView.set_reorderable(true);
|
|
|
|
|
|
m_ScrolledWindow.add(m_IconView);
|
|
|
@@ -235,8 +233,6 @@ public:
|
|
|
|
|
|
// --- Drag & Drop (External Files) ---
|
|
|
std::vector<Gtk::TargetEntry> listTargets = { Gtk::TargetEntry("text/uri-list") };
|
|
|
- // Note: For internal reordering, set_reorderable(true) handles it.
|
|
|
- // We only use this signal for files dragged from outside (Nautilus/Explorer).
|
|
|
m_IconView.drag_dest_set(listTargets, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_COPY);
|
|
|
m_IconView.signal_drag_data_received().connect(sigc::mem_fun(*this, &RenamerWindow::on_drag_data_received));
|
|
|
|
|
|
@@ -537,10 +533,9 @@ protected:
|
|
|
int sort_mode = m_ComboSort.get_active_row_number();
|
|
|
// 0=Name, 1=DateOld, 2=DateNew, 3=Manual
|
|
|
|
|
|
- // [PATCH] Manual Mode Logic
|
|
|
if (sort_mode == 3) {
|
|
|
- // Disable sorting to allow drag & drop
|
|
|
- m_RefListStore->set_sort_column(Gtk::TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, Gtk::SORT_ASCENDING);
|
|
|
+ // [FIXED] Use C macro directly for unsorted column
|
|
|
+ m_RefListStore->set_sort_column(GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, Gtk::SORT_ASCENDING);
|
|
|
m_Statusbar.push("Manual mode: Drag images to reorder.");
|
|
|
return;
|
|
|
}
|
|
|
@@ -687,12 +682,9 @@ protected:
|
|
|
if (dialog.run() == Gtk::RESPONSE_OK) start_loading_folder(dialog.get_filename());
|
|
|
}
|
|
|
|
|
|
- // [PATCH] Update D&D to support both internal reordering and external file drops
|
|
|
void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) {
|
|
|
std::vector<Glib::ustring> uris = selection_data.get_uris();
|
|
|
|
|
|
- // If URI list is empty, it might be an internal reorder (which is handled automatically by set_reorderable)
|
|
|
- // OR it's a failed external drop.
|
|
|
if (uris.empty()) {
|
|
|
context->drag_finish(false, false, time);
|
|
|
return;
|
|
|
@@ -703,7 +695,6 @@ protected:
|
|
|
start_loading_folder(filename);
|
|
|
context->drag_finish(true, false, time);
|
|
|
} else {
|
|
|
- // Check if it's a file from outside
|
|
|
if (fs::exists(filename)) {
|
|
|
start_loading_folder(fs::path(filename).parent_path().string());
|
|
|
context->drag_finish(true, false, time);
|