Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
03626508
Commit
03626508
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
fix typo; also saner defaults [only first time] for last_save_dir and last_send_dir
parent
396c66f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/helpers.py
+19
-12
19 additions, 12 deletions
src/common/helpers.py
src/filetransfers_window.py
+5
-4
5 additions, 4 deletions
src/filetransfers_window.py
src/vcard.py
+2
-12
2 additions, 12 deletions
src/vcard.py
with
26 additions
and
28 deletions
src/common/helpers.py
+
19
−
12
View file @
03626508
## common/helpers.py
##
## Contributors for this file:
## - Yann Le Boulanger <asterix@lagaule.org>
## - Nikos Kouremenos <kourem@gmail.com>
##
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Nikos Kouremenos <nkour@jabber.org>
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
## Copyright (C) 2005
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
## Norman Rasmussen <norman@rasmussen.co.za>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
...
...
@@ -538,7 +531,7 @@ def decode_string(string):
def
get_windows_reg_env
(
varname
,
default
=
''
):
'''
asks for paths commonly used but not exposed as ENVs
in Windows 2003 those are:
in
english
Windows 2003 those are:
'
AppData
'
= %USERPROFILE%\Application Data (also an ENV)
'
Desktop
'
= %USERPROFILE%\Desktop
'
Favorites
'
= %USERPROFILE%\Favorites
...
...
@@ -568,7 +561,7 @@ def get_windows_reg_env(varname, default=''):
r
'
Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
'
)
try
:
val
=
str
(
win32api
.
RegQueryValueEx
(
rkey
,
varname
)[
0
])
val
=
win32api
.
ExpandEnvironmentStrings
(
v
)
# expand using environ
val
=
win32api
.
ExpandEnvironmentStrings
(
v
al
)
# expand using environ
except
:
pass
finally
:
...
...
@@ -578,3 +571,17 @@ r'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders')
def
get_my_pictures_path
():
'''
windows-only atm. [Unix lives in the past]
'''
return
get_windows_reg_env
(
'
My Pictures
'
)
def
get_desktop_path
():
if
os
.
name
==
'
nt
'
:
path
=
get_windows_reg_env
(
'
Desktop
'
)
else
:
path
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
'
~
'
),
'
Desktop
'
)
return
path
def
get_documents_path
():
if
os
.
name
==
'
nt
'
:
path
=
get_windows_reg_env
(
'
Personal
'
)
else
:
path
=
os
.
path
.
expanduser
(
'
~
'
)
return
path
This diff is collapsed.
Click to expand it.
src/filetransfers_window.py
+
5
−
4
View file @
03626508
## filetransfers_window.py
##
##
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
## Copyright (C) 2005-2006 Yann Le Boulanger <asterix@lagaule.org>
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
## Copyright (C) 2005
## Dimitur Kirov <dkirov@gmail.com>
...
...
@@ -253,7 +251,7 @@ _('Connection with peer cannot be established.'))
if
last_send_dir
and
os
.
path
.
isdir
(
last_send_dir
):
dialog
.
set_current_folder
(
last_send_dir
)
else
:
dialog
.
set_current_folder
(
gajim
.
HOME_DIR
)
dialog
.
set_current_folder
(
helpers
.
get_documents_path
()
)
file_props
=
{}
while
True
:
response
=
dialog
.
run
()
...
...
@@ -343,10 +341,13 @@ _('Connection with peer cannot be established.'))
dialog
.
connect
(
'
confirm-overwrite
'
,
self
.
confirm_overwrite_cb
,
file_props
)
gtk28
=
True
print
last_save_dir
if
last_save_dir
and
os
.
path
.
isdir
(
last_save_dir
):
dialog
.
set_current_folder
(
last_save_dir
)
print
'
set last save
'
,
last_save_dir
else
:
dialog
.
set_current_folder
(
gajim
.
HOME_DIR
)
dialog
.
set_current_folder
(
helpers
.
get_desktop_path
())
print
'
set desktop
'
,
helpers
.
get_desktop_path
()
while
True
:
response
=
dialog
.
run
()
if
response
==
gtk
.
RESPONSE_OK
:
...
...
This diff is collapsed.
Click to expand it.
src/vcard.py
+
2
−
12
View file @
03626508
## vcard.py (has VcardWindow class)
##
## Contributors for this file:
## - Yann Le Boulanger <asterix@lagaule.org>
## - Nikos Kouremenos <kourem@gmail.com>
##
## Copyright (C) 2003-2004 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Copyright (C) 2005 Yann Le Boulanger <asterix@lagaule.org>
## Vincent Hanquez <tab@snarc.org>
## Nikos Kouremenos <nkour@jabber.org>
## Dimitur Kirov <dkirov@gmail.com>
## Travis Shirk <travis@pobox.com>
## Norman Rasmussen <norman@rasmussen.co.za>
## Copyright (C) 2003-2006 Yann Le Boulanger <asterix@lagaule.org>
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment