← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~mahfiaz/openlp/opendatafolder into lp:openlp

 

mahfiaz has proposed merging lp:~mahfiaz/openlp/opendatafolder into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/opendatafolder/+merge/49180
-- 
https://code.launchpad.net/~mahfiaz/openlp/opendatafolder/+merge/49180
Your team OpenLP Core is requested to review the proposed merge of lp:~mahfiaz/openlp/opendatafolder into lp:openlp.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2011-02-09 05:04:12 +0000
+++ openlp/core/ui/mainwindow.py	2011-02-10 05:17:52 +0000
@@ -216,6 +216,9 @@
         self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
             u':/tools/tools_add.png')
         mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
+        self.ToolsOpenDataFolder = icon_action(mainWindow, u'ToolsOpenDataFolder',
+            u':/general/general_open.png')
+        mainWindow.actionList.add_action(self.ToolsOpenDataFolder, u'Tools')
         self.settingsPluginListItem = icon_action(mainWindow,
             u'settingsPluginListItem', u':/system/settings_plugin_list.png')
         mainWindow.actionList.add_action(self.settingsPluginListItem,
@@ -276,6 +279,7 @@
             self.SettingsLanguageMenu.menuAction(), None,
             self.SettingsShortcutsItem, self.SettingsConfigureItem))
         add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
+        add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
         add_actions(self.HelpMenu, (self.HelpDocumentationItem,
             self.HelpOnlineHelpItem, None, self.HelpWebSiteItem,
             self.HelpAboutItem))
@@ -433,6 +437,10 @@
             translate('OpenLP.MainWindow', 'Add &Tool...'))
         self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
             'Add an application to the list of tools.'))
+        self.ToolsOpenDataFolder.setText(
+            translate('OpenLP.MainWindow', 'Open &Data Folder...'))
+        self.ToolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
+            'Open the folder where songs, bibles and other data resides.'))
         self.ModeDefaultItem.setText(
             translate('OpenLP.MainWindow', '&Default'))
         self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
@@ -515,6 +523,8 @@
             QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
         QtCore.QObject.connect(self.HelpAboutItem,
             QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
+        QtCore.QObject.connect(self.ToolsOpenDataFolder,
+            QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
         QtCore.QObject.connect(self.settingsPluginListItem,
             QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
         QtCore.QObject.connect(self.SettingsConfigureItem,
@@ -703,6 +713,13 @@
         self.pluginForm.load()
         self.pluginForm.exec_()
 
+    def onToolsOpenDataFolderClicked(self):
+        """
+        Open data folder
+        """
+        path = AppLocation.get_data_path()
+        QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
+
     def onSettingsConfigureItemClicked(self):
         """
         Show the Settings dialog


Follow ups