diff --git a/config.cc b/config.cc index c8537a19..eebc0759 100644 --- a/config.cc +++ b/config.cc @@ -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(); diff --git a/config.hh b/config.hh index 5089f33c..59031c88 100644 --- a/config.hh +++ b/config.hh @@ -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 ); diff --git a/mainwindow.cc b/mainwindow.cc index 9a6d5baf..6ce45716 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -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/" ) ); diff --git a/mainwindow.hh b/mainwindow.hh index 4657f92e..740a884b 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -290,6 +290,7 @@ private slots: void visitHomepage(); void visitForum(); + void openConfigFolder(); void showAbout(); void showDictBarNamesTriggered(); diff --git a/mainwindow.ui b/mainwindow.ui index ef59fe25..6731339d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -61,7 +61,7 @@ 0 0 653 - 23 + 21 @@ -95,6 +95,8 @@ + + @@ -404,6 +406,11 @@ Qt::WidgetShortcut + + + &Configuration Folder + +