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:
Tvangeste 2011-07-10 09:36:43 +02:00
parent 20a12d3e5a
commit 6693aefb3e
5 changed files with 24 additions and 1 deletions

View file

@ -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();

View file

@ -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 );

View file

@ -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/" ) );

View file

@ -290,6 +290,7 @@ private slots:
void visitHomepage();
void visitForum();
void openConfigFolder();
void showAbout();
void showDictBarNamesTriggered();

View file

@ -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>&amp;Configuration Folder</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>