From 97f791104b455b04872802a03b94f15a345fca07 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Mon, 30 Jan 2012 09:15:54 +0100 Subject: [PATCH] shortcuts for template editing --- src/templates/templatedlg.cpp | 14 +++++++------- src/templates/ticketedit.cpp | 23 +++++++++++------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/templates/templatedlg.cpp b/src/templates/templatedlg.cpp index 2997212..b236540 100644 --- a/src/templates/templatedlg.cpp +++ b/src/templates/templatedlg.cpp @@ -86,27 +86,27 @@ MTemplateEditor::MTemplateEditor(MTemplateStore*s) connect(model,SIGNAL(itemChanged(QStandardItem*)),this,SLOT(changeDescr(QStandardItem*))); QPushButton*p; hl->addLayout(vl2=new QVBoxLayout); - vl2->addWidget(p=new QPushButton(tr("Update Now"))); + vl2->addWidget(p=new QPushButton(tr("&Update Now"))); connect(p,SIGNAL(clicked()),this,SLOT(forceUpdate())); vl2->addSpacing(20); - vl2->addWidget(p=new QPushButton(tr("Add Variant"))); + vl2->addWidget(p=new QPushButton(tr("&Add Variant"))); connect(p,SIGNAL(clicked()),this,SLOT(addItem())); - vl2->addWidget(p=new QPushButton(tr("Delete Variant"))); + vl2->addWidget(p=new QPushButton(tr("&Delete Variant"))); connect(p,SIGNAL(clicked()),this,SLOT(deleteItem())); vl2->addSpacing(20); - vl2->addWidget(p=new QPushButton(tr("Change Flags"))); + vl2->addWidget(p=new QPushButton(tr("Change &Flags"))); connect(p,SIGNAL(clicked()),this,SLOT(changeFlags())); vl2->addSpacing(20); - vl2->addWidget(p=new QPushButton(tr("Save Template..."))); + vl2->addWidget(p=new QPushButton(tr("&Save Template..."))); connect(p,SIGNAL(clicked()),this,SLOT(saveItem())); - vl2->addWidget(p=new QPushButton(tr("Edit Template"))); + vl2->addWidget(p=new QPushButton(tr("&Edit Template"))); connect(p,SIGNAL(clicked()),this,SLOT(editItem())); vl2->addStretch(1); vl->addSpacing(15); vl->addLayout(hl=new QHBoxLayout); hl->addStretch(1); - hl->addWidget(p=new QPushButton(tr("Close"))); + hl->addWidget(p=new QPushButton(tr("&Close"))); connect(p,SIGNAL(clicked()),this,SLOT(accept())); updateView(); diff --git a/src/templates/ticketedit.cpp b/src/templates/ticketedit.cpp index 6cc2844..f75c5d7 100644 --- a/src/templates/ticketedit.cpp +++ b/src/templates/ticketedit.cpp @@ -147,27 +147,26 @@ DEFINE_DPTR(MTicketEditor); MTicketEditor::MTicketEditor(QWidget* parent, Qt::WindowFlags f): QMainWindow(parent, f) { + setWindowTitle(tr("Label Editor")); //menu QMenuBar*mb=menuBar(); QMenu*m=mb->addMenu(tr("&File")); - m->addAction(tr("&Open File..."),this,SLOT(openFile())) - ->setShortcut(QKeySequence(Qt::Key_Control|Qt::Key_O)); - m->addAction(tr("&Save"),this,SLOT(saveFile())) - ->setShortcut(QKeySequence(Qt::Key_Control|Qt::Key_S)); + m->addAction(tr("&Open File..."), this, SLOT(openFile()), tr("Ctrl+O","open file shortcut")); + m->addAction(tr("&Save"), this, SLOT(saveFile()), tr("Ctrl+S","save file shortcut")); m->addAction(tr("Save &as..."),this,SLOT(saveFileAs())); m->addSeparator(); m->addAction(tr("&Close"),this,SLOT(close())); m=mb->addMenu(tr("&Edit")); - QMenu *aim=m->addMenu(tr("Add Item")); - m->addAction(tr("Remove Item"),this,SLOT(delItem())); + QMenu *aim=m->addMenu(tr("&Add Item")); + m->addAction(tr("&Remove Item"),this,SLOT(delItem())); m->addSeparator(); - m->addAction(tr("Add File"),this,SLOT(addFile())); - m->addAction(tr("Remove File"),this,SLOT(delFile())); + m->addAction(tr("Add &File"),this,SLOT(addFile())); + m->addAction(tr("Remove F&ile"),this,SLOT(delFile())); QSignalMapper*map=new QSignalMapper(this); - map->setMapping(aim->addAction(tr("Add Text Item"),map,SLOT(map())),(int)Private::Text); - map->setMapping(aim->addAction(tr("Add Picture Item"),map,SLOT(map())),(int)Private::Picture); - map->setMapping(aim->addAction(tr("Add Barcode Item"),map,SLOT(map())),(int)Private::Barcode); - map->setMapping(aim->addAction(tr("Add Load Font Item"),map,SLOT(map())),(int)Private::LoadFont); + map->setMapping(aim->addAction(tr("Add &Text Item"),map,SLOT(map())),(int)Private::Text); + map->setMapping(aim->addAction(tr("Add &Picture Item"),map,SLOT(map())),(int)Private::Picture); + map->setMapping(aim->addAction(tr("Add &Barcode Item"),map,SLOT(map())),(int)Private::Barcode); + map->setMapping(aim->addAction(tr("Add &Load Font Item"),map,SLOT(map())),(int)Private::LoadFont); connect(map,SIGNAL(mapped(int)),this,SLOT(addItem(int))); //central -- 1.7.2.5