diff --git a/AboutDialog.ui b/AboutDialog.ui index 6712b60..f1fbea2 100755 --- a/AboutDialog.ui +++ b/AboutDialog.ui @@ -101,7 +101,7 @@ - Close + &Close diff --git a/PictureCopy.cpp b/PictureCopy.cpp index f47ce38..e97e56a 100755 --- a/PictureCopy.cpp +++ b/PictureCopy.cpp @@ -43,7 +43,8 @@ fileDialogPreSave: fileDialog.setOption(QFileDialog::DontConfirmOverwrite, true); fileDialog.setDefaultSuffix(""); fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint); - fileDialog.setWindowTitle(PictureDialog::tr("Copy picture")); + fileDialog.setWindowTitle(PictureDialog::tr("Export picture for Import...")); + fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("&Export")); QStringList filters; filters << PictureDialog::tr("Snapmatic pictures (PGTA*)"); @@ -65,11 +66,11 @@ fileDialogPreSave: if (QFile::exists(selectedFile)) { - if (QMessageBox::Yes == QMessageBox::warning(parent, PictureDialog::tr("Copy picture"), PictureDialog::tr("Overwrite %1 with current Snapmatic picture?").arg("\""+selectedFile+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) + if (QMessageBox::Yes == QMessageBox::warning(parent, PictureDialog::tr("Export picture for Import"), PictureDialog::tr("Overwrite %1 with current Snapmatic picture?").arg("\""+selectedFile+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) { if (!QFile::remove(selectedFile)) { - QMessageBox::warning(parent, PictureDialog::tr("Copy picture"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\"")); + QMessageBox::warning(parent, PictureDialog::tr("Export picture for Import"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\"")); goto fileDialogPreSave; } } @@ -82,13 +83,13 @@ fileDialogPreSave: bool isCopied = QFile::copy(picPath, selectedFile); if (!isCopied) { - QMessageBox::warning(parent, PictureDialog::tr("Copy picture"), PictureDialog::tr("Failed to copy current Snapmatic picture")); + QMessageBox::warning(parent, PictureDialog::tr("Export picture for Import"), PictureDialog::tr("Failed to copy current Snapmatic picture")); goto fileDialogPreSave; } } else { - QMessageBox::warning(parent, PictureDialog::tr("Copy picture"), PictureDialog::tr("No valid file is selected")); + QMessageBox::warning(parent, PictureDialog::tr("Export picture for Import"), PictureDialog::tr("No valid file is selected")); goto fileDialogPreSave; } } diff --git a/PictureDialog.cpp b/PictureDialog.cpp index 13b239e..17ec637 100755 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -53,10 +53,17 @@ PictureDialog::PictureDialog(ProfileDatabase *profileDB, QWidget *parent) : locY = ""; locZ = ""; smpic = 0; + + // Export menu + exportMenu = new QMenu(this); + exportMenu->addAction(tr("Export as &picture...", "Export as picture"), this, SLOT(exportSnapmaticPicture())); + exportMenu->addAction(tr("Export for &import...", "Export for import"), this, SLOT(copySnapmaticPicture())); + ui->cmdExport->setMenu(exportMenu); } PictureDialog::~PictureDialog() { + delete exportMenu; delete ui; } @@ -161,12 +168,12 @@ void PictureDialog::on_cmdClose_clicked() this->close(); } -void PictureDialog::on_cmdExport_clicked() +void PictureDialog::exportSnapmaticPicture() { PictureExport::exportPicture(this, smpic); } -void PictureDialog::on_cmdCopy_clicked() +void PictureDialog::copySnapmaticPicture() { PictureCopy::copyPicture(this, picPath); } diff --git a/PictureDialog.h b/PictureDialog.h index 7c56065..5a85bad 100755 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -22,6 +22,7 @@ #include "SnapmaticPicture.h" #include "ProfileDatabase.h" #include +#include namespace Ui { class PictureDialog; @@ -39,9 +40,9 @@ public slots: void playerNameUpdated(); private slots: + void copySnapmaticPicture(); + void exportSnapmaticPicture(); void on_cmdClose_clicked(); - void on_cmdExport_clicked(); - void on_cmdCopy_clicked(); void on_labPicture_mouseDoubleClicked(); private: @@ -57,6 +58,7 @@ private: QString locX; QString locY; QString locZ; + QMenu *exportMenu; }; #endif // PICTUREDIALOG_H diff --git a/PictureDialog.ui b/PictureDialog.ui index ec10591..a396926 100755 --- a/PictureDialog.ui +++ b/PictureDialog.ui @@ -91,14 +91,7 @@ Export picture - Export - - - - - - - Copy + &Export @@ -108,7 +101,7 @@ Close - Close + &Close diff --git a/PictureExport.cpp b/PictureExport.cpp index 9499a0c..631fc1c 100755 --- a/PictureExport.cpp +++ b/PictureExport.cpp @@ -41,8 +41,9 @@ fileDialogPreSave: fileDialog.setOption(QFileDialog::DontUseNativeDialog, true); fileDialog.setOption(QFileDialog::DontConfirmOverwrite, true); fileDialog.setDefaultSuffix("suffix"); - fileDialog.setWindowTitle(PictureDialog::tr("Export picture")); fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint); + fileDialog.setWindowTitle(PictureDialog::tr("Export picture...")); + fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("&Export")); QStringList filters; filters << PictureDialog::tr("JPEG picture (*.jpg)"); diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 7c36ed3..c0398b7 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -275,8 +275,9 @@ fileDialogPreOpen: fileDialog.setViewMode(QFileDialog::Detail); fileDialog.setAcceptMode(QFileDialog::AcceptOpen); fileDialog.setOption(QFileDialog::DontUseNativeDialog, true); - fileDialog.setWindowTitle(tr("Import copy")); fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint); + fileDialog.setWindowTitle(tr("Import...")); + fileDialog.setLabelText(QFileDialog::Accept, tr("Import")); QStringList filters; filters << tr("All profile files (SGTA* PGTA*)"); diff --git a/ProfileInterface.ui b/ProfileInterface.ui index 5ad5a70..d43bbac 100755 --- a/ProfileInterface.ui +++ b/ProfileInterface.ui @@ -105,8 +105,8 @@ 0 0 - 98 - 28 + 398 + 251 @@ -175,8 +175,11 @@ + + Import exported file + - Import copy + &Import... true @@ -185,8 +188,11 @@ + + Close profile + - Close Profile + &Close true diff --git a/SavegameCopy.cpp b/SavegameCopy.cpp index 0380341..ab819d0 100755 --- a/SavegameCopy.cpp +++ b/SavegameCopy.cpp @@ -43,7 +43,8 @@ fileDialogPreSave: fileDialog.setOption(QFileDialog::DontConfirmOverwrite, true); fileDialog.setDefaultSuffix(""); fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint); - fileDialog.setWindowTitle(SavegameWidget::tr(("Copy savegame"))); + fileDialog.setWindowTitle(SavegameWidget::tr(("Export Savegame..."))); + fileDialog.setLabelText(QFileDialog::Accept, SavegameWidget::tr("&Export")); QStringList filters; filters << SavegameWidget::tr("Savegame files (SGTA*)"); @@ -65,11 +66,11 @@ fileDialogPreSave: if (QFile::exists(selectedFile)) { - if (QMessageBox::Yes == QMessageBox::warning(parent, SavegameWidget::tr("Copy savegame"), SavegameWidget::tr("Overwrite %1 with current savegame?").arg("\""+selectedFile+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) + if (QMessageBox::Yes == QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Overwrite %1 with current Savegame?").arg("\""+selectedFile+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) { if (!QFile::remove(selectedFile)) { - QMessageBox::warning(parent, SavegameWidget::tr("Copy savegame"), SavegameWidget::tr("Failed to overwrite %1 with current savegame").arg("\""+selectedFile+"\"")); + QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to overwrite %1 with current Savegame").arg("\""+selectedFile+"\"")); goto fileDialogPreSave; } } @@ -82,13 +83,13 @@ fileDialogPreSave: bool isCopied = QFile::copy(sgdPath, selectedFile); if (!isCopied) { - QMessageBox::warning(parent, SavegameWidget::tr("Copy savegame"), SavegameWidget::tr("Failed to copy current savegame")); + QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to copy current Savegame")); goto fileDialogPreSave; } } else { - QMessageBox::warning(parent, SavegameWidget::tr("Copy savegame"), SavegameWidget::tr("No valid file is selected")); + QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("No valid file is selected")); goto fileDialogPreSave; } } diff --git a/SavegameWidget.cpp b/SavegameWidget.cpp index f6fc9e5..4f4aa2c 100755 --- a/SavegameWidget.cpp +++ b/SavegameWidget.cpp @@ -166,22 +166,22 @@ void SavegameWidget::savegameSelected() void SavegameWidget::contextMenuEvent(QContextMenuEvent *ev) { QMenu contextMenu(this); - contextMenu.addAction(tr("View"), this, SLOT(on_cmdView_clicked())); - contextMenu.addAction(tr("Copy"), this, SLOT(on_cmdCopy_clicked())); - contextMenu.addAction(tr("Delete"), this, SLOT(on_cmdDelete_clicked())); + contextMenu.addAction(tr("&View"), this, SLOT(on_cmdView_clicked())); + contextMenu.addAction(tr("&Export"), this, SLOT(on_cmdCopy_clicked())); + contextMenu.addAction(tr("&Remove"), this, SLOT(on_cmdDelete_clicked())); if (ui->cbSelected->isVisible()) { contextMenu.addSeparator(); - if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected())); } - if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Deselect"), this, SLOT(savegameSelected())); } - contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); - contextMenu.addAction(tr("Deselect all"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Shift+S")); + if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Select"), this, SLOT(savegameSelected())); } + if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Deselect"), this, SLOT(savegameSelected())); } + contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); + contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D")); } else { contextMenu.addSeparator(); - contextMenu.addAction(tr("Select"), this, SLOT(savegameSelected())); - contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); + contextMenu.addAction(tr("&Select"), this, SLOT(savegameSelected())); + contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); } contextMenu.exec(ev->globalPos()); setStyleSheet(styleSheet()); // fix multi highlight bug diff --git a/SavegameWidget.ui b/SavegameWidget.ui index 125540c..0901718 100755 --- a/SavegameWidget.ui +++ b/SavegameWidget.ui @@ -73,6 +73,9 @@ + + View savegame + View @@ -80,6 +83,9 @@ + + Copy savegame + Copy @@ -90,6 +96,9 @@ + + Delete savegame + Delete diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index 3d66be1..ed92a0f 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -175,23 +175,25 @@ void SnapmaticWidget::pictureSelected() void SnapmaticWidget::contextMenuEvent(QContextMenuEvent *ev) { QMenu contextMenu(this); - contextMenu.addAction(tr("View"), this, SLOT(on_cmdView_clicked())); - contextMenu.addAction(tr("Copy"), this, SLOT(on_cmdCopy_clicked())); - contextMenu.addAction(tr("Export"), this, SLOT(on_cmdExport_clicked())); - contextMenu.addAction(tr("Delete"), this, SLOT(on_cmdDelete_clicked())); + QMenu exportMenu(tr("&Export"), this); + exportMenu.addAction(tr("Export as &picture...", "Export as picture"), this, SLOT(on_cmdExport_clicked())); + exportMenu.addAction(tr("Export for &import...", "Export for import"), this, SLOT(on_cmdCopy_clicked())); + contextMenu.addAction(tr("&View"), this, SLOT(on_cmdView_clicked())); + contextMenu.addMenu(&exportMenu); + contextMenu.addAction(tr("&Remove"), this, SLOT(on_cmdDelete_clicked())); if (ui->cbSelected->isVisible()) { contextMenu.addSeparator(); - if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Select"), this, SLOT(pictureSelected())); } - if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("Deselect"), this, SLOT(pictureSelected())); } - contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); - contextMenu.addAction(tr("Deselect all"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Shift+S")); + if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Select"), this, SLOT(pictureSelected())); } + if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Deselect"), this, SLOT(pictureSelected())); } + contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); + contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D")); } else { contextMenu.addSeparator(); - contextMenu.addAction(tr("Select"), this, SLOT(pictureSelected())); - contextMenu.addAction(tr("Select all"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); + contextMenu.addAction(tr("&Select"), this, SLOT(pictureSelected())); + contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+S")); } contextMenu.exec(ev->globalPos()); setStyleSheet(styleSheet()); // fix multi highlight bug diff --git a/SnapmaticWidget.ui b/SnapmaticWidget.ui index cd81558..23bb4cd 100755 --- a/SnapmaticWidget.ui +++ b/SnapmaticWidget.ui @@ -6,7 +6,7 @@ 0 0 - 385 + 459 45 @@ -88,6 +88,9 @@ + + View picture + View @@ -98,6 +101,9 @@ + + Copy picture + Copy @@ -105,6 +111,9 @@ + + Export picture + Export @@ -112,6 +121,9 @@ + + Delete picture + Delete diff --git a/UserInterface.cpp b/UserInterface.cpp index 669101f..f57271e 100755 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -43,7 +43,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D ui->menuProfile->setEnabled(false); defaultWindowTitle = this->windowTitle(); - this->setWindowTitle(defaultWindowTitle.arg(tr("Select profile"))); + this->setWindowTitle(defaultWindowTitle.arg(tr("Select Profile"))); // init settings QSettings SyncSettings("Syping", "gta5sync"); @@ -97,7 +97,7 @@ void UserInterface::setupProfileUi(QStringList GTAV_Profiles) { if (GTAV_Profiles.length() == 0) { - QPushButton *reloadBtn = new QPushButton(tr("Reload"), ui->swSelection); + QPushButton *reloadBtn = new QPushButton(tr("&Reload"), ui->swSelection); reloadBtn->setObjectName("Reload"); reloadBtn->setAutoDefault(true); ui->swSelection->layout()->addWidget(reloadBtn); @@ -124,7 +124,7 @@ void UserInterface::setupProfileUi(QStringList GTAV_Profiles) QSpacerItem *closeButtonSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); footerLayout->addSpacerItem(closeButtonSpacer); - QPushButton *cmdClose = new QPushButton(tr("Close"), ui->swSelection); + QPushButton *cmdClose = new QPushButton(tr("&Close"), ui->swSelection); cmdClose->setObjectName("cmdClose"); cmdClose->setAutoDefault(true); footerLayout->addWidget(cmdClose); @@ -178,7 +178,7 @@ void UserInterface::closeProfile() profileUI->deleteLater(); delete profileUI; } - this->setWindowTitle(defaultWindowTitle.arg(tr("Select profile"))); + this->setWindowTitle(defaultWindowTitle.arg(tr("Select Profile"))); } UserInterface::~UserInterface() diff --git a/UserInterface.ui b/UserInterface.ui index 7b3e933..d16dc1a 100755 --- a/UserInterface.ui +++ b/UserInterface.ui @@ -83,24 +83,24 @@ - File + &File - Help + &Help - Edit + &Edit - Profile + &Profile @@ -118,7 +118,7 @@ - About gta5sync + &About gta5sync Ctrl+A @@ -126,7 +126,7 @@ - Close + &Close Ctrl+Q @@ -134,7 +134,7 @@ - Select profile + Select &Profile Ctrl+P @@ -142,7 +142,7 @@ - Options + &Options Ctrl+O @@ -150,7 +150,7 @@ - Select all + Select &All Ctrl+S @@ -158,15 +158,15 @@ - Deselect all + &Deselect All - Shift+S + Ctrl+D - Export selected + &Export selected Ctrl+E @@ -174,10 +174,10 @@ - Delete selected + &Remove selected - Ctrl+D + Ctrl+R