mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
New menu item: Help -> Configuration Folder.
I'm tired of explaining to users where their configuration folder for GoldenDict is. :)
This commit is contained in:
parent
20a12d3e5a
commit
6693aefb3e
|
@ -1228,6 +1228,11 @@ void save( Class const & c ) throw( exError )
|
||||||
renameAtomically( configFile.fileName(), getConfigFileName() );
|
renameAtomically( configFile.fileName(), getConfigFileName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getConfigDir() throw( exError )
|
||||||
|
{
|
||||||
|
return getHomeDir().path() + QDir::separator();
|
||||||
|
}
|
||||||
|
|
||||||
QString getIndexDir() throw( exError )
|
QString getIndexDir() throw( exError )
|
||||||
{
|
{
|
||||||
QDir result = getHomeDir();
|
QDir result = getHomeDir();
|
||||||
|
|
|
@ -424,6 +424,9 @@ Class load() throw( exError );
|
||||||
/// Saves the configuration
|
/// Saves the configuration
|
||||||
void save( Class const & ) throw( exError );
|
void save( Class const & ) throw( exError );
|
||||||
|
|
||||||
|
/// Returns the main configuration directory.
|
||||||
|
QString getConfigDir() throw( exError );
|
||||||
|
|
||||||
/// Returns the index directory, where the indices are to be stored.
|
/// Returns the index directory, where the indices are to be stored.
|
||||||
QString getIndexDir() throw( exError );
|
QString getIndexDir() throw( exError );
|
||||||
|
|
||||||
|
|
|
@ -386,6 +386,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||||
this, SLOT( visitHomepage() ) );
|
this, SLOT( visitHomepage() ) );
|
||||||
connect( ui.visitForum, SIGNAL( activated() ),
|
connect( ui.visitForum, SIGNAL( activated() ),
|
||||||
this, SLOT( visitForum() ) );
|
this, SLOT( visitForum() ) );
|
||||||
|
connect( ui.openConfigFolder, SIGNAL( activated() ),
|
||||||
|
this, SLOT( openConfigFolder() ) );
|
||||||
connect( ui.about, SIGNAL( activated() ),
|
connect( ui.about, SIGNAL( activated() ),
|
||||||
this, SLOT( showAbout() ) );
|
this, SLOT( showAbout() ) );
|
||||||
|
|
||||||
|
@ -2065,6 +2067,11 @@ void MainWindow::visitHomepage()
|
||||||
QDesktopServices::openUrl( QUrl( "http://goldendict.org/" ) );
|
QDesktopServices::openUrl( QUrl( "http://goldendict.org/" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::openConfigFolder()
|
||||||
|
{
|
||||||
|
QDesktopServices::openUrl( QUrl::fromLocalFile( Config::getConfigDir() ) );
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::visitForum()
|
void MainWindow::visitForum()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl( QUrl( "http://goldendict.org/forum/" ) );
|
QDesktopServices::openUrl( QUrl( "http://goldendict.org/forum/" ) );
|
||||||
|
|
|
@ -290,6 +290,7 @@ private slots:
|
||||||
|
|
||||||
void visitHomepage();
|
void visitHomepage();
|
||||||
void visitForum();
|
void visitForum();
|
||||||
|
void openConfigFolder();
|
||||||
void showAbout();
|
void showAbout();
|
||||||
|
|
||||||
void showDictBarNamesTriggered();
|
void showDictBarNamesTriggered();
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>653</width>
|
<width>653</width>
|
||||||
<height>23</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
@ -95,6 +95,8 @@
|
||||||
<addaction name="visitHomepage"/>
|
<addaction name="visitHomepage"/>
|
||||||
<addaction name="visitForum"/>
|
<addaction name="visitForum"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="openConfigFolder"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="about"/>
|
<addaction name="about"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
|
@ -404,6 +406,11 @@
|
||||||
<enum>Qt::WidgetShortcut</enum>
|
<enum>Qt::WidgetShortcut</enum>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="openConfigFolder">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Configuration Folder</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
Loading…
Reference in a new issue