Changeset 3466 for extensions
- Timestamp:
- Jun 26, 2009, 4:43:50 PM (15 years ago)
- Location:
- extensions/pLoader/trunk/src/Uploader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r3458 r3466 896 896 Categories => gettext("Albums"), 897 897 'Add new category' => gettext("Add new album"), 898 'Category name' => gettext("Album name :"), 899 'New category' => gettext("New album"), 898 900 } 899 901 ); … … 902 904 $self->branding( 903 905 { 904 categor ie=> gettext("categorie"),905 Categor ie=> gettext("Categorie"),906 category => gettext("categorie"), 907 Category => gettext("Categorie"), 906 908 categories => gettext("categories"), 907 909 Categories => gettext("Categories"), 908 'Add new category' => gettext("Add new category"), 910 'Add new category' => gettext("Add new category"), 911 'Category name' => gettext("Category name :"), 912 'New category' => gettext("New category"), 909 913 } 910 914 ); -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r3461 r3466 60 60 wxTR_HIDE_ROOT 61 61 wxTR_HAS_BUTTONS 62 wxTR_EDIT_LABELS 62 63 wxMAXIMIZE 63 64 wxOK … … 350 351 EVT_MENU 351 352 EVT_TREE_SEL_CHANGED 353 EVT_TREE_END_LABEL_EDIT 352 354 EVT_CLOSE 353 355 EVT_LIST_END_LABEL_EDIT … … 1185 1187 wxBORDER_NONE| 1186 1188 wxCLIP_CHILDREN| 1187 # wxTR_MULTIPLE| 1188 # wxTR_EXTENDED| 1189 wxTR_HAS_BUTTONS 1190 # wxTR_HIDE_ROOT 1189 wxTR_HAS_BUTTONS| 1190 wxTR_EDIT_LABELS 1191 1191 ) 1192 1192 ); … … 1411 1411 EVT_TREE_SEL_CHANGED( $self, $self->tree, \&OnTreeSelChanged ); 1412 1412 EVT_TREE_ITEM_RIGHT_CLICK( $self, $self->tree, \&OnTreeItemRightClick ); 1413 EVT_TREE_END_LABEL_EDIT( $self, $self->tree, \&OnTreeEndLabelEdit ); 1413 1414 1414 1415 EVT_LIST_END_LABEL_EDIT( $self, $self->imageviewer, \&OnImageViewerEndLabelEdit ); … … 1543 1544 } 1544 1545 1546 sub OnTreeEndLabelEdit { 1547 my( $self, $event ) = @_; 1548 1549 1550 my $category = $self->tree->GetPlData($event->GetItem); 1551 my $category_id; 1552 1553 $category_id = $category->{id} if 'HASH' eq ref($category) ; 1554 my $comment; 1555 my ( $success, $status_msg, $content ) = $self->pwg->SetInfoCategories( $event->GetLabel, $comment, $category_id); 1556 1557 my $ok = 1; 1558 1559 if(!$success){ 1560 $ok = 0; 1561 } 1562 1563 if('fail' eq $content->{stat}){ 1564 $ok = 0; 1565 } 1566 1567 # method call failed 1568 if(!$ok){ 1569 $event->Veto; 1570 Wx::MessageBox( 1571 sprintf( 1572 "%s %s", 1573 gettext("Update failed : "), 1574 $status_msg 1575 ), 1576 gettext("Piwigo update error"), 1577 wxOK | wxICON_EXCLAMATION, 1578 ); 1579 Wx::LogMessage("%s\n\n%s", Dumper($content), gettext("This function is not available. A Piwigo upgrade may resolve this issue.")); 1580 } 1581 } 1545 1582 1546 1583 sub OnImageViewerItemRightClick { … … 1581 1618 my $dialog = Wx::TextEntryDialog->new( 1582 1619 $self, 1583 sprintf("%s name :", wxTheApp->branding->{Category}),1584 sprintf("Add new %s", wxTheApp->branding->{category}),1585 sprintf("New %s", wxTheApp->branding->{category}),1620 wxTheApp->branding->{'Category name'}, 1621 wxTheApp->branding->{'Add new category'}, 1622 wxTheApp->branding->{'New category'}, 1586 1623 ); 1587 1624 -
extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm
r3451 r3466 328 328 } 329 329 330 sub SetInfoCategories{ 331 my ( $self, $name, $comment, $parentid ) = @_; 332 333 my $form = { 334 method => 'pwg.categories.setInfo', 335 name => $name, 336 comment => $comment, 337 category_id => $parentid, 338 339 }; 340 341 my $result = $self->uagent->post( 342 $self->urlbase.'/ws.php?format=json', 343 $form 344 ); 345 346 my $content = {}; 347 eval { 348 $content = from_json( 349 $result->content 350 ); 351 }; 352 353 return ( $result->is_success, $result->status_line, $content ); 354 355 } 356 330 357 331 358 sub send_chunks {
Note: See TracChangeset
for help on using the changeset viewer.