Explorar o código

Delete old resource-browser

Daniele Bartolini %!s(int64=12) %!d(string=hai) anos
pai
achega
c07833156a

+ 0 - 6
tools/gui/resource-browser/CMakeLists.txt

@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-install (FILES resource-browser.py PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
-	GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION tools)
-
-install (FILES ui/resource-browser.glade DESTINATION tools/ui)

+ 0 - 134
tools/gui/resource-browser/resource-browser.py

@@ -1,134 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-# Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following
-# conditions:
-# 
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-
-import sys
-import os
-from gi.repository import Gtk
-
-from pycrown import Repository
-
-class ResourceBrowser:
-	def __init__(self, repository):
-		self.m_repository = repository
-
-		builder = Gtk.Builder()
-		builder.add_from_file("ui/resource-browser.glade")
-
-		self.m_filter_entry = builder.get_object("entry1")
-		self.m_list_store = builder.get_object("liststore1")
-
-		self.m_list_view = builder.get_object("treeview1")
-
-		self.m_window = builder.get_object("window1")
-		self.m_window.set_title(repository.root_path())
-
-		renderer = Gtk.CellRendererText()
-		column = Gtk.TreeViewColumn("Name", renderer, text=0)
-		self.m_list_view.append_column(column)
-
-		# Populate list model
-		self.update_list_model()
-
-		self.m_list_filter = self.m_list_store.filter_new()
-		self.m_list_filter.set_visible_func(self.visible_func)
-
-		self.m_list_view.set_model(self.m_list_filter)
-
-		builder.connect_signals(self)
-
-		self.m_window.show_all()
-
-		Gtk.main()
-
-	# Callback
-	def on_delete(self, *args):
-		Gtk.main_quit(*args)
-
-	def update_list_model(self):
-		self.m_repository.scan()
-
-		self.m_list_store.clear()
-
-		for res in self.m_repository.all_resources():
-			self.m_list_store.append([res])
-
-	# Refresh the repository contents
-	def on_update_button_clicked(self, button):
-		self.update_list_model()
-
-	# We call refilter whenever the user types into the filter entry
-	def on_filter_entry_text_changed(self, entry):
-		self.m_list_filter.refilter()
-
-	# The callback used to filter resources in the list view
-	def visible_func(self, model, iter, user_data):
-		name = str(model.get_value(iter, 0))
-
-		# Strip leading and trailing spaces
-		search_text = self.m_filter_entry.get_text().strip()
-
-		# Make the find case-insensitive
-		name = name.lower()
-		search_text = search_text.lower()
-
-		if (search_text == ""):
-			return True
-
-		if (name.find(search_text) == -1):
-			return False
-
-		return True
-
-#------------------------------------------------------------------------------
-def main():
-	root_path = ""
-
-	if (len(sys.argv) != 2):
-		print("Usage: resource-browser <root-path>")
-		sys.exit(-1)
-
-	root_path = sys.argv[1];
-
-	root_path = os.path.abspath(root_path)
-
-	if not os.path.exists(root_path):
-		print("The path does not exist.")
-		sys.exit(-1)
-
-	if (os.path.islink(root_path)):
-		print("The path is a symbolic link.")
-		sys.exit(-1)
-
-	if not os.path.isdir(root_path):
-		print("The path has to be a directory.")
-		sys.exit(-1)
-
-	repository = Repository.Repository(root_path)
-
-	browser = ResourceBrowser(repository)
-
-main()
-

+ 0 - 92
tools/gui/resource-browser/ui/resource-browser.glade

@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-  <!-- interface-requires gtk+ 3.6 -->
-  <object class="GtkListStore" id="liststore1">
-    <columns>
-      <!-- column-name gchararray1 -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
-  <object class="GtkWindow" id="window1">
-    <property name="can_focus">False</property>
-    <property name="default_width">500</property>
-    <property name="default_height">350</property>
-    <signal name="delete-event" handler="on_delete" swapped="no"/>
-    <child>
-      <object class="GtkBox" id="box1">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkBox" id="box3">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkEntry" id="entry1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="invisible_char">●</property>
-                <property name="invisible_char_set">True</property>
-                <property name="caps_lock_warning">False</property>
-                <property name="primary_icon_name">edit-find-symbolic</property>
-                <property name="secondary_icon_name">edit-clear-symbolic</property>
-                <property name="primary_icon_activatable">False</property>
-                <property name="primary_icon_sensitive">False</property>
-                <property name="placeholder_text">Find resource</property>
-                <signal name="changed" handler="on_filter_entry_text_changed" swapped="no"/>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button3">
-                <property name="label">gtk-refresh</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-                <signal name="clicked" handler="on_update_button_clicked" swapped="no"/>
-              </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">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="shadow_type">in</property>
-            <child>
-              <object class="GtkTreeView" id="treeview1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="model">liststore1</property>
-                <property name="search_column">0</property>
-                <child internal-child="selection">
-                  <object class="GtkTreeSelection" id="treeview-selection"/>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-</interface>