Commit 0c88177f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to create only menu for configurating attachment name

parent 885fb739
......@@ -31,4 +31,5 @@ void ConvertSnippetVariableMenuTest::shouldHaveDefaultValues()
{
MessageComposer::ConvertSnippetVariableMenu w(nullptr);
QVERIFY(w.menu());
QVERIFY(!w.onlyMenuForCustomizeAttachmentFileName());
}
......@@ -163,6 +163,16 @@ void ConvertSnippetVariableMenu::initializeMenu()
mMenu->addMenu(miscVariable);
}
bool ConvertSnippetVariableMenu::onlyMenuForCustomizeAttachmentFileName() const
{
return mOnlyMenuForCustomizeAttachmentFileName;
}
void ConvertSnippetVariableMenu::setOnlyMenuForCustomizeAttachmentFileName(bool onlyMenuForCustomizeAttachmentFileName)
{
mOnlyMenuForCustomizeAttachmentFileName = onlyMenuForCustomizeAttachmentFileName;
}
QMenu *ConvertSnippetVariableMenu::menu() const
{
return mMenu;
......
......@@ -37,10 +37,14 @@ public:
~ConvertSnippetVariableMenu();
QMenu *menu() const;
Q_REQUIRED_RESULT bool onlyMenuForCustomizeAttachmentFileName() const;
void setOnlyMenuForCustomizeAttachmentFileName(bool onlyMenuForCustomizeAttachmentFileName);
Q_SIGNALS:
void insertVariable(MessageComposer::ConvertSnippetVariablesUtil::VariableType type);
private:
void initializeMenu();
bool mOnlyMenuForCustomizeAttachmentFileName = false;
QWidget *mParentWidget = nullptr;
QMenu *mMenu = nullptr;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment