Forráskód Böngészése

bumping to version 1

Nicole Portas 2 hónapja
szülő
commit
e99f291765
6 módosított fájl, 81 hozzáadás és 5 törlés
  1. 5 0
      config.mk
  2. 57 0
      make_deb.sh
  3. BIN
      obj/main.o
  4. 19 5
      src/main.cpp
  5. BIN
      visual-renamer
  6. BIN
      visual-renamer_1.0.0_amd64.deb

+ 5 - 0
config.mk

@@ -0,0 +1,5 @@
+# Auto-generated by ./configure
+CXX = g++
+CXXFLAGS = -std=c++17 -Wall -O2 -I/usr/include/gtkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/x86_64-linux-gnu/giomm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/x86_64-linux-gnu -I/usr/include/webp -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/x86_64-linux-gnu/cairomm-1.0/include -I/usr/include/pangomm-1.4 -I/usr/lib/x86_64-linux-gnu/pangomm-1.4/include -I/usr/include/atkmm-1.6 -I/usr/lib/x86_64-linux-gnu/atkmm-1.6/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include -pthread 
+LIBS = -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lgtk-3 -lgdk-3 -lz -latk-1.0 -lcairo-gobject -lgio-2.0 -lpangomm-1.4 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0  -pthread
+PREFIX ?= /usr/local

+ 57 - 0
make_deb.sh

@@ -0,0 +1,57 @@
+#!/bin/bash
+# Run this from your project root (where visual-renamer binary is)
+
+VERSION="1.0.0"
+ARCH="amd64"
+DEB_NAME="visual-renamer_${VERSION}_${ARCH}"
+
+echo "Building structure for ${DEB_NAME}..."
+mkdir -p ${DEB_NAME}/usr/bin
+mkdir -p ${DEB_NAME}/usr/share/applications
+mkdir -p ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps
+mkdir -p ${DEB_NAME}/DEBIAN
+
+echo "Copying binary and stripping that bloated shit..."
+cp visual-renamer ${DEB_NAME}/usr/bin/
+strip ${DEB_NAME}/usr/bin/visual-renamer
+chmod 755 ${DEB_NAME}/usr/bin/visual-renamer
+
+echo "Copying icon..."
+cp icon.png ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps/visual-renamer.png
+chmod 644 ${DEB_NAME}/usr/share/icons/hicolor/512x512/apps/visual-renamer.png
+
+echo "Writing .desktop file with the correct wmclass..."
+cat <<EOF > ${DEB_NAME}/usr/share/applications/visual-renamer.desktop
+[Desktop Entry]
+Version=1.0
+Name=Visual Renamer
+Comment=Simple Image Renamer
+Exec=/usr/bin/visual-renamer
+Icon=visual-renamer
+Terminal=false
+Type=Application
+Categories=Graphics;Utility;
+StartupWMClass=simpleimagerenamer
+EOF
+chmod 644 ${DEB_NAME}/usr/share/applications/visual-renamer.desktop
+
+echo "Writing DEBIAN/control..."
+cat <<EOF > ${DEB_NAME}/DEBIAN/control
+Package: visual-renamer
+Version: ${VERSION}
+Section: graphics
+Priority: optional
+Architecture: ${ARCH}
+Depends: libgtkmm-3.0-1v5
+Maintainer: Nikki <nicole@builder>
+Description: Simple Image Renamer
+ GUI for renaming images with drag and drop sorting.
+EOF
+
+echo "Building the fucking .deb..."
+dpkg-deb --build ${DEB_NAME}
+
+echo "Cleaning up..."
+rm -rf ${DEB_NAME}
+
+echo "Done. You now have ${DEB_NAME}.deb"

BIN
obj/main.o


+ 19 - 5
src/main.cpp

@@ -95,6 +95,7 @@ public:
         m_ToolbarTop.pack_start(m_BtnOpen, Gtk::PACK_SHRINK, 5);
 
         m_ToolbarTop.pack_start(*Gtk::manage(new Gtk::Label("  Sort: ")), Gtk::PACK_SHRINK);
+        m_ComboSort.append("Manual (Drag & Drop)");
         m_ComboSort.append("Name"); 
         m_ComboSort.append("Oldest (EXIF/File)"); 
         m_ComboSort.append("Newest (EXIF/File)");
@@ -127,6 +128,7 @@ public:
         m_ComboMode.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::on_mode_changed));
         m_ToolbarControls.pack_start(m_ComboMode, Gtk::PACK_SHRINK, 5);
 
+        // --- Sequential Pattern Mode ---
         m_EntryPattern.set_text("image_###");
         m_EntryPattern.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::update_preview));
         m_BoxPattern.pack_start(m_EntryPattern, Gtk::PACK_EXPAND_WIDGET);
@@ -136,11 +138,18 @@ public:
         m_BoxPattern.pack_start(m_SpinStartNum, Gtk::PACK_SHRINK);
         m_StackModes.add(m_BoxPattern, "Pattern");
 
+        // --- Find & Replace Mode ---
+        m_EntryFind.set_placeholder_text("Find string");
         m_EntryFind.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::update_preview));
-        m_BoxReplace.pack_start(m_EntryFind, Gtk::PACK_EXPAND_WIDGET);
+        m_BoxReplace.pack_start(*Gtk::manage(new Gtk::Label("Find:")), Gtk::PACK_SHRINK, 5);
+        m_BoxReplace.pack_start(m_EntryFind, Gtk::PACK_EXPAND_WIDGET, 5);
+        
+        m_EntryReplace.set_placeholder_text("Replacement string");
         m_EntryReplace.signal_changed().connect(sigc::mem_fun(*this, &RenamerWindow::update_preview));
-        m_BoxReplace.pack_start(m_EntryReplace, Gtk::PACK_EXPAND_WIDGET);
+        m_BoxReplace.pack_start(*Gtk::manage(new Gtk::Label("Replace:")), Gtk::PACK_SHRINK, 5);
+        m_BoxReplace.pack_start(m_EntryReplace, Gtk::PACK_EXPAND_WIDGET, 5);
         m_StackModes.add(m_BoxReplace, "Replace");
+        
         m_ToolbarControls.pack_start(m_StackModes, Gtk::PACK_EXPAND_WIDGET, 5);
 
         m_BtnRename.set_label("Apply New Names");
@@ -153,7 +162,11 @@ public:
         m_VBox.pack_start(m_ScrolledWindow);
 
         m_RefListStore = Gtk::ListStore::create(m_Columns);
+        
+        m_RefListStore->signal_row_deleted().connect([this](const Gtk::TreeModel::Path&){ update_preview(); });
+
         m_IconView.set_model(m_RefListStore);
+        m_IconView.set_reorderable(true);
         m_IconView.pack_start(m_cell_frame, false);
         m_IconView.add_attribute(m_cell_frame, "pixbuf", m_Columns.m_col_pixbuf);
         m_IconView.pack_start(m_cell_toggle, false);
@@ -237,7 +250,6 @@ protected:
     void launch_terminal() {
         if (m_current_path.empty()) return;
         std::string cmd = "gnome-terminal --working-directory='" + m_current_path + "'";
-        // Fixed: Explicitly creating the vector to avoid ambiguity
         std::vector<Glib::RefPtr<Gio::File>> no_files;
         Gio::AppInfo::create_from_commandline(cmd, "Terminal", Gio::APP_INFO_CREATE_NONE)->launch(no_files); 
     }
@@ -345,8 +357,9 @@ protected:
 
     void on_sort_changed() {
         int s = m_ComboSort.get_active_row_number();
-        if (s == 0) m_RefListStore->set_sort_column(m_Columns.m_col_filename, Gtk::SORT_ASCENDING);
-        else m_RefListStore->set_sort_column(m_Columns.m_col_time, (s == 1 ? Gtk::SORT_ASCENDING : Gtk::SORT_DESCENDING));
+        if (s == 0) m_RefListStore->set_sort_column(GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, Gtk::SORT_ASCENDING);
+        else if (s == 1) m_RefListStore->set_sort_column(m_Columns.m_col_filename, Gtk::SORT_ASCENDING);
+        else m_RefListStore->set_sort_column(m_Columns.m_col_time, (s == 2 ? Gtk::SORT_ASCENDING : Gtk::SORT_DESCENDING));
         update_preview();
     }
 
@@ -422,6 +435,7 @@ protected:
 
     void on_open_folder_clicked() {
         Gtk::FileChooserDialog d(*this, "Open", Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
+        d.set_show_hidden(true); // <--- Here's your fix
         d.add_button("Cancel", Gtk::RESPONSE_CANCEL); d.add_button("Open", Gtk::RESPONSE_OK);
         if (d.run() == Gtk::RESPONSE_OK) start_loading_folder(d.get_filename());
     }

BIN
visual-renamer


BIN
visual-renamer_1.0.0_amd64.deb