Ticket #3713: mythgallery-rename.diff
File mythgallery-rename.diff, 1.8 KB (added by , 17 years ago) |
---|
-
home/guido/workspace/mythplugins/mythgallery/mythgallery/iconview.cpp
1215 1215 item = new UIListBtnTypeItem(m_submenuType, tr("Create Dir")); 1216 1216 item->setData(new MenuAction(&IconView::HandleMkDir)); 1217 1217 1218 item = new UIListBtnTypeItem(m_submenuType, tr("Rename")); 1219 item->setData(new MenuAction(&IconView::HandleRename)); 1220 1218 1221 m_inSubMenu = true; 1219 1222 } 1220 1223 … … 1513 1516 } 1514 1517 } 1515 1518 1519 1520 void IconView::HandleRename(void) 1521 { 1522 ThumbItem *item = m_itemList.at(m_currRow * m_nCols + m_currCol); 1523 1524 if (!item) 1525 return; 1526 1527 QString folderName = item->GetName(); 1528 1529 bool res = MythPopupBox::showGetTextPopup( 1530 gContext->GetMainWindow(), tr("Rename"), 1531 tr("Rename"), folderName); 1532 1533 if (folderName.isEmpty() || folderName == "." || folderName == "..") 1534 return; 1535 1536 if (res) 1537 { 1538 1539 QDir cdir(m_currDir); 1540 cdir.rename(item->GetName(), folderName); 1541 1542 LoadDirectory(m_currDir, true); 1543 } 1544 } 1545 1546 1547 1516 1548 void IconView::ImportFromDir(const QString &fromDir, const QString &toDir) 1517 1549 { 1518 1550 QDir d(fromDir); -
home/guido/workspace/mythplugins/mythgallery/mythgallery/iconview.h
100 100 void HandleClearMarked(void); 101 101 void HandleSelectAll(void); 102 102 void HandleMkDir(void); 103 void HandleRename(void); 103 104 104 105 void HandleMenuButtonPress(void); 105 106