Changeset 3857
- Timestamp:
- Mar 9, 2017, 2:02:49 PM (4 years ago)
- Location:
- lliurex-gdrive/trunk/fuentes/lliurex-gdrive-gui.install/usr/share/lliurex-gdrive
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-gdrive/trunk/fuentes/lliurex-gdrive-gui.install/usr/share/lliurex-gdrive/LliurexGoogleDriveManager.py
r3845 r3857 96 96 97 97 98 #def check_config uration98 #def check_config 99 99 100 100 def check_google_connections(self): … … 110 110 return False 111 111 112 #def check_google_connections 112 113 113 114 def mount_drive(self,profile,mountpoint): … … 197 198 f.close() 198 199 200 #def save_profiles 199 201 200 202 def check_mountpoint_status(self,mountpoint): … … 222 224 return {"status":status,"size":mountpoint_size,"used":mountpoint_used,"available":mountpoint_available,"Used%":mountpoint_per} 223 225 224 226 #def check_mountpoint_status 227 225 228 def check_profile_info(self,profile,mountpoint,edition): 226 229 … … 247 250 return {"result":True,"code":0} 248 251 252 #def check_profile_info 253 249 254 def create_profile(self,profile): 250 255 … … 263 268 264 269 265 266 270 #def create_profile 267 271 … … 279 283 280 284 return result 285 286 #def create_mountpoint 281 287 282 288 def dismount_mountpoint(self,mountpoint): … … 297 303 return result 298 304 305 #def dismount_mountpoint 299 306 300 307 def delete_profile(self,info,profile): … … 354 361 self.save_profiles(info) 355 362 356 return result 363 return result 364 365 #def edit_profile 357 366 358 367 def sync_profile(self,profile,mountpoint): … … 370 379 return {"action":action,"result":result} 371 380 381 #def_sync_profile 372 382 373 383 def log(self,msg): … … 377 387 f=open(log_file,"a+") 378 388 f.write(msg + '\n') 379 f.close() 389 f.close() 390 391 #def log 380 392 381 393 if __name__=="__main__": -
lliurex-gdrive/trunk/fuentes/lliurex-gdrive-gui.install/usr/share/lliurex-gdrive/ProfileBox.py
r3850 r3857 29 29 DELETE_IMAGE=RSRC+"rsrc/trash.svg" 30 30 MAX_RETRY_INTENTS=900 31 MSG_CHANGE_SUCCESS=_("Changes applied successfully") 32 MSG_CHANGE_ERROR=_("An error ocurred applying changes. See log file for more information") 31 33 32 34 class ProfileBox(Gtk.VBox): … … 123 125 124 126 125 126 127 127 128 128 #def set-css_info … … 158 158 159 159 #def hide_window 160 161 def init_profile_dialog_button(self): 162 163 self.accept_add_profile_button.show() 164 image = Gtk.Image() 165 image.set_from_stock(Gtk.STOCK_CANCEL,Gtk.IconSize.MENU) 166 self.cancel_add_profile_button.set_image(image) 167 self.cancel_add_profile_button.set_label(_("Cancel")) 168 self.cancel_add_profile_button.show() 169 170 #def init_profile_dialog_button 171 172 def change_cancel_button(self): 173 174 image = Gtk.Image() 175 image.set_from_stock(Gtk.STOCK_CLOSE,Gtk.IconSize.MENU) 176 self.cancel_add_profile_button.set_image(image) 177 self.cancel_add_profile_button.set_label(_("Close")) 178 self.cancel_add_profile_button.show() 179 180 #def change_cancel_button 160 181 161 182 def add_new_profile_button_clicked(self,widget): … … 172 193 self.init_threads() 173 194 174 self.msg_label. hide()195 self.msg_label.set_text("") 175 196 self.profile_msg.hide() 176 197 self.profile_pbar.hide() 198 self.init_profile_dialog_button() 177 199 self.new_profile_window.show() 200 178 201 179 202 #def add_new_profile_button_clicked … … 181 204 def delete_profile_clicked(self,button,hbox): 182 205 183 self.msg_label. hide()206 self.msg_label.set_text("") 184 207 profile=hbox.get_children()[1].get_text().split("\n")[0] 185 208 self.profiles_info.pop(profile) … … 190 213 191 214 if delete: 192 self.msg_label.set_text( _("Changes applied successfully"))215 self.msg_label.set_text(MSG_CHANGE_SUCCESS) 193 216 self.profile_list_box.remove(hbox) 194 217 else: 195 218 self.msg_label.set_name("MSG_ERROR_LABEl") 196 self.msg_label.set_text( _("An error ocurred applying changes. See log file for more information"))219 self.msg_label.set_text(MSG_CHANGE_ERROR) 197 220 198 221 self.profiles_info=self.core.LliurexGoogleDriveManager.profiles_config.copy() … … 204 227 def sync_profile_clicked(self,button,hbox): 205 228 206 self.msg_label. hide()229 self.msg_label.set_text("") 207 230 profile=hbox.get_children()[1].get_text().split("\n")[0] 208 231 mountpoint=hbox.get_children()[3].get_text() … … 221 244 button.set_tooltip_text(_("Mount profile")) 222 245 223 self.msg_label.set_text( _("Changes applied successfully"))246 self.msg_label.set_text(MSG_CHANGE_SUCCESS) 224 247 225 248 226 249 else: 227 250 self.msg_label.set_name("MSG_ERROR_LABEl") 228 self.msg_label.set_text( _("An error ocurred applying changes. See log file for more information"))251 self.msg_label.set_text(MSG_CHANGE_ERROR) 229 252 230 253 hbox.get_children()[4].set_image(mount_image) … … 249 272 self.init_threads() 250 273 251 self.profile_msg. set_text("")274 self.profile_msg.hide() 252 275 self.profile_pbar.hide() 253 self.msg_label.hide() 276 self.msg_label.set_text("") 277 self.init_profile_dialog_button() 254 278 self.new_profile_window.show() 255 279 … … 267 291 profile=Gtk.Label() 268 292 profile.set_markup(profile_info) 269 profile.set_margin_left( 10)270 profile.set_margin_right( 20)293 profile.set_margin_left(5) 294 profile.set_margin_right(15) 271 295 profile.set_margin_top(21) 272 296 profile.set_margin_bottom(21) … … 411 435 self.profiles_info=self.core.LliurexGoogleDriveManager.profiles_config.copy() 412 436 self.profile_msg.set_text(_("Profile created successfully")) 413 414 image = Gtk.Image() 415 image.set_from_stock(Gtk.STOCK_CLOSE,Gtk.IconSize.MENU) 416 self.cancel_add_profile_button.set_image(image) 417 self.cancel_add_profile_button.set_label(_("Close")) 418 self.cancel_add_profile_button.show() 437 self.change_cancel_button() 438 419 439 else: 420 440 … … 434 454 if self.create_mountpoint_t.launched: 435 455 if not self.create_mountpoint_t.done: 436 return True 456 return True 457 458 #def_pulsate_add_profile 437 459 438 460 def kill_create_profile(self): … … 445 467 self.profile_msg.set_text(_("Error getting authorization")) 446 468 447 return True 448 469 return True 470 471 #def kill_create_profile 449 472 450 473 def create_profile(self): 474 451 475 result=self.core.LliurexGoogleDriveManager.create_profile(self.new_profile) 452 476 477 #def create_profile 453 478 454 479 def create_mountpoint(self): 455 456 480 457 481 self.create_result=self.core.LliurexGoogleDriveManager.create_mountpoint(self.profiles_info,self.new_profile) 458 482 self.create_mountpoint_t.done=True 459 483 460 484 #def create_mountpoint 461 485 462 486 def pulsate_edit_profile(self): … … 473 497 self.profile_to_edit.get_children()[3].set_text(self.new_mountpoint) 474 498 self.profiles_info=self.core.LliurexGoogleDriveManager.profiles_config.copy() 475 self.profile_msg.set_text(_("Changes applied successfully")) 476 image = Gtk.Image() 477 image.set_from_stock(Gtk.STOCK_CLOSE,Gtk.IconSize.MENU) 478 self.cancel_add_profile_button.set_image(image) 479 self.cancel_add_profile_button.set_label(_("Close")) 480 self.cancel_add_profile_button.show() 499 self.profile_msg.set_text(MSG_CHANGE_SUCCESS) 500 self.change_cancel_button() 481 501 482 502 else: 483 503 self.profile_msg.set_name("MSG_ERROR_LABEL") 484 self.profile_msg.set_text( _("An error ocurred applying changes. See log file for more information"))504 self.profile_msg.set_text(MSG_CHANGE_ERROR) 485 505 self.cancel_add_profile_button.show() 486 506 return False … … 491 511 return True 492 512 513 #def pulsate_edit_profile 514 493 515 def edit_profile(self): 516 494 517 self.edit_result=self.core.LliurexGoogleDriveManager.edit_profile(self.profiles_info,self.new_profile) 495 518 self.edit_profile_t.done=True 496 519 520 #def edit_profile 521 497 522 def cancel_add_profile_clicked(self,widget): 498 523 -
lliurex-gdrive/trunk/fuentes/lliurex-gdrive-gui.install/usr/share/lliurex-gdrive/rsrc/lliurex-gdrive.ui
r3845 r3857 53 53 <property name="margin_right">10</property> 54 54 <property name="margin_top">10</property> 55 <property name="margin_bottom"> 5</property>55 <property name="margin_bottom">10</property> 56 56 <property name="use_stock">True</property> 57 57 </object>
Note: See TracChangeset
for help on using the changeset viewer.