Refactored externalized widgets, cleanup and subtle bug fixes
This commit is contained in:
parent
8ed011ab8c
commit
0d01030be3
@ -97,7 +97,6 @@ class Plugin(PluginBase):
|
||||
self.empty.hide()
|
||||
|
||||
def delete_files(self, widget = None, eve = None):
|
||||
self._event_system.emit("do_hide_context_menu")
|
||||
self._event_system.emit("get_current_state")
|
||||
state = self._fm_state
|
||||
uris = state.selected_files
|
||||
@ -121,23 +120,19 @@ class Plugin(PluginBase):
|
||||
break
|
||||
|
||||
def trash_files(self, widget = None, eve = None, verbocity = False):
|
||||
self._event_system.emit("do_hide_context_menu")
|
||||
self._event_system.emit("get_current_state")
|
||||
state = self._fm_state
|
||||
for uri in state.selected_files:
|
||||
self.trashman.trash(uri, verbocity)
|
||||
|
||||
def restore_trash_files(self, widget = None, eve = None, verbocity = False):
|
||||
self._event_system.emit("do_hide_context_menu")
|
||||
self._event_system.emit("get_current_state")
|
||||
state = self._fm_state
|
||||
for uri in state.selected_files:
|
||||
self.trashman.restore(filename=uri.split("/")[-1], verbose = verbocity)
|
||||
|
||||
def empty_trash(self, widget = None, eve = None, verbocity = False):
|
||||
self._event_system.emit("do_hide_context_menu")
|
||||
self.trashman.empty(verbose = verbocity)
|
||||
|
||||
def go_to_trash(self, widget = None, eve = None, verbocity = False):
|
||||
self._event_system.emit("do_hide_context_menu")
|
||||
self._event_system.emit("go_to_path", self.trash_files_path)
|
||||
|
@ -38,7 +38,6 @@ class Controller(UI, SignalsMixins, Controller_Data):
|
||||
event_system.subscribe("get_current_state", self.get_current_state)
|
||||
event_system.subscribe("display_message", self.display_message)
|
||||
event_system.subscribe("go_to_path", self.go_to_path)
|
||||
event_system.subscribe("do_hide_context_menu", self.do_hide_context_menu)
|
||||
event_system.subscribe("do_action_from_menu_controls", self.do_action_from_menu_controls)
|
||||
|
||||
def tear_down(self, widget=None, eve=None):
|
||||
@ -104,9 +103,9 @@ class Controller(UI, SignalsMixins, Controller_Data):
|
||||
else:
|
||||
action = widget
|
||||
|
||||
self.hide_context_menu()
|
||||
self.hide_new_file_menu()
|
||||
event_system.emit("do_hide_edit_file_menu")
|
||||
event_system.emit("hide_context_menu")
|
||||
event_system.emit("hide_new_file_menu")
|
||||
event_system.emit("hide_rename_file_menu")
|
||||
|
||||
if action == "open":
|
||||
self.open_files()
|
||||
@ -161,6 +160,3 @@ class Controller(UI, SignalsMixins, Controller_Data):
|
||||
|
||||
def go_to_path(self, path):
|
||||
self.path_entry.set_text(path)
|
||||
|
||||
def do_hide_context_menu(self):
|
||||
self.hide_context_menu()
|
||||
|
@ -12,6 +12,7 @@ from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
|
||||
# Application imports
|
||||
from widgets.new_file_widget import NewFileWidget
|
||||
from widgets.rename_widget import RenameWidget
|
||||
from widgets.file_exists_widget import FileExistsWidget
|
||||
from widgets.context_menu_widget import ContextMenuWidget
|
||||
@ -41,6 +42,7 @@ class Controller_Data:
|
||||
self.builder = settings.get_builder()
|
||||
self.keybindings = settings.get_keybindings()
|
||||
|
||||
NewFileWidget()
|
||||
RenameWidget()
|
||||
FileExistsWidget()
|
||||
ContextMenuWidget()
|
||||
@ -61,11 +63,6 @@ class Controller_Data:
|
||||
|
||||
self.exists_file_rename_bttn = self.builder.get_object("exists_file_rename_bttn")
|
||||
self.warning_alert = self.builder.get_object("warning_alert")
|
||||
self.new_file_menu = self.builder.get_object("new_file_menu")
|
||||
self.edit_file_menu = self.builder.get_object("edit_file_menu")
|
||||
self.file_exists_dialog = self.builder.get_object("file_exists_dialog")
|
||||
self.exists_file_label = self.builder.get_object("exists_file_label")
|
||||
self.exists_file_field = self.builder.get_object("exists_file_field")
|
||||
self.path_menu = self.builder.get_object("path_menu")
|
||||
self.path_entry = self.builder.get_object("path_entry")
|
||||
|
||||
@ -92,9 +89,6 @@ class Controller_Data:
|
||||
|
||||
self.override_drop_dest = None
|
||||
|
||||
self.cancel_creation = False
|
||||
self.skip_edit = False
|
||||
self.cancel_edit = False
|
||||
self.ctrl_down = False
|
||||
self.shift_down = False
|
||||
self.alt_down = False
|
||||
|
@ -3,9 +3,7 @@
|
||||
# Gtk imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
gi.require_version('Gdk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
|
||||
# Application imports
|
||||
|
||||
@ -54,44 +52,5 @@ class ShowHideMixin:
|
||||
def hide_plugins_popup(self, widget=None, eve=None):
|
||||
self.builder.get_object("plugin_controls").hide()
|
||||
|
||||
def show_context_menu(self, widget=None, eve=None):
|
||||
self.builder.get_object("context_menu").popup_at_pointer(None)
|
||||
|
||||
def hide_context_menu(self, widget=None, eve=None):
|
||||
self.builder.get_object("context_menu").popdown()
|
||||
|
||||
def show_new_file_menu(self, widget=None, eve=None):
|
||||
if widget:
|
||||
widget.set_text("")
|
||||
widget.grab_focus()
|
||||
|
||||
response = self.new_file_menu.run()
|
||||
if response == Gtk.ResponseType.CANCEL:
|
||||
self.cancel_creation = True
|
||||
|
||||
def hide_new_file_menu(self, widget=None, eve=None):
|
||||
self.builder.get_object("new_file_menu").hide()
|
||||
|
||||
def hide_new_file_menu_enter_key(self, widget=None, eve=None):
|
||||
keyname = Gdk.keyval_name(eve.keyval).lower()
|
||||
if keyname in ["return", "enter"]:
|
||||
self.builder.get_object("new_file_menu").hide()
|
||||
|
||||
def show_edit_file_menu(self, widget=None, eve=None):
|
||||
if widget:
|
||||
widget.grab_focus()
|
||||
|
||||
response = self.edit_file_menu.run()
|
||||
if response == Gtk.ResponseType.CLOSE:
|
||||
self.skip_edit = True
|
||||
if response == Gtk.ResponseType.CANCEL:
|
||||
self.cancel_edit = True
|
||||
|
||||
def show_io_popup(self, widget=None, eve=None):
|
||||
self.builder.get_object("io_popup").popup()
|
||||
|
||||
def hide_edit_file_menu_skip(self, widget=None, eve=None):
|
||||
self.edit_file_menu.response(Gtk.ResponseType.CLOSE)
|
||||
|
||||
def hide_edit_file_menu_cancel(self, widget=None, eve=None):
|
||||
self.edit_file_menu.response(Gtk.ResponseType.CANCEL)
|
||||
|
@ -21,7 +21,7 @@ class FileActionSignalsMixin:
|
||||
"""docstring for FileActionSignalsMixin"""
|
||||
|
||||
def get_dir_size(self, sdir):
|
||||
"""Get the size of a directory. Based on code found online."""
|
||||
"""Get the size of a directory. Based on code found online."""
|
||||
size = os.path.getsize(sdir)
|
||||
|
||||
for item in os.listdir(sdir):
|
||||
@ -147,7 +147,7 @@ class FileActionSignalsMixin:
|
||||
|
||||
def rename_files(self):
|
||||
rename_label = self.builder.get_object("file_to_rename_label")
|
||||
rename_input = self.builder.get_object("new_rename_fname")
|
||||
rename_input = self.builder.get_object("rename_fname")
|
||||
state = self.get_current_state()
|
||||
uris = self.format_to_uris(state.store, state.wid, state.tid, self.selected_files, True)
|
||||
|
||||
@ -156,23 +156,18 @@ class FileActionSignalsMixin:
|
||||
rename_label.set_label(entry)
|
||||
rename_input.set_text(entry)
|
||||
|
||||
self.show_edit_file_menu(rename_input)
|
||||
|
||||
if self.skip_edit:
|
||||
self.skip_edit = False
|
||||
response = event_system.emit_and_await("show_rename_file_menu", rename_input)
|
||||
if response == "skip_edit":
|
||||
continue
|
||||
if self.cancel_edit:
|
||||
self.cancel_edit = False
|
||||
if response == "cancel_edit":
|
||||
break
|
||||
|
||||
rname_to = rename_input.get_text().strip()
|
||||
target = f"{state.tab.get_current_directory()}/{rname_to}"
|
||||
self.handle_files([uri], "rename", target)
|
||||
if rname_to:
|
||||
target = f"{state.tab.get_current_directory()}/{rname_to}"
|
||||
self.handle_files([uri], "rename", target)
|
||||
|
||||
|
||||
self.skip_edit = False
|
||||
self.cancel_edit = False
|
||||
event_system.emit("do_hide_edit_file_menu")
|
||||
event_system.emit("hide_rename_file_menu")
|
||||
self.selected_files.clear()
|
||||
|
||||
def cut_files(self):
|
||||
@ -205,15 +200,15 @@ class FileActionSignalsMixin:
|
||||
self.handle_files(self.to_cut_files, "move", target)
|
||||
|
||||
def create_files(self):
|
||||
fname_field = self.builder.get_object("new_fname_field")
|
||||
self.show_new_file_menu(fname_field)
|
||||
fname_field = self.builder.get_object("new_fname_field")
|
||||
cancel_creation = event_system.emit_and_await("show_new_file_menu", fname_field)
|
||||
|
||||
if self.cancel_creation:
|
||||
self.cancel_creation = False
|
||||
if cancel_creation:
|
||||
event_system.emit("hide_new_file_menu")
|
||||
return
|
||||
|
||||
file_name = fname_field.get_text().strip()
|
||||
type = self.builder.get_object("context_menu_type_toggle").get_state()
|
||||
type = self.builder.get_object("new_file_toggle_type").get_state()
|
||||
|
||||
wid, tid = self.fm_controller.get_active_wid_and_tid()
|
||||
tab = self.get_fm_window(wid).get_tab_by_id(tid)
|
||||
@ -227,8 +222,7 @@ class FileActionSignalsMixin:
|
||||
else: # Create Folder
|
||||
self.handle_files([path], "create_dir")
|
||||
|
||||
self.cancel_creation = False
|
||||
self.hide_new_file_menu()
|
||||
event_system.emit("hide_new_file_menu")
|
||||
|
||||
|
||||
def move_files(self, files, target):
|
||||
@ -277,7 +271,7 @@ class FileActionSignalsMixin:
|
||||
|
||||
if response == "rename":
|
||||
base_path = _file.get_parent().get_path()
|
||||
new_name = self.exists_file_field.get_text().strip()
|
||||
new_name = self.builder.get_object("exists_file_field").get_text().strip()
|
||||
rfPath = f"{base_path}/{new_name}"
|
||||
_file = Gio.File.new_for_path(rfPath)
|
||||
|
||||
|
@ -201,7 +201,7 @@ class WindowMixin(TabMixin):
|
||||
if self.single_click_open: # FIXME: need to find a way to pass the model index
|
||||
self.grid_icon_double_click(icons_grid)
|
||||
elif eve.type == Gdk.EventType.BUTTON_RELEASE and eve.button == 3: # r-click
|
||||
self.show_context_menu()
|
||||
event_system.emit("show_context_menu")
|
||||
|
||||
except WindowException as e:
|
||||
print(repr(e))
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Python imports
|
||||
import inspect
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
|
||||
# Application imports
|
||||
|
||||
@ -14,10 +14,36 @@ class ContextMenuWidget(Gtk.Menu):
|
||||
|
||||
def __init__(self):
|
||||
super(ContextMenuWidget, self).__init__()
|
||||
self._builder = settings.get_builder()
|
||||
self.builder = settings.get_builder()
|
||||
self._builder = Gtk.Builder()
|
||||
self._context_menu_data = settings.get_context_menu_data()
|
||||
self._window = settings.get_main_window()
|
||||
|
||||
self._setup_styling()
|
||||
self._setup_signals()
|
||||
self._load_widgets()
|
||||
|
||||
|
||||
def _setup_styling(self):
|
||||
...
|
||||
|
||||
def _setup_signals(self):
|
||||
event_system.subscribe("show_context_menu", self.show_context_menu)
|
||||
event_system.subscribe("hide_context_menu", self.hide_context_menu)
|
||||
|
||||
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)
|
||||
|
||||
def _load_widgets(self):
|
||||
self.build_context_menu()
|
||||
|
||||
|
||||
@ -62,9 +88,15 @@ class ContextMenuWidget(Gtk.Menu):
|
||||
|
||||
self.attach_to_widget(self._window, None)
|
||||
self.show_all()
|
||||
self._builder.expose_object("context_menu", self)
|
||||
self.builder.expose_object("context_menu", self)
|
||||
if plugins_entry:
|
||||
self._builder.expose_object("context_menu_plugins", plugins_entry.get_submenu())
|
||||
self.builder.expose_object("context_menu_plugins", plugins_entry.get_submenu())
|
||||
|
||||
def _emit(self, menu_item, type):
|
||||
event_system.emit("do_action_from_menu_controls", type)
|
||||
|
||||
def show_context_menu(self, widget=None, eve=None):
|
||||
self.builder.get_object("context_menu").popup_at_pointer(None)
|
||||
|
||||
def hide_context_menu(self, widget=None, eve=None):
|
||||
self.builder.get_object("context_menu").popdown()
|
||||
|
@ -0,0 +1,76 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
import inspect
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
gi.require_version('Gdk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
class NewFileWidget:
|
||||
"""docstring for NewFileWidget."""
|
||||
|
||||
def __init__(self):
|
||||
super(NewFileWidget, self).__init__()
|
||||
_GLADE_FILE = f"{settings.get_ui_widgets_path()}/new_file_ui.glade"
|
||||
builder = settings.get_builder()
|
||||
self._builder = Gtk.Builder()
|
||||
|
||||
self._builder.add_from_file(_GLADE_FILE)
|
||||
self._new_file_menu = self._builder.get_object("new_file_menu")
|
||||
self._new_fname_field = self._builder.get_object("new_fname_field")
|
||||
self._new_file_toggle_type = self._builder.get_object("new_file_toggle_type")
|
||||
|
||||
builder.expose_object(f"new_file_menu", self._new_file_menu)
|
||||
builder.expose_object(f"new_fname_field", self._new_fname_field)
|
||||
builder.expose_object(f"new_file_toggle_type", self._new_file_toggle_type)
|
||||
|
||||
self._setup_styling()
|
||||
self._setup_signals()
|
||||
self._load_widgets()
|
||||
|
||||
|
||||
def _setup_styling(self):
|
||||
...
|
||||
|
||||
def _setup_signals(self):
|
||||
event_system.subscribe("show_new_file_menu", self.show_new_file_menu)
|
||||
event_system.subscribe("hide_new_file_menu", self.hide_new_file_menu)
|
||||
|
||||
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)
|
||||
|
||||
def _load_widgets(self):
|
||||
...
|
||||
|
||||
def show_new_file_menu(self, widget=None, eve=None):
|
||||
if widget:
|
||||
widget.set_text("")
|
||||
widget.grab_focus()
|
||||
|
||||
response = self._new_file_menu.run()
|
||||
if response == Gtk.ResponseType.CANCEL:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def hide_new_file_menu(self, widget=None, eve=None):
|
||||
self._builder.get_object("new_file_menu").hide()
|
||||
|
||||
def hide_new_file_menu_enter_key(self, widget=None, eve=None):
|
||||
keyname = Gdk.keyval_name(eve.keyval).lower()
|
||||
if keyname in ["return", "enter"]:
|
||||
self._new_file_menu.hide()
|
@ -21,13 +21,13 @@ class RenameWidget:
|
||||
self._builder = Gtk.Builder()
|
||||
|
||||
self._builder.add_from_file(_GLADE_FILE)
|
||||
edit_file_menu = self._builder.get_object("edit_file_menu")
|
||||
new_rename_fname = self._builder.get_object("new_rename_fname")
|
||||
file_to_rename_label = self._builder.get_object("file_to_rename_label")
|
||||
self._rename_file_menu = self._builder.get_object("rename_file_menu")
|
||||
self._rename_fname = self._builder.get_object("rename_fname")
|
||||
self._file_to_rename_label = self._builder.get_object("file_to_rename_label")
|
||||
|
||||
builder.expose_object(f"edit_file_menu", edit_file_menu)
|
||||
builder.expose_object(f"new_rename_fname", new_rename_fname)
|
||||
builder.expose_object(f"file_to_rename_label", file_to_rename_label)
|
||||
builder.expose_object(f"rename_file_menu", self._rename_file_menu)
|
||||
builder.expose_object(f"rename_fname", self._rename_fname)
|
||||
builder.expose_object(f"file_to_rename_label", self._file_to_rename_label)
|
||||
|
||||
self._setup_styling()
|
||||
self._setup_signals()
|
||||
@ -38,7 +38,8 @@ class RenameWidget:
|
||||
...
|
||||
|
||||
def _setup_signals(self):
|
||||
event_system.subscribe("do_hide_edit_file_menu", self.hide_edit_file_menu)
|
||||
event_system.subscribe("show_rename_file_menu", self.show_rename_file_menu)
|
||||
event_system.subscribe("hide_rename_file_menu", self.hide_rename_file_menu)
|
||||
|
||||
classes = [self]
|
||||
handlers = {}
|
||||
@ -55,26 +56,35 @@ class RenameWidget:
|
||||
def _load_widgets(self):
|
||||
...
|
||||
|
||||
def show_rename_file_menu(self, widget=None, eve=None):
|
||||
if widget:
|
||||
widget.grab_focus()
|
||||
|
||||
response = self._rename_file_menu.run()
|
||||
if response == Gtk.ResponseType.CLOSE:
|
||||
return "skip_edit"
|
||||
if response == Gtk.ResponseType.CANCEL:
|
||||
return "cancel_edit"
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def set_to_title_case(self, widget, eve=None):
|
||||
rename_widget = self._builder.get_object("new_rename_fname")
|
||||
rename_widget.set_text( rename_widget.get_text().title() )
|
||||
self._rename_fname.set_text( self._rename_fname.get_text().title() )
|
||||
|
||||
def set_to_upper_case(self, widget, eve=None):
|
||||
rename_widget = self._builder.get_object("new_rename_fname")
|
||||
rename_widget.set_text( rename_widget.get_text().upper() )
|
||||
self._rename_fname.set_text( self._rename_fname.get_text().upper() )
|
||||
|
||||
def set_to_lower_case(self, widget, eve=None):
|
||||
rename_widget = self._builder.get_object("new_rename_fname")
|
||||
rename_widget.set_text( rename_widget.get_text().lower() )
|
||||
self._rename_fname.set_text( self._rename_fname.get_text().lower() )
|
||||
|
||||
def set_to_invert_case(self, widget, eve=None):
|
||||
rename_widget = self._builder.get_object("new_rename_fname")
|
||||
rename_widget.set_text( rename_widget.get_text().swapcase() )
|
||||
self._rename_fname.set_text( self._rename_fname.get_text().swapcase() )
|
||||
|
||||
def hide_edit_file_menu(self, widget=None, eve=None):
|
||||
self._builder.get_object("edit_file_menu").hide()
|
||||
def hide_rename_file_menu(self, widget=None, eve=None):
|
||||
self._rename_file_menu.hide()
|
||||
|
||||
def hide_edit_file_menu_enter_key(self, widget=None, eve=None):
|
||||
def hide_rename_file_menu_enter_key(self, widget=None, eve=None):
|
||||
keyname = Gdk.keyval_name(eve.keyval).lower()
|
||||
if keyname in ["return", "enter"]:
|
||||
self._builder.get_object("edit_file_menu").hide()
|
||||
self._rename_file_menu.hide()
|
||||
|
@ -452,11 +452,6 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
|
||||
<action-widget response="-5">appchooser_select_btn</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkImage" id="create_img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
@ -1424,183 +1419,6 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkDialog" id="new_file_menu">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window-position">center-always</property>
|
||||
<property name="destroy-with-parent">True</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="skip-taskbar-hint">True</property>
|
||||
<property name="skip-pager-hint">True</property>
|
||||
<property name="decorated">False</property>
|
||||
<property name="deletable">False</property>
|
||||
<property name="gravity">center</property>
|
||||
<property name="attached-to">main_window</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button9">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button10">
|
||||
<property name="label" translatable="yes">Create</property>
|
||||
<property name="name">create</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Create File/Folder...</property>
|
||||
<property name="image">create_img</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="new_fname_field">
|
||||
<property name="width-request">500</property>
|
||||
<property name="height-request">26</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="has-focus">True</property>
|
||||
<property name="tooltip-text" translatable="yes">New File/Dir Name...</property>
|
||||
<property name="activates-default">True</property>
|
||||
<property name="primary-icon-stock">gtk-edit</property>
|
||||
<property name="primary-icon-activatable">False</property>
|
||||
<property name="secondary-icon-activatable">False</property>
|
||||
<property name="primary-icon-sensitive">False</property>
|
||||
<property name="secondary-icon-sensitive">False</property>
|
||||
<property name="placeholder-text" translatable="yes">New File/Dir Name...</property>
|
||||
<signal name="key-release-event" handler="hide_new_file_menu_enter_key" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="menuButtonBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="label" translatable="yes">Folder</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="12000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="label" translatable="yes">File</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="12000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="context_menu_type_toggle">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="tooltip-text" translatable="yes">File/Folder</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">button9</action-widget>
|
||||
<action-widget response="-10">button10</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkPopover" id="path_menu">
|
||||
<property name="width-request">240</property>
|
||||
<property name="height-request">420</property>
|
||||
|
@ -6,11 +6,12 @@
|
||||
"Execute in Terminal": ["STOCK_EXECUTE", "execute_in_terminal"]
|
||||
},
|
||||
"File Actions": {
|
||||
"New": ["STOCK_ADD", "create"],
|
||||
"Rename": ["STOCK_EDIT", "rename"],
|
||||
"Cut": ["STOCK_CUT", "cut"],
|
||||
"Copy": ["STOCK_COPY", "copy"],
|
||||
"Paste": ["STOCK_PASTE", "paste"]
|
||||
"New": ["STOCK_ADD", "create"],
|
||||
"Rename": ["STOCK_EDIT", "rename"],
|
||||
"Cut": ["STOCK_CUT", "cut"],
|
||||
"Copy": ["STOCK_COPY", "copy"],
|
||||
"Copy Name": ["STOCK_COPY", "copy_name"],
|
||||
"Paste": ["STOCK_PASTE", "paste"]
|
||||
},
|
||||
"Plugins": {}
|
||||
}
|
||||
|
186
user_config/usr/share/solarfm/ui_widgets/new_file_ui.glade
Normal file
186
user_config/usr/share/solarfm/ui_widgets/new_file_ui.glade
Normal file
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkImage" id="create_img">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="new_file_menu">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window-position">center-always</property>
|
||||
<property name="destroy-with-parent">True</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<property name="skip-taskbar-hint">True</property>
|
||||
<property name="skip-pager-hint">True</property>
|
||||
<property name="decorated">False</property>
|
||||
<property name="deletable">False</property>
|
||||
<property name="gravity">center</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">5</property>
|
||||
<property name="margin-right">5</property>
|
||||
<property name="margin-top">5</property>
|
||||
<property name="margin-bottom">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button9">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button10">
|
||||
<property name="label" translatable="yes">Create</property>
|
||||
<property name="name">create</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="tooltip-text" translatable="yes">Create File/Folder...</property>
|
||||
<property name="image">create_img</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="new_fname_field">
|
||||
<property name="width-request">500</property>
|
||||
<property name="height-request">26</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="has-focus">True</property>
|
||||
<property name="tooltip-text" translatable="yes">New File/Dir Name...</property>
|
||||
<property name="activates-default">True</property>
|
||||
<property name="primary-icon-stock">gtk-edit</property>
|
||||
<property name="primary-icon-activatable">False</property>
|
||||
<property name="secondary-icon-activatable">False</property>
|
||||
<property name="primary-icon-sensitive">False</property>
|
||||
<property name="secondary-icon-sensitive">False</property>
|
||||
<property name="placeholder-text" translatable="yes">New File/Dir Name...</property>
|
||||
<signal name="key-release-event" handler="hide_new_file_menu_enter_key" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="menuButtonBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="label" translatable="yes">Folder</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="12000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">15</property>
|
||||
<property name="label" translatable="yes">File</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="12000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="new_file_toggle_type">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="tooltip-text" translatable="yes">File/Folder</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">button9</action-widget>
|
||||
<action-widget response="-10">button10</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
@ -13,7 +13,7 @@
|
||||
<property name="can-focus">False</property>
|
||||
<property name="stock">gtk-media-forward</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="edit_file_menu">
|
||||
<object class="GtkDialog" id="rename_file_menu">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
@ -116,7 +116,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="new_rename_fname">
|
||||
<object class="GtkEntry" id="rename_fname">
|
||||
<property name="width-request">500</property>
|
||||
<property name="height-request">26</property>
|
||||
<property name="visible">True</property>
|
||||
@ -130,7 +130,7 @@
|
||||
<property name="primary-icon-sensitive">False</property>
|
||||
<property name="secondary-icon-sensitive">False</property>
|
||||
<property name="placeholder-text" translatable="yes">To:</property>
|
||||
<signal name="key-release-event" handler="hide_edit_file_menu_enter_key" swapped="no"/>
|
||||
<signal name="key-release-event" handler="hide_rename_file_menu_enter_key" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -216,7 +216,7 @@
|
||||
<property name="receives-default">True</property>
|
||||
<property name="image">rename_img</property>
|
||||
<property name="always-show-image">True</property>
|
||||
<signal name="button-release-event" handler="hide_edit_file_menu" swapped="no"/>
|
||||
<signal name="button-release-event" handler="hide_rename_file_menu" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
Loading…
Reference in New Issue
Block a user