Changeset 2311 for zero-lliurex-flavours/trunk/fuentes/install-files/usr/share/lliurex-flavours-selector/lliurex-flavours-selector.py
- Timestamp:
- Aug 1, 2016, 10:37:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zero-lliurex-flavours/trunk/fuentes/install-files/usr/share/lliurex-flavours-selector/lliurex-flavours-selector.py
r2145 r2311 43 43 self.info["installed"]=False 44 44 self.info["checked"]=False 45 self.info["incompatible"]=False 45 46 self.info["shadow_alpha"]=0.1 46 47 self.info["animation_active"]=False … … 129 130 self.configuration_start=0 130 131 131 self.first_run=True132 self.update_alternatives=False133 134 132 self.current_grid_width=0 135 133 self.current_grid_height=0 … … 142 140 self.green=CustomColor(74.0,166.,69.0) 143 141 self.light_green=CustomColor(88.0,208.0,86.0) 144 145 142 146 143 self.conf_light=CustomColor(49.0,55.0,66.0) … … 258 255 else: 259 256 if gb.info["installed"]==True: 257 self.check_meta_blocked(gb, self.gbs) 260 258 self.flavours_installed+=1 261 259 self.add_grid_button(gb) 262 263 264 265 260 266 261 #def gather_info 267 262 263 def check_meta_blocked(self, gb, gbs): 264 265 if gb.info["pkg"]=="lliurex-meta-server": 266 for gb in self.gbs: 267 if gb.info["pkg"]=="lliurex-meta-client": 268 gb.info["incompatible"]=True 269 elif gb.info["pkg"]=="lliurex-meta-desktop" and not gb.info["installed"]: 270 gb.info["incompatible"]=True 271 elif gb.info["pkg"]=="lliurex-meta-client": 272 for gb in self.gbs: 273 if gb.info["pkg"]=="lliurex-meta-server": 274 gb.info["incompatible"]=True 275 276 #def check_meta_blocked 277 268 278 def pulsate_gathering_info(self): 269 279 … … 317 327 } 318 328 329 #DIALOG_LABEL{ 330 color: #8297a1; 331 font: Noto Sans Bold 10; 332 } 333 319 334 #MAIN_LABEL_DISABLED{ 320 335 color: #c9d4e2; … … 474 489 def button_clicked(self,widget,event,grid_button): 475 490 476 if not grid_button.info["installed"]:491 if not (grid_button.info["installed"] or grid_button.info["incompatible"]): 477 492 if grid_button.info["checked"]: 478 493 self.install_metas.remove(grid_button) 479 494 grid_button.info["checked"]=False 495 grid_button.info["drawingarea"].queue_draw() 496 self.mouse_left(grid_button.info["drawingarea"],None,grid_button) 480 497 else: 481 498 self.install_metas.append(grid_button) … … 489 506 490 507 def accept_clicked(self,widget,even=None): 508 491 509 ret, msg=self.check_meta_compatibility() 492 510 … … 495 513 self.msg_label.set_markup(msg) 496 514 return 497 498 self.msg_label.hide() 515 else: 516 self.msg_label.hide() 517 self.show_confirm_dialog(widget) 518 519 # def accept_clicked 520 521 def show_confirm_dialog(self, widget): 522 message=_("The selected flavours will be installed. Do you wish to continue?") 523 label = Gtk.Label(message) 524 525 dialog = Gtk.Dialog("Warning", None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (Gtk.STOCK_YES, Gtk.ResponseType.YES, Gtk.STOCK_NO, Gtk.ResponseType.NO)) 526 dialog.vbox.pack_start(label,True,True,10) 527 528 label.show() 529 #dialog.set_border_width(6) 530 dialog.set_name("BACK_GRADIENT") 531 label.set_name("DIALOG_LABEL") 532 533 response = dialog.run() 534 535 if response==Gtk.ResponseType.YES: 536 self.install_packages(widget) 537 dialog.destroy() 538 539 # def show_confirm_dialog 540 541 def install_packages(self,widget): 542 543 499 544 cmd='apt-get update && apt-get install -y ' 500 545 pkg="" … … 504 549 for item in self.install_metas: 505 550 pkg+=item.info["pkg"] + ' ' 506 551 507 552 command=cmd+pkg 553 508 554 self.t=threading.Thread(target=self.execute,args=(command,)) 509 555 self.t.daemon=True 510 556 self.t.start() 511 557 GLib.timeout_add(100,self.pulsate_pbar,widget) 512 self.progress_window.show() 513 514 515 # def accept_clicked558 self.progress_window.show() 559 560 561 # def install_packages 516 562 517 563 def check_meta_compatibility(self): … … 623 669 ctx.fill() 624 670 671 672 if grid_button.info["incompatible"]: 673 674 desc = Pango.font_description_from_string ("Noto Sans Bold 7") 675 pctx.set_font_description(desc) 676 ctx.set_source_rgba(255,0,0,1) 677 txt=_("Incompatible") 678 pctx.set_markup(txt) 679 width=pctx.get_pixel_size()[0] 680 ctx.move_to(140-width-5,120) 681 PangoCairo.show_layout(ctx, pctx) 682 683 ctx.rectangle(5,139,130,1) 684 ctx.fill() 625 685 #def draw_button 626 686 … … 828 888 # def log 829 889 890 891 830 892 #awesome tabs 831 893
Note: See TracChangeset
for help on using the changeset viewer.