summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp118
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
2 files changed, 83 insertions, 38 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 3a8c22d..f32031b 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -27,8 +27,9 @@
27#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
28#include <qpe/config.h> 28#include <qpe/config.h>
29#include <qpe/mimetype.h> 29#include <qpe/mimetype.h>
30#include <qpe/applnk.h> 30#include <qpe/applnk.h>
31#include <qpe/ir.h>
31 32
32//#include <opie/ofileselector.h> 33//#include <opie/ofileselector.h>
33#include <qmultilineedit.h> 34#include <qmultilineedit.h>
34 35
@@ -91,9 +92,9 @@ AdvancedFm::AdvancedFm( )
91 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 92 qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
92 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); 93 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
93 qpeDirButton->setFlat(TRUE); 94 qpeDirButton->setFlat(TRUE);
94 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); 95 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
95 96
96 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); 97 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
97 cfButton ->setFixedSize( QSize( 20, 20 ) ); 98 cfButton ->setFixedSize( QSize( 20, 20 ) );
98 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); 99 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) );
99 cfButton->setFlat(TRUE); 100 cfButton->setFlat(TRUE);
@@ -209,9 +210,9 @@ AdvancedFm::AdvancedFm( )
209 210
210// OFileSelector *fileSelector; 211// OFileSelector *fileSelector;
211// fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); 212// fileSelector = new OFileSelector(tab_3,0,0,"/","","*");
212// tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); 213// tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 );
213 214
214// TabWidget->insertTab( tab_3, tr( "Files" ) ); 215// TabWidget->insertTab( tab_3, tr( "Files" ) );
215 216
216 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 217 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
217 currentDir.setPath( QDir::currentDirPath()); 218 currentDir.setPath( QDir::currentDirPath());
@@ -283,9 +284,9 @@ void AdvancedFm::populateLocalView()
283// qDebug(currentDir.canonicalPath()); 284// qDebug(currentDir.canonicalPath());
284// struct stat buf; 285// struct stat buf;
285// mode_t mode; 286// mode_t mode;
286 QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); 287 QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
287 setCaption("AdvancedFm :: "+fs); 288 setCaption("AdvancedFm :: "+fs);
288 bool isDir=FALSE; 289 bool isDir=FALSE;
289 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 290 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
290 QFileInfoListIterator it(*list); 291 QFileInfoListIterator it(*list);
291 QFileInfo *fi; 292 QFileInfo *fi;
@@ -309,11 +310,11 @@ void AdvancedFm::populateLocalView()
309 } 310 }
310 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL); 311 QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL);
311 if(fileL !="./" && fi->exists()) { 312 if(fileL !="./" && fi->exists()) {
312 item= new QListViewItem( Local_View, fileL, fileS , fileDate); 313 item= new QListViewItem( Local_View, fileL, fileS , fileDate);
313 314
314 if(isDir || fileL.find("/",0,TRUE) != -1) { 315 if(isDir || fileL.find("/",0,TRUE) != -1) {
315 316
316 if( !QDir( fi->filePath() ).isReadable()) //is directory 317 if( !QDir( fi->filePath() ).isReadable()) //is directory
317 pm = Resource::loadPixmap( "lockedfolder" ); 318 pm = Resource::loadPixmap( "lockedfolder" );
318 else 319 else
319 pm= Resource::loadPixmap( "folder" ); 320 pm= Resource::loadPixmap( "folder" );
@@ -327,9 +328,9 @@ void AdvancedFm::populateLocalView()
327// else { //is exec 328// else { //is exec
328// pm = Resource::loadPixmap( "exec"); 329// pm = Resource::loadPixmap( "exec");
329// } 330// }
330// // item->setPixmap( 0,pm); 331// // item->setPixmap( 0,pm);
331 } else if( !fi->isReadable() ) { 332 } else if( !fi->isReadable() ) {
332 pm = Resource::loadPixmap( "locked" ); 333 pm = Resource::loadPixmap( "locked" );
333// item->setPixmap( 0,pm); 334// item->setPixmap( 0,pm);
334 } else { //everything else goes by mimetype 335 } else { //everything else goes by mimetype
335 MimeType mt(fi->filePath()); 336 MimeType mt(fi->filePath());
@@ -378,12 +379,12 @@ void AdvancedFm::populateLocalView()
378 pm = Resource::loadPixmap( "UnknownDocument-14" ); 379 pm = Resource::loadPixmap( "UnknownDocument-14" );
379 item->setPixmap( 0,pm); 380 item->setPixmap( 0,pm);
380 } 381 }
381 } 382 }
382 383
383 closedir(dir); 384 closedir(dir);
384 } 385 }
385 386
386 Local_View->setSorting( 3,FALSE); 387 Local_View->setSorting( 3,FALSE);
387 fillCombo( (const QString &) currentDir.canonicalPath()); 388 fillCombo( (const QString &) currentDir.canonicalPath());
388} 389}
389 390
@@ -406,9 +407,9 @@ void AdvancedFm::populateRemoteView()
406 currentRemoteDir.setNameFilter(filterStr); 407 currentRemoteDir.setNameFilter(filterStr);
407 QString fileL, fileS, fileDate; 408 QString fileL, fileS, fileDate;
408 409
409 QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); 410 QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
410 setCaption("AdvancedFm :: "+fs); 411 setCaption("AdvancedFm :: "+fs);
411 bool isDir=FALSE; 412 bool isDir=FALSE;
412 const QFileInfoList *list = currentRemoteDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 413 const QFileInfoList *list = currentRemoteDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
413 QFileInfoListIterator it(*list); 414 QFileInfoListIterator it(*list);
414 QFileInfo *fi; 415 QFileInfo *fi;
@@ -496,9 +497,9 @@ void AdvancedFm::populateRemoteView()
496 pm = Resource::loadPixmap( "UnknownDocument-14" ); 497 pm = Resource::loadPixmap( "UnknownDocument-14" );
497 item->setPixmap( 0,pm); 498 item->setPixmap( 0,pm);
498 } 499 }
499 } 500 }
500 501
501 closedir(dir); 502 closedir(dir);
502 } 503 }
503 504
504 Remote_View->setSorting( 3,FALSE); 505 Remote_View->setSorting( 3,FALSE);
@@ -613,9 +614,9 @@ void AdvancedFm::showHidden()
613// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 614// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
614 b=TRUE; 615 b=TRUE;
615 } 616 }
616 populateLocalView(); 617 populateLocalView();
617 618
618} 619}
619 620
620void AdvancedFm::showRemoteHidden() 621void AdvancedFm::showRemoteHidden()
621{ 622{
@@ -690,8 +691,10 @@ void AdvancedFm::showLocalMenu(QListViewItem * item)
690 if (!b) 691 if (!b)
691 m.setItemChecked(m.idAt(0),TRUE); 692 m.setItemChecked(m.idAt(0),TRUE);
692 else 693 else
693 m.setItemChecked(m.idAt(0),FALSE); 694 m.setItemChecked(m.idAt(0),FALSE);
695 if(Ir::supported())
696 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
694 m.exec( QCursor::pos() ); 697 m.exec( QCursor::pos() );
695 } 698 }
696} 699}
697 700
@@ -727,15 +730,17 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item)
727 if (!b) 730 if (!b)
728 m.setItemChecked(m.idAt(0),TRUE); 731 m.setItemChecked(m.idAt(0),TRUE);
729 else 732 else
730 m.setItemChecked(m.idAt(0),FALSE); 733 m.setItemChecked(m.idAt(0),FALSE);
734 if(Ir::supported())
735 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
731 m.exec( QCursor::pos() ); 736 m.exec( QCursor::pos() );
732 } 737 }
733} 738}
734 739
735void AdvancedFm::runThis() { 740void AdvancedFm::runThis() {
736// QFileInfo *fi; 741// QFileInfo *fi;
737QString fs; 742QString fs;
738 if (TabWidget->currentPageIndex() == 0) { 743 if (TabWidget->currentPageIndex() == 0) {
739 QString curFile = Local_View->currentItem()->text(0); 744 QString curFile = Local_View->currentItem()->text(0);
740 745
741 fs= getFileSystemType((const QString &) currentDir.canonicalPath()); 746 fs= getFileSystemType((const QString &) currentDir.canonicalPath());
@@ -830,9 +835,9 @@ void AdvancedFm::localDelete()
830 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 835 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
831 myFile = (*it); 836 myFile = (*it);
832 if( myFile.find(" -> ",0,TRUE) != -1) 837 if( myFile.find(" -> ",0,TRUE) != -1)
833 myFile = myFile.left( myFile.find(" -> ",0,TRUE)); 838 myFile = myFile.left( myFile.find(" -> ",0,TRUE));
834 839
835 QString f = currentDir.canonicalPath(); 840 QString f = currentDir.canonicalPath();
836 if(f.right(1).find("/",0,TRUE) == -1) 841 if(f.right(1).find("/",0,TRUE) == -1)
837 f+="/"; 842 f+="/";
838 f+=myFile; 843 f+=myFile;
@@ -936,9 +941,9 @@ void AdvancedFm::localRename()
936} 941}
937 942
938void AdvancedFm::remoteRename() 943void AdvancedFm::remoteRename()
939{ 944{
940 QString curFile = Remote_View->currentItem()->text(0); 945 QString curFile = Local_View->currentItem()->text(0);
941 InputDialog *fileDlg; 946 InputDialog *fileDlg;
942 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); 947 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
943 fileDlg->setInputText((const QString &)curFile); 948 fileDlg->setInputText((const QString &)curFile);
944 fileDlg->exec(); 949 fileDlg->exec();
@@ -1050,16 +1055,16 @@ void AdvancedFm::filePerms() {
1050 } else { 1055 } else {
1051 populateRemoteView(); 1056 populateRemoteView();
1052 } 1057 }
1053 1058
1054 1059
1055} 1060}
1056 1061
1057void AdvancedFm::doProperties() { 1062void AdvancedFm::doProperties() {
1058 QStringList curFileList = getPath(); 1063 QStringList curFileList = getPath();
1059 QString filePath; 1064 QString filePath;
1060 if (TabWidget->currentPageIndex() == 0) { 1065 if (TabWidget->currentPageIndex() == 0) {
1061 1066
1062 filePath = currentDir.canonicalPath()+"/"; 1067 filePath = currentDir.canonicalPath()+"/";
1063 } else { 1068 } else {
1064 filePath= currentRemoteDir.canonicalPath()+"/"; 1069 filePath= currentRemoteDir.canonicalPath()+"/";
1065 } 1070 }
@@ -1182,9 +1187,9 @@ void AdvancedFm::copy()
1182 QString curFile; 1187 QString curFile;
1183 if (TabWidget->currentPageIndex() == 0) { 1188 if (TabWidget->currentPageIndex() == 0) {
1184 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 1189 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1185 1190
1186 QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it); 1191 QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it);
1187// if(destFile.right(1).find("/",0,TRUE) == -1) 1192// if(destFile.right(1).find("/",0,TRUE) == -1)
1188// destFile+="/"; 1193// destFile+="/";
1189// destFile +=(*it); 1194// destFile +=(*it);
1190 1195
@@ -1251,9 +1256,9 @@ void AdvancedFm::copyAs()
1251 qWarning("nothin doing"); 1256 qWarning("nothin doing");
1252 } 1257 }
1253 } 1258 }
1254 } 1259 }
1255 1260
1256 populateRemoteView(); 1261 populateRemoteView();
1257 TabWidget->setCurrentPage(1); 1262 TabWidget->setCurrentPage(1);
1258 } else { 1263 } else {
1259 if (TabWidget->currentPageIndex() == 0) { 1264 if (TabWidget->currentPageIndex() == 0) {
@@ -1378,9 +1383,9 @@ void AdvancedFm::runCommand() {
1378 } else { 1383 } else {
1379 if(Remote_View->currentItem()) 1384 if(Remote_View->currentItem())
1380 curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0); 1385 curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0);
1381 } 1386 }
1382 1387
1383 InputDialog *fileDlg; 1388 InputDialog *fileDlg;
1384 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 1389 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
1385 fileDlg->setInputText(curFile); 1390 fileDlg->setInputText(curFile);
1386 fileDlg->exec(); 1391 fileDlg->exec();
@@ -1398,13 +1403,13 @@ void AdvancedFm::runCommand() {
1398 char line[130]; 1403 char line[130];
1399 sleep(1); 1404 sleep(1);
1400// if(command.find("2>",0,TRUE) != -1) 1405// if(command.find("2>",0,TRUE) != -1)
1401 command +=" 2>&1"; 1406 command +=" 2>&1";
1402 fp = popen( (const char *) command, "r"); 1407 fp = popen( (const char *) command, "r");
1403 if ( !fp ) { 1408 if ( !fp ) {
1404 qDebug("Could not execute '" + command + "'! err=%d", fp); 1409 qDebug("Could not execute '" + command + "'! err=%d", fp);
1405 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1410 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1406 pclose(fp); 1411 pclose(fp);
1407 return; 1412 return;
1408 } else { 1413 } else {
1409 while ( fgets( line, sizeof line, fp)) { 1414 while ( fgets( line, sizeof line, fp)) {
1410 QString lineStr = line; 1415 QString lineStr = line;
@@ -1424,9 +1429,9 @@ void AdvancedFm::runCommandStd() {
1424 } else { 1429 } else {
1425 if(Remote_View->currentItem()) 1430 if(Remote_View->currentItem())
1426 curFile = currentRemoteDir.canonicalPath() +"/"+ Remote_View->currentItem()->text(0); 1431 curFile = currentRemoteDir.canonicalPath() +"/"+ Remote_View->currentItem()->text(0);
1427 } 1432 }
1428 1433
1429 InputDialog *fileDlg; 1434 InputDialog *fileDlg;
1430 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 1435 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
1431 fileDlg->setInputText(curFile); 1436 fileDlg->setInputText(curFile);
1432 fileDlg->exec(); 1437 fileDlg->exec();
@@ -1454,30 +1459,30 @@ void AdvancedFm::fileStatus() {
1454 qApp->processEvents(); 1459 qApp->processEvents();
1455 FILE *fp; 1460 FILE *fp;
1456 char line[130]; 1461 char line[130];
1457 sleep(1); 1462 sleep(1);
1458 fp = popen( (const char *) command, "r"); 1463 fp = popen( (const char *) command, "r");
1459 if ( !fp ) { 1464 if ( !fp ) {
1460 qDebug("Could not execute '" + command + "'! err=%d", fp); 1465 qDebug("Could not execute '" + command + "'! err=%d", fp);
1461 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1466 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1462 pclose(fp); 1467 pclose(fp);
1463 return; 1468 return;
1464 } else { 1469 } else {
1465 while ( fgets( line, sizeof line, fp)) { 1470 while ( fgets( line, sizeof line, fp)) {
1466 outDlg->OutputEdit->append(line); 1471 outDlg->OutputEdit->append(line);
1467 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1472 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1468 1473
1469 } 1474 }
1470 1475
1471 } 1476 }
1472} 1477}
1473 1478
1474void AdvancedFm::mkDir() { 1479void AdvancedFm::mkDir() {
1475 if (TabWidget->currentPageIndex() == 0) 1480 if (TabWidget->currentPageIndex() == 0)
1476 localMakDir(); 1481 localMakDir();
1477 else 1482 else
1478 remoteMakDir(); 1483 remoteMakDir();
1479 1484
1480} 1485}
1481 1486
1482void AdvancedFm::rn() { 1487void AdvancedFm::rn() {
1483 if (TabWidget->currentPageIndex() == 0) 1488 if (TabWidget->currentPageIndex() == 0)
@@ -1547,23 +1552,23 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e)
1547 CFButtonPushed(); 1552 CFButtonPushed();
1548 break; 1553 break;
1549 case Key_4: 1554 case Key_4:
1550 SDButtonPushed(); 1555 SDButtonPushed();
1551 break; 1556 break;
1552 case Key_5: 1557 case Key_5:
1553 homeButtonPushed(); 1558 homeButtonPushed();
1554 break; 1559 break;
1555 case Key_6: 1560 case Key_6:
1556 docButtonPushed(); 1561 docButtonPushed();
1557 break; 1562 break;
1558 case Key_7: 1563 case Key_7:
1559 break; 1564 break;
1560 case Key_8: 1565 case Key_8:
1561 break; 1566 break;
1562 case Key_9: 1567 case Key_9:
1563 break; 1568 break;
1564 case Key_0: 1569 case Key_0:
1565 break; 1570 break;
1566 } 1571 }
1567} 1572}
1568 1573
1569void AdvancedFm::mkSym() { 1574void AdvancedFm::mkSym() {
@@ -1656,8 +1661,45 @@ QString AdvancedFm::getFileSystemType(const QString &currentText) {
1656 return baseFs; 1661 return baseFs;
1657} 1662}
1658 1663
1659 1664
1665void AdvancedFm::doBeam() {
1666 Ir ir;
1667 if(!ir.supported()){
1668 } else {
1669
1670 QStringList curFileList = getPath();
1671
1672 if (TabWidget->currentPageIndex() == 0) {
1673 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1674
1675 QString curFile = currentDir.canonicalPath()+"/"+(*it);
1676 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1677 Ir *file = new Ir(this, "IR");
1678 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1679 file->send( curFile, curFile );
1680 }
1681
1682 } else {
1683 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1684
1685 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
1686 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1687 Ir *file = new Ir(this, "IR");
1688 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1689 file->send( curFile, curFile );
1690
1691 }
1692 }
1693 }
1694}
1695
1696void AdvancedFm::fileBeamFinished( Ir *ir) {
1697 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
1698
1699}
1700
1701
1660// QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 1702// QList<QListViewItem> * getSelectedItems( QListView * Local_View );
1661// QListViewItemIterator it( Local_View ); 1703// QListViewItemIterator it( Local_View );
1662// for ( ; it.current(); ++it ) { 1704// for ( ; it.current(); ++it ) {
1663// if ( it.current()->isSelected() ) { 1705// if ( it.current()->isSelected() ) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 90619ba..5817fca 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -18,8 +18,9 @@
18#include <qdir.h> 18#include <qdir.h>
19#include <qstring.h> 19#include <qstring.h>
20#include <qpoint.h> 20#include <qpoint.h>
21#include <qstringlist.h> 21#include <qstringlist.h>
22#include <qpe/ir.h>
22 23
23class QVBoxLayout; 24class QVBoxLayout;
24class QHBoxLayout; 25class QHBoxLayout;
25class QGridLayout; 26class QGridLayout;
@@ -122,7 +123,9 @@ protected slots:
122 bool copyFile( const QString & , const QString & ); 123 bool copyFile( const QString & , const QString & );
123 void move(); 124 void move();
124 void fileStatus(); 125 void fileStatus();
125 void doAbout(); 126 void doAbout();
127 void doBeam();
128 void fileBeamFinished( Ir *ir);
126}; 129};
127 130
128#endif // ADVANCEDFM_H 131#endif // ADVANCEDFM_H