diff --git a/AboutDialog.ui b/AboutDialog.ui index 6712b60..f1fbea2 100755 --- a/AboutDialog.ui +++ b/AboutDialog.ui @@ -101,7 +101,7 @@ <item> <widget class="QPushButton" name="cmdClose"> <property name="text"> - <string>Close</string> + <string>&Close</string> </property> </widget> </item> 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 <QDialog> +#include <QMenu> 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 @@ <string>Export picture</string> </property> <property name="text"> - <string>Export</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cmdCopy"> - <property name="text"> - <string>Copy</string> + <string>&Export</string> </property> </widget> </item> @@ -108,7 +101,7 @@ <string>Close</string> </property> <property name="text"> - <string>Close</string> + <string>&Close</string> </property> </widget> </item> 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 @@ <rect> <x>0</x> <y>0</y> - <width>98</width> - <height>28</height> + <width>398</width> + <height>251</height> </rect> </property> <layout class="QVBoxLayout" name="vlProfile"> @@ -175,8 +175,11 @@ </item> <item> <widget class="QPushButton" name="cmdImport"> + <property name="toolTip"> + <string>Import exported file</string> + </property> <property name="text"> - <string>Import copy</string> + <string>&Import...</string> </property> <property name="autoDefault"> <bool>true</bool> @@ -185,8 +188,11 @@ </item> <item> <widget class="QPushButton" name="cmdCloseProfile"> + <property name="toolTip"> + <string>Close profile</string> + </property> <property name="text"> - <string>Close Profile</string> + <string>&Close</string> </property> <property name="autoDefault"> <bool>true</bool> 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 @@ </item> <item> <widget class="QPushButton" name="cmdView"> + <property name="toolTip"> + <string>View savegame</string> + </property> <property name="text"> <string>View</string> </property> @@ -80,6 +83,9 @@ </item> <item> <widget class="QPushButton" name="cmdCopy"> + <property name="toolTip"> + <string>Copy savegame</string> + </property> <property name="text"> <string>Copy</string> </property> @@ -90,6 +96,9 @@ </item> <item> <widget class="QPushButton" name="cmdDelete"> + <property name="toolTip"> + <string>Delete savegame</string> + </property> <property name="text"> <string>Delete</string> </property> 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 @@ <rect> <x>0</x> <y>0</y> - <width>385</width> + <width>459</width> <height>45</height> </rect> </property> @@ -88,6 +88,9 @@ </item> <item> <widget class="QPushButton" name="cmdView"> + <property name="toolTip"> + <string>View picture</string> + </property> <property name="text"> <string>View</string> </property> @@ -98,6 +101,9 @@ </item> <item> <widget class="QPushButton" name="cmdCopy"> + <property name="toolTip"> + <string>Copy picture</string> + </property> <property name="text"> <string>Copy</string> </property> @@ -105,6 +111,9 @@ </item> <item> <widget class="QPushButton" name="cmdExport"> + <property name="toolTip"> + <string>Export picture</string> + </property> <property name="text"> <string>Export</string> </property> @@ -112,6 +121,9 @@ </item> <item> <widget class="QPushButton" name="cmdDelete"> + <property name="toolTip"> + <string>Delete picture</string> + </property> <property name="text"> <string>Delete</string> </property> 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 @@ </property> <widget class="QMenu" name="menuFile"> <property name="title"> - <string>File</string> + <string>&File</string> </property> <addaction name="actionSelect_profile"/> <addaction name="actionExit"/> </widget> <widget class="QMenu" name="menuHelp"> <property name="title"> - <string>Help</string> + <string>&Help</string> </property> <addaction name="actionAbout_gta5sync"/> </widget> <widget class="QMenu" name="menuEdit"> <property name="title"> - <string>Edit</string> + <string>&Edit</string> </property> <widget class="QMenu" name="menuProfile"> <property name="title"> - <string>Profile</string> + <string>&Profile</string> </property> <addaction name="actionSelect_all"/> <addaction name="actionDeselect_all"/> @@ -118,7 +118,7 @@ </widget> <action name="actionAbout_gta5sync"> <property name="text"> - <string>About gta5sync</string> + <string>&About gta5sync</string> </property> <property name="shortcut"> <string>Ctrl+A</string> @@ -126,7 +126,7 @@ </action> <action name="actionExit"> <property name="text"> - <string>Close</string> + <string>&Close</string> </property> <property name="shortcut"> <string>Ctrl+Q</string> @@ -134,7 +134,7 @@ </action> <action name="actionSelect_profile"> <property name="text"> - <string>Select profile</string> + <string>Select &Profile</string> </property> <property name="shortcut"> <string>Ctrl+P</string> @@ -142,7 +142,7 @@ </action> <action name="actionOptions"> <property name="text"> - <string>Options</string> + <string>&Options</string> </property> <property name="shortcut"> <string>Ctrl+O</string> @@ -150,7 +150,7 @@ </action> <action name="actionSelect_all"> <property name="text"> - <string>Select all</string> + <string>Select &All</string> </property> <property name="shortcut"> <string>Ctrl+S</string> @@ -158,15 +158,15 @@ </action> <action name="actionDeselect_all"> <property name="text"> - <string>Deselect all</string> + <string>&Deselect All</string> </property> <property name="shortcut"> - <string>Shift+S</string> + <string>Ctrl+D</string> </property> </action> <action name="actionExport_selected"> <property name="text"> - <string>Export selected</string> + <string>&Export selected</string> </property> <property name="shortcut"> <string>Ctrl+E</string> @@ -174,10 +174,10 @@ </action> <action name="actionDelete_selected"> <property name="text"> - <string>Delete selected</string> + <string>&Remove selected</string> </property> <property name="shortcut"> - <string>Ctrl+D</string> + <string>Ctrl+R</string> </property> </action> </widget>