Changeset 4114 for lliurex-store/trunk
- Timestamp:
- Apr 6, 2017, 2:20:07 PM (4 years ago)
- Location:
- lliurex-store/trunk/fuentes
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/debian/control
r3856 r4114 18 18 Depends: ${misc:Depends}, ${python3:Depends}, gir1.2-appstreamglib-1.0 (>=0.5.13), appstream (>=0.9.4), libappstream3 (>=0.9.4),python3-aptdaemon.pkcompat 19 19 Description: Libs for the LliureX Software Store 20 -
lliurex-store/trunk/fuentes/debian/lliurex-store.install
r3647 r4114 1 1 lliurex-store-cli/* / 2 lliurex-store-gui/usr/* /usr -
lliurex-store/trunk/fuentes/lliurex-store-cli/usr/share/lliurex-store/lliurex-store-cli.py
r4020 r4114 120 120 actions.append('list') 121 121 parms['list']=args.list 122 print(args.list,type(args.list)) 122 123 if args.list_sections: 123 124 actions.append('list_sections') -
lliurex-store/trunk/fuentes/lliurex-store-gui/CategoriesManager.py
r4104 r4114 11 11 f.close() 12 12 13 14 15 13 self.banned_categories=["Qt","GNOME","GTK","KDE"] 16 14 17 18 '''19 20 self.categories["audio"]={}21 self.categories["audio"]["tag"]="Audio"22 self.categories["audio"]["name"]="Audio"23 self.categories["audio"]["small_icon"]="audio.svg"24 self.categories["audio"]["icon"]="clean_icons/audio.svg"25 self.categories["audio"]["small_icon_over"]="audio_white.svg"26 27 self.categories["development"]={}28 self.categories["development"]["tag"]="Development"29 self.categories["development"]["name"]="Development"30 self.categories["development"]["icon"]="clean_icons/development.svg"31 self.categories["development"]["small_icon"]="development.svg"32 self.categories["development"]["small_icon_over"]="development_white.svg"33 34 self.categories["education"]={}35 self.categories["education"]["tag"]="Education"36 self.categories["education"]["name"]="Education"37 self.categories["education"]["icon"]="clean_icons/education.svg"38 self.categories["education"]["small_icon"]="education.svg"39 self.categories["education"]["small_icon_over"]="education_white.svg"40 41 self.categories["games"]={}42 self.categories["games"]["tag"]="Game"43 self.categories["games"]["name"]="Games"44 self.categories["games"]["icon"]="clean_icons/games.svg"45 self.categories["games"]["small_icon"]="games.svg"46 self.categories["games"]["small_icon_over"]="games_white.svg"47 48 self.categories["graphics"]={}49 self.categories["graphics"]["tag"]="Graphics"50 self.categories["graphics"]["name"]="Graphics"51 self.categories["graphics"]["icon"]="clean_icons/graphics.svg"52 self.categories["graphics"]["small_icon"]="graphics.svg"53 self.categories["graphics"]["small_icon_over"]="graphics_white.svg"54 55 self.categories["internet"]={}56 self.categories["internet"]["tag"]="Network"57 self.categories["internet"]["name"]="Internet"58 self.categories["internet"]["icon"]="clean_icons/internet.svg"59 self.categories["internet"]["small_icon"]="internet.svg"60 self.categories["internet"]["small_icon_over"]="internet_white.svg"61 62 self.categories["office"]={}63 self.categories["office"]["tag"]="Office"64 self.categories["office"]["name"]="Office"65 self.categories["office"]["icon"]="clean_icons/office.svg"66 self.categories["office"]["small_icon"]="office.svg"67 self.categories["office"]["small_icon_over"]="office_white.svg"68 69 self.categories["science"]={}70 self.categories["science"]["tag"]="Science"71 self.categories["science"]["name"]="Science"72 self.categories["science"]["icon"]="clean_icons/science.svg"73 self.categories["science"]["small_icon"]="science.svg"74 self.categories["science"]["small_icon_over"]="science_white.svg"75 76 self.categories["system"]={}77 self.categories["system"]["tag"]="System"78 self.categories["system"]["name"]="System"79 self.categories["system"]["icon"]="clean_icons/system.svg"80 self.categories["system"]["small_icon"]="system.svg"81 self.categories["system"]["small_icon_over"]="system_white.svg"82 83 self.categories["utilities"]={}84 self.categories["utilities"]["tag"]="Utility"85 self.categories["utilities"]["name"]="Utilities"86 self.categories["utilities"]["icon"]="clean_icons/utilities.svg"87 self.categories["utilities"]["small_icon"]="utilities.svg"88 self.categories["utilities"]["small_icon_over"]="utilities_white.svg"89 90 self.categories["video"]={}91 self.categories["video"]["tag"]="Video"92 self.categories["video"]["name"]="Video"93 self.categories["video"]["icon"]="clean_icons/video.svg"94 self.categories["video"]["small_icon"]="video.svg"95 self.categories["video"]["small_icon_over"]="video_white.svg"96 97 self.categories["lliurex"]={}98 self.categories["lliurex"]["tag"]="LliureX"99 self.categories["lliurex"]["name"]="LliureX"100 self.categories["lliurex"]["icon"]="clean_icons/lliurex.svg"101 self.categories["lliurex"]["small_icon"]="lliurex.svg"102 self.categories["lliurex"]["small_icon_over"]="lliurex_white.svg"103 104 '''105 106 15 #def init -
lliurex-store/trunk/fuentes/lliurex-store-gui/DetailsBox.py
r4109 r4114 11 11 signal.signal(signal.SIGINT, signal.SIG_DFL) 12 12 13 import gettext14 13 import time 15 14 import threading … … 17 16 import html2text 18 17 19 _=gettext.gettext 18 import gettext 19 gettext.textdomain('zero-center') 20 _ = gettext.gettext 20 21 21 22 TMP_STORE_DIR="/tmp/.lliurex-store/" 23 TMP_STORE_DIR=os.path.expanduser("~/.cache/") 22 24 23 25 class DetailsBox(Gtk.VBox): … … 39 41 40 42 self.full_info_box=Gtk.HBox() 41 #self.full_info_box.set_valign(Gtk.Align.CENTER)42 #self.full_info_box.set_halign(Gtk.Align.CENTER)43 43 self.pack_start(self.full_info_box,True,True,5) 44 #self.set_valign(Gtk.Align.CENTER)45 #self.set_halign(Gtk.Align.CENTER)46 47 #self.set_size_request(800,0)48 44 49 45 # ####### LEFT SIDE ###### … … 60 56 self.app_details.pack_start(self.app_banner,False,False,0) 61 57 self.install_button=Gtk.Button() 62 self.install_button_label=Gtk.Label( "Install")58 self.install_button_label=Gtk.Label(_("Install")) 63 59 self.install_button.add(self.install_button_label) 64 60 self.install_button.connect("clicked",self.install_clicked) 65 61 66 62 vbox=Gtk.VBox() 67 self.install_label=Gtk.Label( "Installing...")63 self.install_label=Gtk.Label(_("Installing...")) 68 64 vbox.pack_start(self.install_label,False,False,0) 69 65 vbox.set_valign(Gtk.Align.FILL) … … 77 73 78 74 hbox=Gtk.HBox() 79 self.uninstall_button=Gtk.Button( "Uninstall")75 self.uninstall_button=Gtk.Button(_("Uninstall")) 80 76 self.uninstall_button.connect("clicked",self.uninstall_clicked) 81 self.open_button=Gtk.Button( "Open")77 self.open_button=Gtk.Button(_("Open")) 82 78 self.open_button.connect("clicked",self.open_clicked) 83 79 self.open_button.set_margin_right(10) 84 80 hbox.pack_start(self.open_button,True,True,0) 85 81 hbox.pack_start(self.uninstall_button,True,True,0) 86 87 88 82 89 83 self.install_stack=Gtk.Stack() … … 93 87 self.install_stack.add_titled(vbox,"progress","Progress") 94 88 self.install_stack.add_titled(hbox,"installed","Open/Uninstall") 95 96 89 97 90 self.app_details.pack_start(self.install_stack,False,False,10) … … 372 365 self.screenshots_box.show_all() 373 366 374 375 367 376 368 for p in self.related_box.get_children(): 377 369 self.related_box.remove(p) 378 370 379 371 380 381 382 372 for p in pkg["related_packages"]: 383 373 -
lliurex-store/trunk/fuentes/lliurex-store-gui/LliurexStoreManager.py
r4109 r4114 67 67 ret=self.store.get_status(action) 68 68 69 print(ret)70 69 71 70 if ret["status"]==0: … … 85 84 categories.remove(item) 86 85 87 88 random_id=int(random.random()*len(categories)) 89 random_category=categories[random_id] 90 pkgs,categories=self.get_package_list_from_category(random_category) 91 92 if len(pkgs) >=10: 93 samples=10 94 else: 95 samples=len(pkgs) 96 97 for item in random.sample(pkgs,samples): 98 if item["package"]!=pkg_id: 99 p["related_packages"].append(item) 100 101 p.fix_info() 86 87 if len(categories)>0: 88 89 random_id=int(random.random()*len(categories)) 90 91 random_category=categories[random_id] 92 pkgs,categories=self.get_package_list_from_category(random_category) 93 94 if len(pkgs) >=10: 95 samples=10 96 else: 97 samples=len(pkgs) 98 99 for item in random.sample(pkgs,samples): 100 if item["package"]!=pkg_id: 101 p["related_packages"].append(item) 102 103 p.fix_info() 102 104 103 105 return p -
lliurex-store/trunk/fuentes/lliurex-store-gui/LoadingBox.py
r3773 r4114 11 11 signal.signal(signal.SIGINT, signal.SIG_DFL) 12 12 13 13 14 import gettext 14 15 _ =gettext.gettext15 gettext.textdomain('zero-center') 16 _ = gettext.gettext 16 17 17 18 … … 38 39 39 40 self.loading_label=builder.get_object("loading_label") 40 41 41 self.add(self.loading_box) 42 42 … … 44 44 self.show_all() 45 45 46 47 48 49 50 46 #def init 47 51 48 52 49 def set_css_info(self): -
lliurex-store/trunk/fuentes/lliurex-store-gui/MainMenu.py
r4109 r4114 7 7 signal.signal(signal.SIGINT, signal.SIG_DFL) 8 8 9 import gettext10 9 import urllib.request as urllib2 11 10 import shutil … … 17 16 import ImageManager 18 17 import Package 19 20 _=gettext.gettext 18 import os 19 20 import gettext 21 gettext.textdomain('zero-center') 22 _ = gettext.gettext 21 23 22 24 RSRC_DIR="./" … … 25 27 HOME_CONTENT_URL="file:///srv/svn/xenial/lliurex-store/trunk/fuentes/lliurex-store-gui/home_content.json" 26 28 TMP_STORE_DIR="/tmp/.lliurex-store/" 29 TMP_STORE_DIR=os.path.expanduser("~/.cache/") 27 30 28 31 class MainMenu(Gtk.VBox): … … 72 75 73 76 ''' 77 78 # MIGHT OR MIGHT NOT DO THIS IN THE FUTURE 79 74 80 self.categories_flowbox = Gtk.FlowBox() 75 81 self.categories_flowbox.set_max_children_per_line(30) … … 119 125 f=open(TMP_STORE_DIR+"home_content.json") 120 126 self.home_info=json.load(f) 121 122 '''123 for pkg in self.home_info["large"]:124 data=self.core.store.search_package(pkg["package"])125 if len(data)>0:126 data=data[0]127 for key in data:128 pkg[key]=data[key]129 130 for pkg in self.home_info["small"]:131 data=self.core.store.search_package(pkg["package"])132 if len(data)>0:133 data=data[0]134 for key in data:135 pkg[key]=data[key]136 '''137 127 138 128 f.close() … … 221 211 w_counter=0 222 212 h_counter=0 223 224 213 button_size=97 225 214 … … 227 216 for item in sorted(self.core.categories_manager.categories): 228 217 229 230 231 218 icon_name=self.core.categories_manager.categories[item]["icon"] 232 label= item219 label=_(item) 233 220 234 221 b=Gtk.Button() … … 248 235 b.add(s) 249 236 b.connect("clicked",self.category_clicked,item) 250 251 252 #self.categories_flowbox.add(b)253 237 238 ''' 239 self.categories_flowbox.add(b) 240 ''' 254 241 self.categories_grid.attach(b,w_counter,h_counter,1,1) 255 242 w_counter+=1 … … 257 244 w_counter=0 258 245 h_counter+=1 259 260 261 '''262 263 icon_name=self.core.categories_manager.categories[item]["icon"]264 label=item265 266 b=Gtk.Button()267 b.set_name("RELATED_BUTTON")268 hbox=Gtk.HBox()269 hbox.set_halign(Gtk.Align.START)270 271 s=Screenshot.ScreenshotNeo()272 i={}273 i["image_path"]=icon_name274 i["x"]=button_size275 i["y"]=button_size276 i["custom_frame"]=True277 i["name"]=label278 279 s.create_banner_from_file(i)280 b.add(s)281 b.connect("clicked",self.category_clicked,item)282 283 b.set_halign(Gtk.Align.CENTER)284 b.set_valign(Gtk.Align.CENTER)285 286 self.categories_flowbox.add(b)287 288 '''289 246 290 247 self.categories_grid.show_all() 291 #self.categories_flowbox.show_all() 292 293 294 295 248 249 ''' 250 self.categories_flowbox.show_all() 251 ''' 296 252 297 253 #def build_categories … … 310 266 self.forward_button.set_name("MEDIA_BUTTON") 311 267 312 313 268 #def set_css_info 314 269 … … 317 272 318 273 p=Package.Package(pkg) 319 320 274 self.core.main_window.load_pkg_data(p["package"]) 321 275 322 323 276 #def banner_clicked 277 324 278 325 279 def category_clicked(self,widget,category_tag): 326 280 327 self.core.search_box.current_category= category_tag281 self.core.search_box.current_category=_(category_tag) 328 282 self.core.main_window.search_category(category_tag) 329 283 … … 359 313 360 314 #def next_image 315 361 316 362 317 def rewind_clicked(self,widget): … … 367 322 368 323 #def rewind_clicked 324 369 325 370 326 def play_clicked(self,widget): … … 378 334 379 335 #def rewind_clicked 336 380 337 381 338 def forward_clicked(self,widget): -
lliurex-store/trunk/fuentes/lliurex-store-gui/MainWindow.py
r4109 r4114 8 8 import threading 9 9 import multiprocessing 10 import gettext11 10 import signal 12 11 import time 13 12 14 13 signal.signal(signal.SIGINT, signal.SIG_DFL) 15 _=gettext.gettext 14 15 16 import gettext 17 gettext.textdomain('zero-center') 18 _ = gettext.gettext 16 19 17 20 … … 189 192 current_txt=self.location_label.get_text() 190 193 if self.path_followed[-1]!="details": 191 self.location_label.set_text(current_txt + " > " + "Details")194 self.location_label.set_text(current_txt + " > " + _("Details")) 192 195 self.path_followed.append("details") 193 196 self.stack.set_visible_child_name("details") … … 202 205 203 206 self.search_entry.set_text("") 204 self.location_label.set_text( "Home")207 self.location_label.set_text(_("Home")) 205 208 self.path_followed=["main"] 206 209 self.stack.set_visible_child_name("main") … … 383 386 ret=self.core.store.search_package(pkg_id) 384 387 self.core.dprint("Search complete") 385 '''386 for p in ret:387 pkg["icon_url"]=self.core.resources.get_icon(p.dic)388 pkg["name"]=p.dic["name"]389 pkg["package"]=pkg_id390 pkg["short_description"]="Package that does a lot of things very well done askdjlaskl jdaklsdjkl asjkl dasjkl djkl asdjkl asdjkl asdjkl asdjkl asdjkl asdjkl asd"391 ret.append(pkg)392 '''393 394 388 search_queue.put(ret) 395 396 397 389 398 390 #def search_package_thread -
lliurex-store/trunk/fuentes/lliurex-store-gui/PopupMenu.py
r4109 r4114 5 5 6 6 import Core 7 8 import gettext 9 gettext.textdomain('zero-center') 10 _ = gettext.gettext 7 11 8 12 class PopupMenu(Gtk.EventBox): … … 71 75 b.icon="home.svg" 72 76 b.icon_over="home_white.svg" 73 txt= "Home"77 txt=_("Home") 74 78 75 79 b.img=Gtk.Image.new_from_file(b.icon) … … 97 101 b.icon="favorite.svg" 98 102 b.icon_over="favorite_white.svg" 99 txt= "My applications"103 txt=_("My applications") 100 104 101 105 b.img=Gtk.Image.new_from_file(b.icon) … … 137 141 b.icon=self.core.categories_manager.categories[item]["small_icon"] 138 142 b.icon_over=self.core.categories_manager.categories[item]["small_icon_over"] 139 txt= item143 txt=_(item) 140 144 141 145 b.img=Gtk.Image.new_from_file(b.icon) -
lliurex-store/trunk/fuentes/lliurex-store-gui/SearchBox.py
r4109 r4114 1 1 import gi 2 2 gi.require_version('Gtk', '3.0') 3 from gi.repository import Gtk,GdkPixbuf,GLib,GObject, Pango 3 from gi.repository import Gtk,GdkPixbuf,GLib,GObject, Pango, Gdk 4 4 5 5 import os … … 8 8 import Screenshot 9 9 10 import gettext 11 gettext.textdomain('zero-center') 12 _ = gettext.gettext 13 14 10 15 class SearchBox(Gtk.VBox): 11 16 … … 19 24 builder.add_from_file(ui_path) 20 25 21 self.label_max_width=53 26 self.label_max_width=1 27 28 self.description_label_ratio=0.091 22 29 23 30 self.current_category="" … … 79 86 hbox.set_name("PKG_BOX") 80 87 81 label=Gtk.Label( c)88 label=Gtk.Label(_(c)) 82 89 label.set_name("SHORT_DESCRIPTION") 83 90 … … 97 104 98 105 b.connect("clicked",self.filter_by,c) 106 99 107 self.search_categories_box.pack_start(b,False,False,3) 100 108 counter+=1 … … 105 113 self.categories_sw.hide() 106 114 115 connect_size_request=True 116 107 117 for pkg in pkg_list: 108 118 109 self.add_pkg_to_list(pkg) 119 self.add_pkg_to_list(pkg,connect_size_request) 120 connect_size_request=False 110 121 111 122 … … 118 129 119 130 120 def add_pkg_to_list(self,pkg ):131 def add_pkg_to_list(self,pkg,connect_size_request=False): 121 132 122 133 item_box=Gtk.HBox() … … 158 169 b.set_name("RELATED_BUTTON") 159 170 b.set_valign(Gtk.Align.START) 160 b.set_halign(Gtk.Align.FILL)171 #b.set_halign(Gtk.Align.FILL) 161 172 b.connect("clicked",self.result_clicked,pkg) 162 173 163 174 b.set_size_request(0,80) 175 176 if connect_size_request: 177 b.connect("draw",self.search_item_size_request) 164 178 165 179 self.results_search_box.pack_start(b,False,False,3) 166 180 self.results_search_box.queue_draw() 167 181 168 182 169 183 #def create_item 184 185 def search_item_size_request(self,widget,data=None): 186 187 allocation=widget.get_allocation() 188 self.label_max_width=int(allocation.width*self.description_label_ratio) 189 190 for child in self.results_search_box.get_children(): 191 child.get_child().get_children()[1].get_children()[1].set_max_width_chars(self.label_max_width) 192 193 if type(data)!=Gdk.Rectangle: 194 widget.disconnect_by_func(self.search_item_size_request) 195 widget.connect("size-allocate",self.search_item_size_request) 196 197 #def search_item_size_request 198 170 199 171 200 def filter_by(self,widget,filter): … … 174 203 self.results_search_box.remove(child) 175 204 176 205 connect_size_request=True 177 206 for pkg in self.current_pkg_list: 178 207 … … 181 210 continue 182 211 if filter in pkg["categories"]: 183 self.add_pkg_to_list(pkg) 212 213 self.add_pkg_to_list(pkg,connect_size_request) 214 connect_size_request=False 184 215 185 216 self.results_search_box.show_all() 186 217 187 188 189 218 #def filter_by 190 219 220 191 221 def result_clicked(self,widget,pkg_data): 192 222 223 a=widget.get_allocation() 193 224 self.core.main_window.load_pkg_data(pkg_data["package"]) 225 226 #def result_clicked 227 194 228 195 229 -
lliurex-store/trunk/fuentes/lliurex-store-gui/lliurex-store.ui
r4109 r4114 932 932 <property name="visible">True</property> 933 933 <property name="can_focus">True</property> 934 <property name="hscrollbar_policy">never</property> 934 935 <child> 935 936 <object class="GtkViewport" id="viewport5"> … … 943 944 <property name="visible">True</property> 944 945 <property name="can_focus">False</property> 945 <property name="halign">center</property>946 946 <property name="margin_left">5</property> 947 947 <property name="margin_right">5</property>
Note: See TracChangeset
for help on using the changeset viewer.