diff --git a/src/pytop-0.0.1/Pytop/Controller.py b/src/pytop-0.0.1/Pytop/Controller.py index 268464e..ec48d7c 100644 --- a/src/pytop-0.0.1/Pytop/Controller.py +++ b/src/pytop-0.0.1/Pytop/Controller.py @@ -31,19 +31,13 @@ class Controller: newPath = widget.get_filename() Grid(self.desktop, self.settings, newPath) - def getWindowsOnScreen(self): screen = self.settings.returnScren() windowButtons = self.builder.get_object("windowButtons") - - - - - - - + def closePopup(self, widget, data=None): + widget.hide() # File control events @@ -69,6 +63,7 @@ class Controller: def pasteFile(self): pass + # Webview events def showWebview(self, widget): self.builder.get_object("webViewer").popup() diff --git a/src/pytop-0.0.1/Pytop/resources/PyTop.glade b/src/pytop-0.0.1/Pytop/resources/PyTop.glade index c0deab2..cf5c498 100644 --- a/src/pytop-0.0.1/Pytop/resources/PyTop.glade +++ b/src/pytop-0.0.1/Pytop/resources/PyTop.glade @@ -8,132 +8,15 @@ inode/directory - - True + False - Show Mini Webbrowser - gtk-go-down - 3 - - - False - 800 - 600 - desktop + False + True False - center + - - - 256 - True - False - vertical - - - True - False - - - True - True - True - webDropDown - True - - - - False - True - 0 - - - - - True - False - select-folder - Folders - Directory Chooser - - - - False - True - 1 - - - - - True - True - edit-find-symbolic - False - False - - - True - True - 2 - - - - - False - True - 0 - - - - - True - True - in - - - True - False - - - True - True - 6 - multiple - 6 - - - - - - - True - True - 1 - - - - - True - False - - - - - - False - True - 2 - - - - - - - False - popOutBttn - bottom True @@ -229,6 +112,132 @@ + + True + False + Show Mini Webbrowser + gtk-go-down + 3 + + + False + 800 + 600 + desktop + False + center + + + + + + 256 + True + False + vertical + + + True + False + + + True + True + True + webDropDown + True + + + + False + True + 0 + + + + + True + False + select-folder + Folders + Directory Chooser + + + + False + True + 1 + + + + + True + True + edit-find-symbolic + False + False + + + True + True + 2 + + + + + True + True + False + True + none + False + + + + + + False + True + 3 + + + + + False + True + 0 + + + + + True + True + in + + + True + False + + + True + True + 6 + multiple + 6 + + + + + + + True + True + 1 + + + + + False True diff --git a/src/pytop-0.0.1/Pytop/widgets/Grid.py b/src/pytop-0.0.1/Pytop/widgets/Grid.py index ad5abdd..4e2c5c4 100644 --- a/src/pytop-0.0.1/Pytop/widgets/Grid.py +++ b/src/pytop-0.0.1/Pytop/widgets/Grid.py @@ -140,6 +140,7 @@ class Grid: # print(data) def iconLeftClickEventManager(self, widget, item): + print(item) try: model = widget.get_model() fileName = model[item][1] @@ -160,27 +161,33 @@ class Grid: except Exception as e: print(e) - def iconRightClickEventManager(self, widget, eve, params): + def iconRightClickEventManager(self, widget, eve, rclicked_icon): try: if eve.type == gdk.EventType.BUTTON_PRESS and eve.button == 3: - popover = self.builder.get_object("iconControlsWindow") - popover.show_all() - popover.popup() - # # NOTE: Need to change name of listview box... - # children = widget.get_children()[0].get_children() - # fileName = children[1].get_text() - # dir = self.currentPath - # file = dir + "/" + fileName - # - # input = self.builder.get_object("iconRenameInput") - # popover = self.builder.get_object("iconControlsWindow") - # self.selectedFile = file # Used for return to caller - # - # input.set_text(fileName) - # popover.set_relative_to(widget) - # popover.set_position(gtk.PositionType.RIGHT) - # popover.show_all() - # popover.popup() + input = self.builder.get_object("iconRenameInput") + controls = self.builder.get_object("iconControlsWindow") + items = widget.get_selected_items() + model = widget.get_model() + + if len(items) == 1: + fileName = model[items[0]][1] + dir = self.currentPath + file = dir + "/" + fileName + + self.selectedFile = file # Used for return to caller + input.set_text(fileName) + controls.show_all() + if len(items) > 1: + dir = self.currentPath + for item in items: + fileName = model[item][1] + file = dir + "/" + fileName + print(file) + + input.set_text("") + input.hide() + controls.show() + except Exception as e: print(e)