adjust ui to guidelines

This commit is contained in:
Rafael 2016-04-08 16:55:28 +02:00
parent c46a616511
commit 59b8ba8835
15 changed files with 103 additions and 68 deletions

View File

@ -101,7 +101,7 @@
<item>
<widget class="QPushButton" name="cmdClose">
<property name="text">
<string>Close</string>
<string>&amp;Close</string>
</property>
</widget>
</item>

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -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

View File

@ -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>&amp;Export</string>
</property>
</widget>
</item>
@ -108,7 +101,7 @@
<string>Close</string>
</property>
<property name="text">
<string>Close</string>
<string>&amp;Close</string>
</property>
</widget>
</item>

View File

@ -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)");

View File

@ -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*)");

View File

@ -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>&amp;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>&amp;Close</string>
</property>
<property name="autoDefault">
<bool>true</bool>

View File

@ -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;
}
}

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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>

View File

@ -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()

View File

@ -83,24 +83,24 @@
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
<string>&amp;File</string>
</property>
<addaction name="actionSelect_profile"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
<string>&amp;Help</string>
</property>
<addaction name="actionAbout_gta5sync"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
<string>Edit</string>
<string>&amp;Edit</string>
</property>
<widget class="QMenu" name="menuProfile">
<property name="title">
<string>Profile</string>
<string>&amp;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>&amp;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>&amp;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 &amp;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>&amp;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 &amp;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>&amp;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>&amp;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>&amp;Remove selected</string>
</property>
<property name="shortcut">
<string>Ctrl+D</string>
<string>Ctrl+R</string>
</property>
</action>
</widget>