Skip to content

Commit

Permalink
v1.4.1 released: fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
docblue committed Sep 24, 2018
1 parent 7ede89f commit e830134
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chfsgui/chfsgui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ QTPLUGIN += qsvg
PRECOMPILED_HEADER = preCompile.h
CONFIG += c++11

DEFINES += "GUIVER=0"
DEFINES += "GUIVER=1"

SOURCES += main.cpp\
mainwindow.cpp \
Expand Down
18 changes: 17 additions & 1 deletion chfsgui/monitorwgt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <QTextBrowser>
#include <QRegularExpression>
#include <QDesktopServices>
#include <QMenu>

LogWidget::LogWidget(QWidget *parent) : QWidget(parent)
{
Expand All @@ -12,14 +13,29 @@ LogWidget::LogWidget(QWidget *parent) : QWidget(parent)
logBtn->setToolTip("点击打开操作日志目录");
connect(logBtn,&QLabel::linkActivated,[=](){
extern QString logPathRoot;
QDesktopServices::openUrl(QUrl(logPathRoot));
QDesktopServices::openUrl(QUrl::fromLocalFile(logPathRoot));
});

QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
mainLayout->setSpacing(2);
mainLayout->addWidget( logBtn );
mainLayout->addWidget( logList );

createActions();
}

void LogWidget::contextMenuEvent(QContextMenuEvent *event)
{
menu->exec(event->globalPos());
}

void LogWidget::createActions()
{
menu = new QMenu;
menu->addAction(tr("清空显示"),this,[=](){
logList->clear();
});
}

void LogWidget::paintEvent(QPaintEvent *)
Expand Down
6 changes: 5 additions & 1 deletion chfsgui/monitorwgt.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ public slots:
};



class QMenu;
class LogWidget : public QWidget
{
Q_OBJECT
public:
explicit LogWidget(QWidget *parent = 0);
void paintEvent(QPaintEvent *) override;
void contextMenuEvent(QContextMenuEvent *event) override;
QListWidget* logList;
private:
void createActions();
QMenu* menu;
signals:

public slots:
Expand Down
5 changes: 4 additions & 1 deletion chfsgui/uicomponents/configwgt/cfgrules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ CfgRules::CfgRules(QWidget *parent) : CfgBase(parent)
{
createContents();

initAccList();

//
// connections
Expand Down Expand Up @@ -52,6 +51,10 @@ CfgRules::CfgRules(QWidget *parent) : CfgBase(parent)
}
}
});

// 初始化

initAccList();
}

void CfgRules::initAccList()
Expand Down
2 changes: 1 addition & 1 deletion chfsgui/uicomponents/configwgt/cfgsharedpathwgt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ void CfgSharedpathWgt::onPathChanging()
g_settings.setValue(PARAM_PATH, dir);
}
}else{
QDesktopServices::openUrl(QUrl(_editPath->text()));
QDesktopServices::openUrl(QUrl::fromLocalFile(_editPath->text()));
}
}

0 comments on commit e830134

Please sign in to comment.