/[winpt]/trunk/Src/wptClipEditDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptClipEditDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 104 by twoaday, Mon Nov 21 12:06:59 2005 UTC revision 105 by twoaday, Wed Nov 30 10:22:00 2005 UTC
# Line 17  Line 17 
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
   
20  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
# Line 98  load_clipboard_from_file (HWND dlg) Line 97  load_clipboard_from_file (HWND dlg)
97      if (GetOpenFileName (&open)) {      if (GetOpenFileName (&open)) {
98          if( (size=get_file_size (file)) > MAX_CLIPTEXT_SIZE) {                if( (size=get_file_size (file)) > MAX_CLIPTEXT_SIZE) {      
99              id = msg_box (dlg, _("The file you want to add is very large.\n"              id = msg_box (dlg, _("The file you want to add is very large.\n"
100                                   "Still proceed?"), _("Clipboard"), MB_INFO|MB_YESNO);                                         "Still proceed?"), _("Clipboard"),
101              if (id == IDNO)                                MB_INFO|MB_YESNO);
102                if (id == IDNO)
103                  return -1;                  return -1;
104          }          }
105          fp = fopen (file, "rb");          fp = fopen (file, "rb");
106          if (!fp) {          if (!fp) {
107              msg_box (dlg, winpt_strerror (WPTERR_FILE_OPEN), _("Clipboard"), MB_ERR);              msg_box (dlg, winpt_strerror (WPTERR_FILE_OPEN),
108                         _("Clipboard"), MB_ERR);
109              return FALSE;              return FALSE;
110          }          }
111          p = new char[size+1];          p = new char[size+1];
# Line 151  save_clipboard_to_file (HWND dlg) Line 152  save_clipboard_to_file (HWND dlg)
152          }          }
153          fp = fopen (file, "wb");          fp = fopen (file, "wb");
154          if (!fp) {          if (!fp) {
155              msg_box (dlg, winpt_strerror (WPTERR_FILE_CREAT), _("Clipboard"), MB_ERR);              msg_box (dlg, winpt_strerror (WPTERR_FILE_CREAT),
156                         _("Clipboard"), MB_ERR);
157              return FALSE;              return FALSE;
158          }          }
159          /* XXX: there is a NUL-byte at the end. */          /* XXX: there is a NUL-byte at the end. */
160          nbytes = SendDlgItemMessage (dlg, IDC_CLIPEDIT_CLIPTEXT2, WM_GETTEXTLENGTH, 0, 0);          nbytes = SendDlgItemMessage (dlg, IDC_CLIPEDIT_CLIPTEXT2,
161                                         WM_GETTEXTLENGTH, 0, 0);
162          if (nbytes > 0) {          if (nbytes > 0) {
163              p = new char[nbytes+1];              p = new char[nbytes+1];
164              if (!p)              if (!p)
165                  BUG (NULL);                  BUG (NULL);
166              GetDlgItemText (dlg, IDC_CLIPEDIT_CLIPTEXT2, p, nbytes);              GetDlgItemText (dlg, IDC_CLIPEDIT_CLIPTEXT2, p, nbytes);
167              fwrite (p, 1, nbytes, fp);              fwrite (p, 1, nbytes, fp);
168                
169          }                    }          
170          fclose (fp);          fclose (fp);
171          free_if_alloc (p);          free_if_alloc (p);
# Line 181  clip_edit_dlg_proc (HWND dlg, UINT msg, Line 185  clip_edit_dlg_proc (HWND dlg, UINT msg,
185          SetDlgItemText (dlg, IDC_CLIPEDIT_CLEAR, _("Clea&r"));          SetDlgItemText (dlg, IDC_CLIPEDIT_CLEAR, _("Clea&r"));
186          SetDlgItemText (dlg, IDC_CLIPEDIT_LOAD, _("&Load"));              SetDlgItemText (dlg, IDC_CLIPEDIT_LOAD, _("&Load"));    
187          SetDlgItemText (dlg, IDC_CLIPEDIT_SAVE, _("&Save"));          SetDlgItemText (dlg, IDC_CLIPEDIT_SAVE, _("&Save"));
188          SetDlgItemText (dlg, IDC_CLIPEDIT_QUOTE, _("Add quotes"));          SetDlgItemText (dlg, IDC_CLIPEDIT_QUOTE, _("Add quotes"));
189                    SetDlgItemText (dlg, IDOK, _("&Exit"));
190    
191          load_clipboard (dlg);          load_clipboard (dlg);
192          center_window (dlg, NULL);          center_window (dlg, NULL);
193          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
# Line 242  clip_edit_dlg_proc (HWND dlg, UINT msg, Line 247  clip_edit_dlg_proc (HWND dlg, UINT msg,
247            
248      return FALSE;      return FALSE;
249  }  }
   

Legend:
Removed from v.104  
changed lines
  Added in v.105

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26