Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Merge branch 'master' of ssh://digit.mahou.co.uk/home/kirinji/repos/xestiaab
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 13 Aug 2015 10:22:26 +0000 (11:22 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 13 Aug 2015 10:22:26 +0000 (11:22 +0100)
source/common/mime.cpp
source/common/mime.h
source/common/uuid.cpp
source/frmMain.cpp
source/main.cpp

index 5db593c..8c59be2 100644 (file)
@@ -19,7 +19,7 @@ wxString GetMIME(wxString FilenameInc){
     
     // TODO: Sort out Win32.
     
-#elif defined(__APPLE__)
+#else
     
 #include <stdio.h>
     
@@ -50,7 +50,9 @@ wxString GetMIME(wxString FilenameInc){
     
     MIMEResult.Trim();
     
-#else
+#endif
+    
+/*#else
     
 #include <magic.h>
     
@@ -76,7 +78,7 @@ wxString GetMIME(wxString FilenameInc){
     MIMEResult = wxString::FromUTF8(MIMEType);
     magic_close(MagicCookie);
     
-#endif
+#endif*/
     
     return MIMEResult;
     
index 60481d5..4fc0cb5 100644 (file)
@@ -1,7 +1,7 @@
 #include <wx/wx.h>
 
-#ifndef MIME_H
-#define MIME_H
+#ifndef MIMEGEN_H
+#define MIMEGEN_H
 
 wxString GetMIME(wxString FilenameInc);
 
index 4ff8d1d..f3603b1 100644 (file)
@@ -2,7 +2,7 @@
 
 wxString GenerateUUID()
 {
-    
+
 #if defined(__WIN32__)
     UUID UUIDData;
     UuidCreate(&UUIDData);
@@ -11,35 +11,35 @@ wxString GenerateUUID()
     wxString Result(UUIDStr);
 #elif defined(__HAIKU__)
     
-#elif defined(__APPLE__)
-    
-    wxString Result;
-    
 #else
     
-#include <ossp/uuid++.hh>
+#include <stdio.h>
+    
+    wxString Result;
     
-    uuid_t *uuid;
-    uuid_create(&uuid);
-    char *strdata;
+    FILE *uuid_hdl = popen("uuidgen", "r");
     
-    //strdata = ;
+    if (uuid_hdl == NULL) {
+       return Result;
+    }
     
-    strdata = NULL;
+    char strdata[64];
+    std::string uuidout;
     
-    uuid_make(uuid, UUID_MAKE_V4);
-    uuid_export(uuid, UUID_FMT_STR, &strdata, NULL);
-    uuid_destroy(uuid);
+    size_t readsize;
+    int size = 0;
+    int maxsize = 63;
     
-    wxString Result = wxString::FromUTF8(strdata);
+    while (fgets(strdata, sizeof(strdata), uuid_hdl) != NULL){
+       uuidout.append(strdata);
+    }
     
-    delete strdata;
-    strdata = NULL;
+    pclose(uuid_hdl);
     
 #endif
     
     return Result;
-    
+        
 }
 
 bool CheckUUID(wxString UUIDInc)
index 8e6ec60..c062c15 100644 (file)
@@ -1210,15 +1210,26 @@ void frmMain::ShowContactEditorEdit( wxCommandEvent& event )
 }
 
 void frmMain::RefreshAddressBook( wxCommandEvent& event ){
-    
-    // TODO: Check Account Type.
+   
+    // Check if ActiveAccount is empty. If not then check if
+    // account type is not local otherwise continue.
     
     if (!ActiveAccount.IsEmpty()){
-        
-        frmActivityMgr *frameActMgr = static_cast<frmActivityMgr*>(ActMgrPtr);
-        frameActMgr->AddTask(3, wxT(""), ActiveAccount,
-                             wxT(""), wxT(""), wxT(""), wxT(""));
-        
+   
+       if (ActiveAccountType != wxT("Local")){
+        
+               // Account type is not local.
+       
+               frmActivityMgr *frameActMgr = static_cast<frmActivityMgr*>(ActMgrPtr);
+               frameActMgr->AddTask(3, wxT(""), ActiveAccount,
+                                    wxT(""), wxT(""), wxT(""), wxT(""));
+        
+       } else {
+       
+               wxMessageBox(_("The refresh address book command is not supported with this type of account."), wxT("Not supported for this type of account"));
+       
+       }
+       
     }
     
 }
index ed4e656..249c5a7 100644 (file)
@@ -26,19 +26,18 @@ IMPLEMENT_APP(XestiaABApp);
 bool XestiaABApp::OnInit()
 {
 
-       // Check that on Win32 systems that.
+       // Setup the locale.
 
-#if defined(__WIN32__)
+       wxLocale locale;
+       locale.Init(wxLANGUAGE_DEFAULT, wxLOCALE_LOAD_DEFAULT);
 
-#include <xestiacc.h>
+#if defined(__WIN32__)
 
-       XCCVer XCCRequiredVer;
-       XCCRequiredVer.MajorVer = 1;
-       XCCRequiredVer.MinorVer = 0;
+       // Check that the minimum version of Xestia Common Components is installed on the system.
 
-       XCCVer XCCRetrievedVer = GetXCCLibraryVersion();
+#include <xestiaccdll.h>
 
-       if (XCCRetrievedVer < XCCRequiredVer){
+       if (!CheckXCCVersion(1, 0, 0)){
                MessageBox(0, L"The version of Xestia Common Components installed is an older version not supported by this version of Xestia Address Book.\n\nPlease visit http://xestia.co.uk/commoncomponents and follow the page instructions to download the version required.", L"Older version of Xestia Common Components installed", MB_OK|MB_ICONSTOP);
                this->Exit();
        }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy