mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +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() );
|
||||
}
|
||||
|
||||
QString getConfigDir() throw( exError )
|
||||
{
|
||||
return getHomeDir().path() + QDir::separator();
|
||||
}
|
||||
|
||||
QString getIndexDir() throw( exError )
|
||||
{
|
||||
QDir result = getHomeDir();
|
||||
|
|
|
@ -424,6 +424,9 @@ Class load() throw( exError );
|
|||
/// Saves the configuration
|
||||
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.
|
||||
QString getIndexDir() throw( exError );
|
||||
|
||||
|
|
|
@ -386,6 +386,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
this, SLOT( visitHomepage() ) );
|
||||
connect( ui.visitForum, SIGNAL( activated() ),
|
||||
this, SLOT( visitForum() ) );
|
||||
connect( ui.openConfigFolder, SIGNAL( activated() ),
|
||||
this, SLOT( openConfigFolder() ) );
|
||||
connect( ui.about, SIGNAL( activated() ),
|
||||
this, SLOT( showAbout() ) );
|
||||
|
||||
|
@ -2065,6 +2067,11 @@ void MainWindow::visitHomepage()
|
|||
QDesktopServices::openUrl( QUrl( "http://goldendict.org/" ) );
|
||||
}
|
||||
|
||||
void MainWindow::openConfigFolder()
|
||||
{
|
||||
QDesktopServices::openUrl( QUrl::fromLocalFile( Config::getConfigDir() ) );
|
||||
}
|
||||
|
||||
void MainWindow::visitForum()
|
||||
{
|
||||
QDesktopServices::openUrl( QUrl( "http://goldendict.org/forum/" ) );
|
||||
|
|
|
@ -290,6 +290,7 @@ private slots:
|
|||
|
||||
void visitHomepage();
|
||||
void visitForum();
|
||||
void openConfigFolder();
|
||||
void showAbout();
|
||||
|
||||
void showDictBarNamesTriggered();
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>653</width>
|
||||
<height>23</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
@ -95,6 +95,8 @@
|
|||
<addaction name="visitHomepage"/>
|
||||
<addaction name="visitForum"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="openConfigFolder"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="about"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
|
@ -404,6 +406,11 @@
|
|||
<enum>Qt::WidgetShortcut</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="openConfigFolder">
|
||||
<property name="text">
|
||||
<string>&Configuration Folder</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
Loading…
Reference in a new issue