diff --git a/odmtools/gui/frmODMTools.py b/odmtools/gui/frmODMTools.py index 91c3571..777fac7 100755 --- a/odmtools/gui/frmODMTools.py +++ b/odmtools/gui/frmODMTools.py @@ -50,6 +50,8 @@ def __init__(self, **kwargs): wx.Frame.__init__(self, **kwargs) + self.service_manager = ServiceManager() + self.record_service = None series_service = self._init_database() if series_service: @@ -116,9 +118,7 @@ def _init_s_Items(self, parent): def _init_database(self, quit_if_cancel=True): logger.debug("Loading Database...") - self.service_manager = ServiceManager() - self.record_service = None - series_service = None + while True: ## Database connection is valid, therefore proceed through the rest of the program @@ -152,6 +152,29 @@ def _init_database(self, quit_if_cancel=True): return series_service + def onChangeDBConn(self, event): + db_config = frmDBConfig.frmDBConfig(None, self.service_manager, False) + value = db_config.ShowModal() + if value == wx.ID_CANCEL: + return + + newConnection = db_config.panel.getFieldValues() + self.service_manager.set_current_conn_dict(newConnection) + db_config.Destroy() + + if self._init_database(quit_if_cancel=False): + # if editing, stop editing... + if self._ribbon.getEditStatus(): + self.stopEdit(event=None) + + if value == wx.ID_OK: + + series_service = self.createService(newConnection) + self.pnlSelector.resetDB(series_service) + self.refreshConnectionInfo() + self.pnlPlot.clear() + self.dataTable.clear() + def servicesValid(self, service, displayMsg=True): """ @@ -426,28 +449,7 @@ def stopEdit(self, event): def getRecordService(self): return self.record_service - def onChangeDBConn(self, event): - db_config = frmDBConfig.frmDBConfig(None, self.service_manager, False) - value = db_config.ShowModal() - if value == wx.ID_CANCEL: - return - - newConnection = db_config.panel.getFieldValues() - db_config.Destroy() - - if self._init_database(quit_if_cancel=False): - # if editing, stop editing... - if self._ribbon.getEditStatus(): - self.stopEdit(event=None) - - - if value == wx.ID_OK: - series_service = self.createService(newConnection) - self.pnlSelector.resetDB(series_service) - self.refreshConnectionInfo() - self.pnlPlot.clear() - self.dataTable.clear() def createService(self, conn_dict=""): """ diff --git a/odmtools/meta/data.py b/odmtools/meta/data.py index e984e8f..1686672 100644 --- a/odmtools/meta/data.py +++ b/odmtools/meta/data.py @@ -1,5 +1,5 @@ app_name = "ODMTools" -version = "1.2.1_Beta" +version = "1.2.2_Beta" copyright = "Copyright (c) 2013 - 2015, Utah State University. All rights reserved." description = "ODMTools is a python application for managing observational data using the Observations Data Model. " \ "ODMTools allows you to query, visualize, and edit data stored in an Observations Data Model (ODM) database." \ diff --git a/setup/Mac/ODMTools.packproj b/setup/Mac/ODMTools.packproj index 6cff19b..2e01da0 100644 --- a/setup/Mac/ODMTools.packproj +++ b/setup/Mac/ODMTools.packproj @@ -566,9 +566,9 @@ IFPkgDescriptionDescription IFPkgDescriptionTitle - ODMTools_v1.2.1 + ODMTools_v1.2.2 IFPkgDescriptionVersion - 1.2.1 Beta + 1.2.2 Beta Display Information @@ -584,7 +584,7 @@ CFBundleName ODMTools CFBundleShortVersionString - 1.2.1 + 1.2.2 Options @@ -619,7 +619,7 @@ IFPkgFlagPackageSelection 0 Name - ODMTools_v1.2.1-beta_Mac_installer + ODMTools_v1.2.2-beta_Mac_installer Status 1 Type diff --git a/setup/Windows/odmtools_console.iss b/setup/Windows/odmtools_console.iss index c42711e..9df8d6c 100644 --- a/setup/Windows/odmtools_console.iss +++ b/setup/Windows/odmtools_console.iss @@ -2,10 +2,10 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "ODMTools" -#define MyAppVersion "1.2.1_Beta" +#define MyAppVersion "1.2.2_Beta" #define MyAppPublisher "ODM2" #define MyAppURL "https://github.com/ODM2/ODMToolsPython" -#define MyAppExeName "ODMTools_1.2.1_Beta_win32_x86_64_console.exe" +#define MyAppExeName "ODMTools_{#MyAppVersion}_win32_x86_64_console.exe" #define MyAppDir "D:\DEV\ODMToolsPython" [Setup] @@ -37,8 +37,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.1_Beta_win32_x86_64_console\ODMTools_1.2.0_Beta_win32_x86_64_console.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.1_Beta_win32_x86_64_console\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "{#MyAppDir}\setup\Dist\{#MyAppName}_{#MyAppVersion}_win32_x86_64_console\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppDir}\setup\Dist\{#MyAppName}_{#MyAppVersion}_win32_x86_64_console\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] diff --git a/setup/Windows/odmtools_no_console.iss b/setup/Windows/odmtools_no_console.iss index e06cbb6..b87c68c 100644 --- a/setup/Windows/odmtools_no_console.iss +++ b/setup/Windows/odmtools_no_console.iss @@ -2,10 +2,10 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "ODMTools" -#define MyAppVersion "1.2.1_Beta" +#define MyAppVersion "1.2.2_Beta" #define MyAppPublisher "ODM2" #define MyAppURL "https://github.com/ODM2/ODMToolsPython" -#define MyAppExeName "ODMTools_1.2.1_Beta_win32_x86_64.exe" +#define MyAppExeName "{#MyAppName}_{#MyAppVersion}_win32_x86_64.exe" #define MyAppDir "D:\DEV\ODMToolsPython" [Setup] @@ -37,8 +37,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.1_Beta_win32_x86_64\ODMTools_1.2.1_Beta_win32_x86_64.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppDir}\setup\Dist\ODMTools_1.2.1_Beta_win32_x86_64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "{#MyAppDir}\setup\Dist\{#MyAppName}_{#MyAppVersion}_win32_x86_64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppDir}\setup\Dist\{#MyAppName}_{#MyAppVersion}_win32_x86_64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] diff --git a/setup/Windows/odmtools_setup.iss b/setup/Windows/odmtools_setup.iss index 02d0083..faa4f1a 100644 --- a/setup/Windows/odmtools_setup.iss +++ b/setup/Windows/odmtools_setup.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "ODMTools" -#define MyAppVersion "1.2.1_Beta" +#define MyAppVersion "1.2.2_Beta" #define MyAppPublisher "ODM2" #define MyAppURL "https://github.com/ODM2/ODMToolsPython" #define MyAppExeName "ODMTools.exe" @@ -37,7 +37,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "{#MyAppDir}\setup\Windows\ODMTools\ODMTools.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppDir}\setup\Windows\ODMTools\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "{#MyAppDir}\setup\Windows\ODMTools\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files diff --git a/setup/version.txt b/setup/version.txt index 4e2f056..c1a7d33 100644 --- a/setup/version.txt +++ b/setup/version.txt @@ -31,10 +31,10 @@ VSVersionInfo( u'040904b0', [StringStruct(u'CompanyName', u'Utah Water Research Laboratory'), StringStruct(u'ProductName', u'ODMTools'), - StringStruct(u'ProductVersion', u'1.2.1 beta'), + StringStruct(u'ProductVersion', u'1.2.2 beta'), StringStruct(u'InternalName', u'ODMTools'), StringStruct(u'OriginalFilename', u'ODMTools.exe'), - StringStruct(u'FileVersion', u'1.2.1 beta'), + StringStruct(u'FileVersion', u'1.2.2 beta'), StringStruct(u'FileDescription', u'ODMTools is a python application for managing observational data using the Observations Data Model. ODMTools allows you to query, visualize, and edit data stored in an Observations Data Model (ODM) database.ODMTools was originally developed as part of the CUAHSI Hydrologic Information System.'), StringStruct(u'LegalCopyright', u'Copyright (c) 2013, Utah State University. All rights reserved.'), StringStruct(u'LegalTrademarks', u'N/A'),])