mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 14:29:54 +08:00
bugfix
1. Do not add additional actions if QTextEdit has selection; 2. Add Q_DECL_OVERRIDE to supress the warnings. 3. Fix getTemplateCssUrl().
This commit is contained in:
parent
30ee1e92d8
commit
882faeb5eb
@ -436,10 +436,15 @@ bool VConfigManager::outputDefaultEditorStyle() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The URL will be used in the Web page.
|
||||||
QString VConfigManager::getTemplateCssUrl()
|
QString VConfigManager::getTemplateCssUrl()
|
||||||
{
|
{
|
||||||
QString cssPath = getStyleConfigFolder() + QDir::separator() + m_templateCss + ".css";
|
QString cssPath = getStyleConfigFolder() +
|
||||||
if (!QFile::exists(cssPath)) {
|
QDir::separator() +
|
||||||
|
m_templateCss + ".css";
|
||||||
|
QUrl cssUrl = QUrl::fromLocalFile(cssPath);
|
||||||
|
cssPath = cssUrl.toString();
|
||||||
|
if (!QFile::exists(cssUrl.toLocalFile())) {
|
||||||
// Specified css not exists.
|
// Specified css not exists.
|
||||||
if (m_templateCss == "default") {
|
if (m_templateCss == "default") {
|
||||||
bool ret = outputDefaultCssStyle();
|
bool ret = outputDefaultCssStyle();
|
||||||
|
@ -25,10 +25,10 @@ public:
|
|||||||
inline const VNotebook *currentNotebook() const;
|
inline const VNotebook *currentNotebook() const;
|
||||||
|
|
||||||
// Implementations for VNavigationMode.
|
// Implementations for VNavigationMode.
|
||||||
void registerNavigation(QChar p_majorKey);
|
void registerNavigation(QChar p_majorKey) Q_DECL_OVERRIDE;
|
||||||
void showNavigation();
|
void showNavigation() Q_DECL_OVERRIDE;
|
||||||
void hideNavigation();
|
void hideNavigation() Q_DECL_OVERRIDE;
|
||||||
bool handleKeyNavigation(int p_key, bool &p_succeed);
|
bool handleKeyNavigation(int p_key, bool &p_succeed) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void currentDirectoryChanged(VDirectory *p_directory);
|
void currentDirectoryChanged(VDirectory *p_directory);
|
||||||
|
@ -509,6 +509,7 @@ void VEdit::contextMenuEvent(QContextMenuEvent *p_event)
|
|||||||
|
|
||||||
const QList<QAction *> actions = menu->actions();
|
const QList<QAction *> actions = menu->actions();
|
||||||
|
|
||||||
|
if (!textCursor().hasSelection()) {
|
||||||
VEditTab *editTab = dynamic_cast<VEditTab *>(parent());
|
VEditTab *editTab = dynamic_cast<VEditTab *>(parent());
|
||||||
V_ASSERT(editTab);
|
V_ASSERT(editTab);
|
||||||
if (editTab->getIsEditMode()) {
|
if (editTab->getIsEditMode()) {
|
||||||
@ -542,6 +543,7 @@ void VEdit::contextMenuEvent(QContextMenuEvent *p_event)
|
|||||||
menu->insertSeparator(actions[0]);
|
menu->insertSeparator(actions[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
menu->exec(p_event->globalPos());
|
menu->exec(p_event->globalPos());
|
||||||
delete menu;
|
delete menu;
|
||||||
|
@ -52,10 +52,10 @@ public:
|
|||||||
VEditWindow *getCurrentWindow() const;
|
VEditWindow *getCurrentWindow() const;
|
||||||
|
|
||||||
// Implementations for VNavigationMode.
|
// Implementations for VNavigationMode.
|
||||||
void registerNavigation(QChar p_majorKey);
|
void registerNavigation(QChar p_majorKey) Q_DECL_OVERRIDE;
|
||||||
void showNavigation();
|
void showNavigation() Q_DECL_OVERRIDE;
|
||||||
void hideNavigation();
|
void hideNavigation() Q_DECL_OVERRIDE;
|
||||||
bool handleKeyNavigation(int p_key, bool &p_succeed);
|
bool handleKeyNavigation(int p_key, bool &p_succeed) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void curTabStatusChanged(const VFile *p_file, const VEditTab *p_editTab, bool p_editMode);
|
void curTabStatusChanged(const VFile *p_file, const VEditTab *p_editTab, bool p_editMode);
|
||||||
|
@ -35,10 +35,10 @@ public:
|
|||||||
inline const VDirectory *currentDirectory() const;
|
inline const VDirectory *currentDirectory() const;
|
||||||
|
|
||||||
// Implementations for VNavigationMode.
|
// Implementations for VNavigationMode.
|
||||||
void registerNavigation(QChar p_majorKey);
|
void registerNavigation(QChar p_majorKey) Q_DECL_OVERRIDE;
|
||||||
void showNavigation();
|
void showNavigation() Q_DECL_OVERRIDE;
|
||||||
void hideNavigation();
|
void hideNavigation() Q_DECL_OVERRIDE;
|
||||||
bool handleKeyNavigation(int p_key, bool &p_succeed);
|
bool handleKeyNavigation(int p_key, bool &p_succeed) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void fileClicked(VFile *p_file, OpenFileMode mode = OpenFileMode::Read);
|
void fileClicked(VFile *p_file, OpenFileMode mode = OpenFileMode::Read);
|
||||||
|
@ -26,10 +26,10 @@ public:
|
|||||||
void showPopup() Q_DECL_OVERRIDE;
|
void showPopup() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
// Implementations for VNavigationMode.
|
// Implementations for VNavigationMode.
|
||||||
void registerNavigation(QChar p_majorKey);
|
void registerNavigation(QChar p_majorKey) Q_DECL_OVERRIDE;
|
||||||
void showNavigation();
|
void showNavigation() Q_DECL_OVERRIDE;
|
||||||
void hideNavigation();
|
void hideNavigation() Q_DECL_OVERRIDE;
|
||||||
bool handleKeyNavigation(int p_key, bool &p_succeed);
|
bool handleKeyNavigation(int p_key, bool &p_succeed) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void curNotebookChanged(VNotebook *p_notebook);
|
void curNotebookChanged(VNotebook *p_notebook);
|
||||||
|
@ -17,10 +17,10 @@ public:
|
|||||||
VOutline(QWidget *parent = 0);
|
VOutline(QWidget *parent = 0);
|
||||||
|
|
||||||
// Implementations for VNavigationMode.
|
// Implementations for VNavigationMode.
|
||||||
void registerNavigation(QChar p_majorKey);
|
void registerNavigation(QChar p_majorKey) Q_DECL_OVERRIDE;
|
||||||
void showNavigation();
|
void showNavigation() Q_DECL_OVERRIDE;
|
||||||
void hideNavigation();
|
void hideNavigation() Q_DECL_OVERRIDE;
|
||||||
bool handleKeyNavigation(int p_key, bool &p_succeed);
|
bool handleKeyNavigation(int p_key, bool &p_succeed) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void outlineItemActivated(const VAnchor &anchor);
|
void outlineItemActivated(const VAnchor &anchor);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user