diff -r f19bbd639726 -r 36d140349897 mainwindow.cpp --- a/mainwindow.cpp Thu Jun 21 14:27:46 2007 +0000 +++ b/mainwindow.cpp Mon Jun 25 12:54:19 2007 +0000 @@ -175,6 +175,7 @@ setupViewActions(); setupModeActions(); setupFlagActions(); + setupNetworkActions(); setupSettingsActions(); setupContextMenus(); setupMacros(); @@ -623,7 +624,7 @@ a = new QAction( tr( "Open URL in new tab","Edit menu" ), this); a->setStatusTip (tr( "Open URL in new tab" )); - a->setShortcut (Qt::CTRL+Qt::Key_U ); + //a->setShortcut (Qt::CTRL+Qt::Key_U ); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) ); actionEditOpenURLTab=a; @@ -637,14 +638,23 @@ a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this); a->setStatusTip ( tr( "Edit URL" ) ); - a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U ); - //a->setShortcut ( Qt::Key_U ); + //a->setShortcut (Qt::SHIFT + Qt::CTRL + Qt::Key_U ); + a->setShortcut ( Qt::Key_U ); a->setShortcutContext (Qt::WindowShortcut); actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) ); actionEditURL=a; + a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this); + a->setStatusTip ( tr( "Edit local URL" ) ); + a->setShortcut (Qt::SHIFT + Qt::Key_U ); + a->setShortcutContext (Qt::WindowShortcut); + actionListBranches.append(a); + addAction(a); + connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) ); + actionEditURL=a; + a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); a->setEnabled (false); @@ -1371,6 +1381,28 @@ delete (fo); } +// Network Actions +void Main::setupNetworkActions() +{ + if (!settings.value( "/mainwindow/showTestMenu",false).toBool() ) + return; + QMenu *netMenu = menuBar()->addMenu( "&Network" ); + + QAction *a; + + a = new QAction( "Start TCPserver for MapEditor",this); + //a->setStatusTip ( "Set application to open pdf files")); + a->setShortcut ( Qt::Key_T ); //New TCP server + connect( a, SIGNAL( triggered() ), this, SLOT( networkStartServer() ) ); + netMenu->addAction (a); + + a = new QAction( "Connect MapEditor to server",this); + //a->setStatusTip ( "Set application to open pdf files")); + a->setShortcut ( Qt::Key_C ); // Connect to server + connect( a, SIGNAL( triggered() ), this, SLOT( networkConnect() ) ); + netMenu->addAction (a); +} + // Settings Actions void Main::setupSettingsActions() { @@ -1557,7 +1589,7 @@ branchLinksContextMenu->addAction ( actionEditURL ); branchLinksContextMenu->addAction ( actionEditHeading2URL ); branchLinksContextMenu->addAction ( actionEditBugzilla2URL ); - if (settings.value( "/mainwindow/showTestMenu",true).toBool() ) + if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) { branchLinksContextMenu->addAction ( actionEditFATE2URL ); } @@ -2650,6 +2682,12 @@ currentMapEditor()->editURL(); } +void Main::editLocalURL() +{ + if (currentMapEditor()) + currentMapEditor()->editLocalURL(); +} + void Main::editHeading2URL() { if (currentMapEditor()) @@ -3163,6 +3201,18 @@ } } +void Main::networkStartServer() +{ + MapEditor *me=currentMapEditor(); + if (me) me->newServer(); +} + +void Main::networkConnect() +{ + MapEditor *me=currentMapEditor(); + if (me) me->newServer(); +} + bool Main::settingsPDF() { // Default browser is set in constructor @@ -3591,7 +3641,7 @@ void Main::testFunction1() { if (!currentMapEditor()) return; - currentMapEditor()->testFunction1(); + currentMapEditor()->newServer(); } void Main::testFunction2()