diff --git a/plugins/archiver/__init__.py b/plugins/archiver/__init__.py
new file mode 100644
index 0000000..d36fa8c
--- /dev/null
+++ b/plugins/archiver/__init__.py
@@ -0,0 +1,3 @@
+"""
+ Pligin Module
+"""
diff --git a/plugins/archiver/__main__.py b/plugins/archiver/__main__.py
new file mode 100644
index 0000000..a576329
--- /dev/null
+++ b/plugins/archiver/__main__.py
@@ -0,0 +1,3 @@
+"""
+ Pligin Package
+"""
diff --git a/plugins/archiver/archiver.glade b/plugins/archiver/archiver.glade
new file mode 100644
index 0000000..1879b61
--- /dev/null
+++ b/plugins/archiver/archiver.glade
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
diff --git a/plugins/archiver/manifest.json b/plugins/archiver/manifest.json
new file mode 100644
index 0000000..761a2eb
--- /dev/null
+++ b/plugins/archiver/manifest.json
@@ -0,0 +1,12 @@
+{
+ "manifest": {
+ "name": "Archiver",
+ "author": "ITDominator",
+ "version": "0.0.1",
+ "support": "",
+ "requests": {
+ "ui_target": "context_menu",
+ "pass_fm_events": "true"
+ }
+ }
+}
diff --git a/plugins/archiver/plugin.py b/plugins/archiver/plugin.py
new file mode 100644
index 0000000..1c02225
--- /dev/null
+++ b/plugins/archiver/plugin.py
@@ -0,0 +1,122 @@
+# Python imports
+import os, threading, subprocess, inspect, shlex
+
+# Lib imports
+import gi
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk
+
+# Application imports
+from plugins.plugin_base import PluginBase
+
+
+# NOTE: Threads WILL NOT die with parent's destruction.
+def threaded(fn):
+ def wrapper(*args, **kwargs):
+ threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=False).start()
+ return wrapper
+
+# NOTE: Threads WILL die with parent's destruction.
+def daemon_threaded(fn):
+ def wrapper(*args, **kwargs):
+ threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=True).start()
+ return wrapper
+
+
+
+
+class Plugin(PluginBase):
+ def __init__(self):
+ super().__init__()
+ self.path = os.path.dirname(os.path.realpath(__file__))
+ self._GLADE_FILE = f"{self.path}/archiver.glade"
+ self.name = "Archiver" # NOTE: Need to remove after establishing private bidirectional 1-1 message bus
+ # where self.name should not be needed for message comms
+ self._archiver_dialogue = None
+ self._arc_command_buffer = None
+
+ # In compress commands:
+ # %n: First selected filename/dir to archive
+ # %N: All selected filenames/dirs to archive, or (with %O) a single filename
+ # %o: Resulting single archive file
+ # %O: Resulting archive per source file/directory (use changes %N meaning)
+ #
+ # In extract commands:
+ # %x: Archive file to extract
+ # %g: Unique extraction target filename with optional subfolder
+ # %G: Unique extraction target filename, never with subfolder
+ #
+ # In list commands:
+ # %x: Archive to list
+ #
+ # Plus standard bash variables are accepted.
+ self.arc_commands = [ '$(which 7za || echo 7zr) a %o %N',
+ 'zip -r %o %N',
+ 'rar a -r %o %N',
+ 'tar -cvf %o %N',
+ 'tar -cvjf %o %N',
+ 'tar -cvzf %o %N',
+ 'tar -cvJf %o %N',
+ 'gzip -c %N > %O',
+ 'xz -cz %N > %O'
+ ]
+
+
+ def generate_reference_ui_element(self):
+ self._builder = Gtk.Builder()
+ self._builder.add_from_file(self._GLADE_FILE)
+
+ classes = [self]
+ handlers = {}
+ for c in classes:
+ methods = None
+ try:
+ methods = inspect.getmembers(c, predicate=inspect.ismethod)
+ handlers.update(methods)
+ except Exception as e:
+ print(repr(e))
+
+ self._builder.connect_signals(handlers)
+
+ self._archiver_dialogue = self._builder.get_object("archiver_dialogue")
+ self._arc_command_buffer = self._builder.get_object("arc_command_buffer")
+
+ button = Gtk.Button(label=self.name)
+ button.connect("button-release-event", self.show_archiver_dialogue)
+ return button
+
+ def run(self):
+ ...
+
+ def show_archiver_dialogue(self, widget=None, eve=None):
+ self._event_system.emit("get_current_state")
+ state = self._fm_state
+
+ self._archiver_dialogue.set_action(Gtk.FileChooserAction.SAVE)
+ self._archiver_dialogue.set_current_folder(state.tab.get_current_directory())
+ self._archiver_dialogue.set_current_name("arc.7z")
+
+ response = self._archiver_dialogue.run()
+ if response == Gtk.ResponseType.OK:
+ save_target = self._archiver_dialogue.get_filename()
+ self.archive_files(save_target, state)
+ if (response == Gtk.ResponseType.CANCEL) or (response == Gtk.ResponseType.DELETE_EVENT):
+ pass
+
+ self._archiver_dialogue.hide()
+
+ def archive_files(self, save_target, state):
+ paths = [shlex.quote(p) for p in state.selected_files]
+
+ sItr, eItr = self._arc_command_buffer.get_bounds()
+ pre_command = self._arc_command_buffer.get_text(sItr, eItr, False)
+ pre_command = pre_command.replace("%o", shlex.quote(save_target))
+ pre_command = pre_command.replace("%N", ' '.join(paths))
+ command = f"{state.tab.terminal_app} -e {shlex.quote(pre_command)}"
+ current_dir = state.tab.get_current_directory()
+
+ state.tab.execute(shlex.split(command), start_dir=shlex.quote(current_dir))
+
+ def set_arc_buffer_text(self, widget=None, eve=None):
+ sid = widget.get_active_id()
+ self.arc_command_buffer.set_text(self.arc_commands[int(sid)])
diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller.py
index 428edb4..22ab397 100644
--- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller.py
+++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller.py
@@ -128,8 +128,6 @@ class Controller(UIMixin, KeyboardSignalsMixin, IPCSignalsMixin, ExceptionHookMi
self.copy_files()
if action == "paste":
self.paste_files()
- if action == "archive":
- self.show_archiver_dialogue()
if action == "create":
self.create_files()
if action in ["save_session", "save_session_as", "load_session"]:
diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py
index 14524e0..112140b 100644
--- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py
+++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py
@@ -64,32 +64,6 @@ class Controller_Data:
self.trash_info_path = f"{GLib.get_user_data_dir()}/Trash/info"
self.icon_theme = settings.get_icon_theme()
- # In compress commands:
- # %n: First selected filename/dir to archive
- # %N: All selected filenames/dirs to archive, or (with %O) a single filename
- # %o: Resulting single archive file
- # %O: Resulting archive per source file/directory (use changes %N meaning)
- #
- # In extract commands:
- # %x: Archive file to extract
- # %g: Unique extraction target filename with optional subfolder
- # %G: Unique extraction target filename, never with subfolder
- #
- # In list commands:
- # %x: Archive to list
- #
- # Plus standard bash variables are accepted.
- self.arc_commands = [ '$(which 7za || echo 7zr) a %o %N',
- 'zip -r %o %N',
- 'rar a -r %o %N',
- 'tar -cvf %o %N',
- 'tar -cvjf %o %N',
- 'tar -cvzf %o %N',
- 'tar -cvJf %o %N',
- 'gzip -c %N > %O',
- 'xz -cz %N > %O'
- ]
-
self.notebooks = [self.window1, self.window2, self.window3, self.window4]
self.selected_files = []
self.to_copy_files = []
diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/exception_hook_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/exception_hook_mixin.py
index 660b9b6..4ec0b0a 100644
--- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/exception_hook_mixin.py
+++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/exception_hook_mixin.py
@@ -51,8 +51,3 @@ class ExceptionHookMixin:
f.write(text)
save_location_prompt.destroy()
-
-
- def set_arc_buffer_text(self, widget=None, eve=None):
- sid = widget.get_active_id()
- self.arc_command_buffer.set_text(self.arc_commands[int(sid)])
diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/show_hide_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/show_hide_mixin.py
index 331c6ef..8377158 100644
--- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/show_hide_mixin.py
+++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/show_hide_mixin.py
@@ -55,26 +55,6 @@ class ShowHideMixin:
self.builder.get_object("about_page").hide()
- def show_archiver_dialogue(self, widget=None, eve=None):
- wid, tid = self.fm_controller.get_active_wid_and_tid()
- tab = self.get_fm_window(wid).get_tab_by_id(tid)
- archiver_dialogue = self.builder.get_object("archiver_dialogue")
- archiver_dialogue.set_action(Gtk.FileChooserAction.SAVE)
- archiver_dialogue.set_current_folder(tab.get_current_directory())
- archiver_dialogue.set_current_name("arc.7z")
-
- response = archiver_dialogue.run()
- if response == Gtk.ResponseType.OK:
- self.archive_files(archiver_dialogue)
- if (response == Gtk.ResponseType.CANCEL) or (response == Gtk.ResponseType.DELETE_EVENT):
- pass
-
- archiver_dialogue.hide()
-
- def hide_archiver_dialogue(self, widget=None, eve=None):
- self.builder.get_object("archiver_dialogue").hide()
-
-
def show_appchooser_menu(self, widget=None, eve=None):
appchooser_menu = self.builder.get_object("appchooser_menu")
appchooser_widget = self.builder.get_object("appchooser_widget")
diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/widget_file_action_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/widget_file_action_mixin.py
index e680801..04f8400 100644
--- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/widget_file_action_mixin.py
+++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/widget_file_action_mixin.py
@@ -143,19 +143,6 @@ class WidgetFileActionMixin:
command = f"{shlex.quote(path)}" if not in_terminal else f"{state.tab.terminal_app} -e {shlex.quote(path)}"
state.tab.execute(shlex.split(command), start_dir=state.tab.get_current_directory())
- def archive_files(self, archiver_dialogue):
- state = self.get_current_state()
- paths = [shlex.quote(p) for p in self.format_to_uris(state.store, state.wid, state.tid, self.selected_files, True)]
-
- save_target = archiver_dialogue.get_filename();
- sItr, eItr = self.arc_command_buffer.get_bounds()
- pre_command = self.arc_command_buffer.get_text(sItr, eItr, False)
- pre_command = pre_command.replace("%o", shlex.quote(save_target))
- pre_command = pre_command.replace("%N", ' '.join(paths))
- command = f"{state.tab.terminal_app} -e {shlex.quote(pre_command)}"
-
- state.tab.execute(shlex.split(command), start_dir=shlex.quote(state.tab.get_current_directory()))
-
def rename_files(self):
rename_label = self.builder.get_object("file_to_rename_label")
rename_input = self.builder.get_object("new_rename_fname")
diff --git a/user_config/usr/share/solarfm/Main_Window.glade b/user_config/usr/share/solarfm/Main_Window.glade
index 2343d0c..d102e67 100644
--- a/user_config/usr/share/solarfm/Main_Window.glade
+++ b/user_config/usr/share/solarfm/Main_Window.glade
@@ -452,170 +452,6 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
appchooser_select_btn
-
- $(which 7za || echo 7zr) a %o %N
-
-
- False
- True
- center
- dialog
- center
- True
- True
-
-
- False
- vertical
- 2
-
-
- False
- end
-
-
- gtk-cancel
- True
- True
- True
- True
-
-
- True
- True
- 0
-
-
-
-
- gtk-ok
- True
- True
- True
- True
-
-
- True
- True
- 1
-
-
-
-
- False
- False
- 0
-
-
-
-
- True
- False
- vertical
-
-
- True
- False
- True
-
-
- True
- False
- Compress Commands:
- 0.20000000298023224
-
-
-
-
-
- False
- True
- 0
-
-
-
-
-
-
-
- True
- False
- Archive Format:
- 1
-
-
-
-
-
- False
- True
- 2
-
-
-
-
- True
- False
- 0
- 0
-
- - 7Zip (*.7z)
- - Zip (*.zip *.ZIP)
- - RAR (*.rar *.RAR)
- - Tar (*.tar)
- - Tar bzip2 (*.tar.bz2)
- - Tar Gzip (*.tar.gz *.tgz)
- - Tar xz (*.tar.xz *.txz)
- - Gzip (*.gz)
- - XZ (*.xz)
-
-
-
-
- False
- True
- 3
-
-
-
-
- False
- True
- 0
-
-
-
-
- 72
- True
- True
- arc_command_buffer
-
-
- True
- True
- 1
-
-
-
-
- False
- True
- 2
-
-
-
-
-
- button21
- button22
-
-
-
- True
- False
- gtk-save-as
-
True
False
@@ -912,7 +748,6 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
True
True
Archive...
- archive_img
True