actionFileOpen = a;
a = new QAction(tr("&Restore last session", "Edit menu"), this);
- a->setShortcut(Qt::ALT + Qt::Key_R);
+ a->setShortcut(Qt::CTRL + Qt::Key_R);
switchboard.addSwitch("fileMapRestore", shortcutScope, a, tag);
connect(a, SIGNAL(triggered()), this, SLOT(fileRestoreSession()));
fileMenu->addAction(a);
tr("Repeat last export (%1)").arg("-"), this);
switchboard.addSwitch("fileExportLast", shortcutScope, a, tag);
connect(a, SIGNAL(triggered()), this, SLOT(fileExportLast()));
- cloneActionMapEditor(a, Qt::ALT + Qt::Key_E);
+ cloneActionMapEditor(a, Qt::CTRL + Qt::Key_E);
fileExportMenu->addAction(a);
actionFileExportLast = a;
actionListFiles.append(a);
connect(a, SIGNAL(triggered()), this, SLOT(editCopy()));
actionCopy = a;
+ // Multi key shortcuts https://bugreports.qt.io/browse/QTBUG-39127
a = new QAction(QPixmap(":/editcut.png"), tr("Cu&t", "Edit menu"), this);
a->setShortcut(Qt::CTRL + Qt::Key_X);
a->setEnabled(false);
// Add branch by inserting it at selection
a = new QAction(tr("Add branch (insert)", "Edit menu"), this);
- a->setShortcut(Qt::ALT + Qt::Key_A);
- a->setShortcutContext(Qt::WindowShortcut);
switchboard.addSwitch("mapEditAddBranchBefore", shortcutScope, a, tag);
connect(a, SIGNAL(triggered()), this, SLOT(editNewBranchBefore()));
editMenu->addAction(a);
actionLocalURL = a;
a = new QAction(tr("Use heading for URL", "Edit menu"), this);
- a->setShortcut(Qt::ALT + Qt::Key_U);
+ //a->setShortcut(Qt::ALT + Qt::Key_U);
a->setShortcutContext(Qt::ApplicationShortcut);
a->setEnabled(false);
switchboard.addSwitch("mapHeading2URL", shortcutScope, a, tag);
// Only remove branch, not its children
a = new QAction(
tr("Remove only branch and keep its children ", "Edit menu"), this);
- a->setShortcut(Qt::ALT + Qt::Key_X);
+ a->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_X);
connect(a, SIGNAL(triggered()), this, SLOT(editDeleteKeepChildren()));
a->setEnabled(false);
addAction(a);
a = new QAction(QPixmap(":/slideeditor.png"),
tr("Slide editor", "View action"), this);
- a->setShortcut(Qt::SHIFT + Qt::Key_S);
a->setCheckable(true);
viewMenu->addAction(a);
switchboard.addSwitch("mapToggleSlideEditor", shortcutScope, a, tag);
a = new QAction(QPixmap(":/scripteditor.png"),
tr("Script editor", "View action"), this);
- a->setShortcut(Qt::ALT + Qt::Key_S);
+ a->setShortcut(Qt::SHIFT + Qt::Key_S);
a->setCheckable(true);
viewMenu->addAction(a);
switchboard.addSwitch("mapToggleScriptEditor", shortcutScope, a, tag);
actionViewToggleScriptEditor = a;
a = new QAction(QPixmap(), tr("Script output window", "View action"), this);
- a->setShortcut(Qt::ALT + Qt::SHIFT + Qt::Key_S);
+ a->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S);
a->setCheckable(true);
viewMenu->addAction(a);
switchboard.addSwitch("mapToggleScriptOutput", shortcutScope, a, tag);
QAction *a;
a = new QAction("Start TCPserver for MapEditor", this);
- // a->setShortcut ( Qt::ALT + Qt::Key_T );
connect(a, SIGNAL(triggered()), this, SLOT(networkStartServer()));
a = new QAction("Connect MapEditor to server", this);
- // a->setShortcut ( Qt::ALT + Qt::Key_C );
connect(a, SIGNAL(triggered()), this, SLOT(networkConnect()));
}
void Main::setupMacros()
{
- for (int i = 0; i <= 23; i++) {
+ for (int i = 0; i <= 47; i++) {
macroActions[i] = new QAction(this);
macroActions[i]->setData(i);
addAction(macroActions[i]);
macroActions[10]->setShortcut(Qt::Key_F11);
macroActions[11]->setShortcut(Qt::Key_F12);
+ // Shift Modifier
macroActions[12]->setShortcut(Qt::Key_F1 + Qt::SHIFT);
macroActions[13]->setShortcut(Qt::Key_F2 + Qt::SHIFT);
macroActions[14]->setShortcut(Qt::Key_F3 + Qt::SHIFT);
macroActions[21]->setShortcut(Qt::Key_F10 + Qt::SHIFT);
macroActions[22]->setShortcut(Qt::Key_F11 + Qt::SHIFT);
macroActions[23]->setShortcut(Qt::Key_F12 + Qt::SHIFT);
+
+ // Ctrl Modifier
+ macroActions[24]->setShortcut(Qt::Key_F1 + Qt::CTRL);
+ macroActions[25]->setShortcut(Qt::Key_F2 + Qt::CTRL);
+ macroActions[26]->setShortcut(Qt::Key_F3 + Qt::CTRL);
+ macroActions[27]->setShortcut(Qt::Key_F4 + Qt::CTRL);
+ macroActions[28]->setShortcut(Qt::Key_F5 + Qt::CTRL);
+ macroActions[29]->setShortcut(Qt::Key_F6 + Qt::CTRL);
+ macroActions[30]->setShortcut(Qt::Key_F7 + Qt::CTRL);
+ macroActions[31]->setShortcut(Qt::Key_F8 + Qt::CTRL);
+ macroActions[32]->setShortcut(Qt::Key_F9 + Qt::CTRL);
+ macroActions[33]->setShortcut(Qt::Key_F10 + Qt::CTRL);
+ macroActions[34]->setShortcut(Qt::Key_F11 + Qt::CTRL);
+ macroActions[35]->setShortcut(Qt::Key_F12 + Qt::CTRL);
+
+ // Shift + Ctrl Modifier
+ macroActions[36]->setShortcut(Qt::Key_F1 + Qt::CTRL + Qt::SHIFT);
+ macroActions[37]->setShortcut(Qt::Key_F2 + Qt::CTRL + Qt::SHIFT);
+ macroActions[38]->setShortcut(Qt::Key_F3 + Qt::CTRL + Qt::SHIFT);
+ macroActions[39]->setShortcut(Qt::Key_F4 + Qt::CTRL + Qt::SHIFT);
+ macroActions[40]->setShortcut(Qt::Key_F5 + Qt::CTRL + Qt::SHIFT);
+ macroActions[41]->setShortcut(Qt::Key_F6 + Qt::CTRL + Qt::SHIFT);
+ macroActions[42]->setShortcut(Qt::Key_F7 + Qt::CTRL + Qt::SHIFT);
+ macroActions[43]->setShortcut(Qt::Key_F8 + Qt::CTRL + Qt::SHIFT);
+ macroActions[44]->setShortcut(Qt::Key_F9 + Qt::CTRL + Qt::SHIFT);
+ macroActions[45]->setShortcut(Qt::Key_F10 + Qt::CTRL + Qt::SHIFT);
+ macroActions[46]->setShortcut(Qt::Key_F11 + Qt::CTRL + Qt::SHIFT);
+ macroActions[47]->setShortcut(Qt::Key_F12 + Qt::CTRL + Qt::SHIFT);
}
void Main::setupToolbars()
}
editorChanged();
vm->emitShowSelection();
- statusBar()->showMessage("Loaded " + fn, statusbarTime);
+ statusBar()->showMessage(tr("Loaded %1").arg(fn), statusbarTime);
}
}
return; // avoid saving twice...
}
+ // Notification, that we start to save
+ statusBar()->showMessage(tr("Saving %1...").arg(m->getFilePath()),
+ statusbarTime);
+ qApp->processEvents();
+
if (m->save(savemode) == File::Success) {
statusBar()->showMessage(tr("Saved %1").arg(m->getFilePath()),
statusbarTime);
m->cycleTaskStatus();
}
-void Main::editTaskResetDeltaPrio() // FIXME-2 With multiple selections enabled, old selection should be restored
+void Main::editTaskResetDeltaPrio()
{
- QList <Task*> tasks;
- QList <VymModel*> models;
+ QList <BranchItem*> taskBranches;
+ Task *task;
for (int i = 0; i < taskModel->count(); i++)
{
- Task *task = taskModel->getTask(i);
- if (taskEditor->taskVisible(task) && task->getPriorityDelta() != 0) {
- tasks << task;
- VymModel *m = task->getBranch()->getModel();
- if (!models.contains(m))
- models << m;
- }
+ task = taskModel->getTask(i);
+ if (taskEditor->taskVisible(task) && task->getPriorityDelta() != 0)
+ taskBranches << task->getBranch();
}
- foreach (VymModel *model, models) {
- // Unselect everything
- model->unselectAll();
-
- // Select all branches, where tasks whill be updated
- foreach (Task *task, tasks) {
- BranchItem *bi = task->getBranch();
- if (bi->getModel() == model) {
- model->selectToggle(bi);
- }
- }
-
- // Bulk update all branches in this model
- model->setTaskPriorityDelta(0);
- }
+ foreach (BranchItem *bi, taskBranches)
+ bi->getModel()->setTaskPriorityDelta(0, bi);
}
void Main::editTaskSleepN()
desc = " - ";
}
actionFileExportLast->setText(
- tr("Export in last used format (%1) to: %2", "status tip")
+ tr("Export in last used format: %1\n%2", "status tip")
.arg(desc)
.arg(dest));
QString docname;
if (locale.left(2) == "es")
docname = "vym_es.pdf";
+ else if (locale.left(2) == "fr")
+ docname = "vym_fr.pdf";
else
docname = "vym.pdf";
int i = -1;
if (action) {
QString s = macros.get();
- QString shift;
+ QString modifiers;
- i = action->data().toInt() + 1;
+ i = action->data().toInt();
- if (i > 12) {
- shift = "shift_";
+ if (i > 11 && i < 24) {
+ modifiers = "shift_";
i = i - 12;
+ } else if (i > 23 && i < 36) {
+ modifiers = "ctrl_";
+ i = i - 24;
+ } else if (i > 35) {
+ modifiers = "ctrl_shift_";
+ i = i - 36;
}
- s += QString("macro_%1f%2();").arg(shift).arg(i);
+ // Function keys start at "1", not "0"
+ i++;
+
+ s += QString("macro_%1f%2();").arg(modifiers).arg(i);
VymModel *m = currentModel();
if (m)