resolving merge conflicts
This commit is contained in:
@@ -36,8 +36,8 @@ ConfigWindow::ConfigWindow(QWidget* parent)
|
||||
: QTabWidget(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
const int size = GlobalValues::buttonBaseSize() * 12;
|
||||
setMinimumSize(size, size);
|
||||
setMinimumSize(GlobalValues::buttonBaseSize() * 15,
|
||||
GlobalValues::buttonBaseSize() * 12);
|
||||
setWindowIcon(QIcon(":img/app/flameshot.svg"));
|
||||
setWindowTitle(tr("Configuration"));
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ void GeneneralConf::changeSavePath()
|
||||
QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
|
||||
if (!path.isEmpty()) {
|
||||
m_savePath->setText(path);
|
||||
ConfigHandler().setSaveAfterCopyPath(path);
|
||||
ConfigHandler().setSavePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ ShortcutsWidget::ShortcutsWidget(QWidget* parent)
|
||||
#endif
|
||||
|
||||
m_layout = new QVBoxLayout(this);
|
||||
m_layout->setAlignment(Qt::AlignHCenter);
|
||||
m_layout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
m_shortcuts = m_config.shortcuts();
|
||||
initInfoTable();
|
||||
@@ -90,10 +90,13 @@ void ShortcutsWidget::initInfoTable()
|
||||
const auto default_key_sequence = current_shortcut.at(2);
|
||||
m_table->setItem(i, 0, new QTableWidgetItem(description));
|
||||
|
||||
const auto key_sequence = identifier.isEmpty()
|
||||
? default_key_sequence
|
||||
: m_config.shortcut(identifier);
|
||||
QTableWidgetItem* item = new QTableWidgetItem(key_sequence);
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
QTableWidgetItem* item =
|
||||
new QTableWidgetItem(nativeOSHotKeyText(m_shortcuts.at(i).at(2)));
|
||||
#else
|
||||
QTableWidgetItem* item = new QTableWidgetItem(m_shortcuts.at(i).at(2));
|
||||
#endif
|
||||
item->setTextAlignment(Qt::AlignCenter);
|
||||
m_table->setItem(i, 1, item);
|
||||
|
||||
@@ -117,10 +120,8 @@ void ShortcutsWidget::initInfoTable()
|
||||
// adjust size
|
||||
m_table->resizeColumnsToContents();
|
||||
m_table->resizeRowsToContents();
|
||||
m_table->setMinimumWidth(400);
|
||||
m_table->setMaximumWidth(600);
|
||||
|
||||
m_table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
|
||||
m_table->horizontalHeader()->setMinimumSectionSize(200);
|
||||
m_table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
m_table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding,
|
||||
QSizePolicy::Expanding);
|
||||
}
|
||||
@@ -145,8 +146,14 @@ void ShortcutsWidget::slotShortcutCellClicked(int row, int col)
|
||||
}
|
||||
|
||||
if (m_config.setShortcut(shortcutName, shortcutValue.toString())) {
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
QTableWidgetItem* item = new QTableWidgetItem(
|
||||
nativeOSHotKeyText(shortcutValue.toString()));
|
||||
#else
|
||||
QTableWidgetItem* item =
|
||||
new QTableWidgetItem(shortcutValue.toString());
|
||||
#endif
|
||||
item->setTextAlignment(Qt::AlignCenter);
|
||||
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
|
||||
m_table->setItem(row, col, item);
|
||||
@@ -155,3 +162,16 @@ void ShortcutsWidget::slotShortcutCellClicked(int row, int col)
|
||||
delete setShortcutDialog;
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
const QString& ShortcutsWidget::nativeOSHotKeyText(const QString& text)
|
||||
{
|
||||
m_res = text;
|
||||
m_res.replace("Ctrl+", "⌘");
|
||||
m_res.replace("Alt+", "⌥");
|
||||
m_res.replace("Meta+", "⌃");
|
||||
m_res.replace("Shift+", "⇧");
|
||||
return m_res;
|
||||
}
|
||||
#endif
|
||||
@@ -36,11 +36,19 @@ public:
|
||||
|
||||
private:
|
||||
void initInfoTable();
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
const QString& nativeOSHotKeyText(const QString& text);
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
void slotShortcutCellClicked(int, int);
|
||||
|
||||
private:
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
QString m_res;
|
||||
#endif
|
||||
ConfigHandler m_config;
|
||||
QTableWidget* m_table;
|
||||
QVBoxLayout* m_layout;
|
||||
|
||||
@@ -51,22 +51,34 @@ QMap<QString, QString> StrftimeChooserWidget::m_buttonData{
|
||||
{ QT_TR_NOOP("Century (00-99)"), "%C" },
|
||||
{ QT_TR_NOOP("Year (00-99)"), "%y" },
|
||||
{ QT_TR_NOOP("Year (2000)"), "%Y" },
|
||||
#ifndef Q_OS_WIN
|
||||
// TODO - fix localized names on windows (ex. Cyrillic)
|
||||
{ QT_TR_NOOP("Month Name (jan)"), "%b" },
|
||||
{ QT_TR_NOOP("Month Name (january)"), "%B" },
|
||||
#endif
|
||||
{ QT_TR_NOOP("Month (01-12)"), "%m" },
|
||||
{ QT_TR_NOOP("Week Day (1-7)"), "%u" },
|
||||
{ QT_TR_NOOP("Week (01-53)"), "%V" },
|
||||
#ifndef Q_OS_WIN
|
||||
// TODO - fix localized names on windows (ex. Cyrillic)
|
||||
{ QT_TR_NOOP("Day Name (mon)"), "%a" },
|
||||
{ QT_TR_NOOP("Day Name (monday)"), "%A" },
|
||||
#endif
|
||||
{ QT_TR_NOOP("Day (01-31)"), "%d" },
|
||||
{ QT_TR_NOOP("Day of Month (1-31)"), "%e" },
|
||||
{ QT_TR_NOOP("Day (001-366)"), "%j" },
|
||||
#ifndef Q_OS_WIN
|
||||
// TODO - fix localized names on windows (ex. Cyrillic)
|
||||
{ QT_TR_NOOP("Time (%H-%M-%S)"), "%T" },
|
||||
{ QT_TR_NOOP("Time (%H-%M)"), "%R" },
|
||||
#endif
|
||||
{ QT_TR_NOOP("Hour (00-23)"), "%H" },
|
||||
{ QT_TR_NOOP("Hour (01-12)"), "%I" },
|
||||
{ QT_TR_NOOP("Minute (00-59)"), "%M" },
|
||||
{ QT_TR_NOOP("Second (00-59)"), "%S" },
|
||||
#ifndef Q_OS_WIN
|
||||
// TODO - fix localized names on windows (ex. Cyrillic)
|
||||
{ QT_TR_NOOP("Full Date (%m/%d/%y)"), "%D" },
|
||||
#endif
|
||||
{ QT_TR_NOOP("Full Date (%Y-%m-%d)"), "%F" },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user