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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
mesonium
gajim
Commits
e192882b
Commit
e192882b
authored
4 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Fix mypy errors
parent
21c6be64
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gajim/gtk/filechoosers.py
+6
-5
6 additions, 5 deletions
gajim/gtk/filechoosers.py
gajim/gtk/types.py
+0
-7
0 additions, 7 deletions
gajim/gtk/types.py
with
6 additions
and
12 deletions
gajim/gtk/filechoosers.py
+
6
−
5
View file @
e192882b
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from
typing
import
List
import
os
import
os
import
sys
import
sys
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -27,7 +29,6 @@
...
@@ -27,7 +29,6 @@
from
gajim.common.i18n
import
_
from
gajim.common.i18n
import
_
from
gajim.gtk.const
import
Filter
from
gajim.gtk.const
import
Filter
from
gajim.gtk.types
import
FilterList
# pylint: disable=unused-import
def
_require_native
()
->
bool
:
def
_require_native
()
->
bool
:
...
@@ -85,7 +86,7 @@ def _update_preview(self, filechooser):
...
@@ -85,7 +86,7 @@ def _update_preview(self, filechooser):
class
BaseFileOpenDialog
:
class
BaseFileOpenDialog
:
_title
=
_
(
'
Choose File to Send…
'
)
_title
=
_
(
'
Choose File to Send…
'
)
_filters
=
[
Filter
(
_
(
'
All files
'
),
'
*
'
,
True
)]
# type: FilterList
_filters
=
[
Filter
(
_
(
'
All files
'
),
'
*
'
,
True
)]
class
BaseAvatarChooserDialog
:
class
BaseAvatarChooserDialog
:
...
@@ -96,7 +97,7 @@ class BaseAvatarChooserDialog:
...
@@ -96,7 +97,7 @@ class BaseAvatarChooserDialog:
if
_require_native
():
if
_require_native
():
_filters
=
[
Filter
(
_
(
'
PNG files
'
),
'
*.png
'
,
True
),
_filters
=
[
Filter
(
_
(
'
PNG files
'
),
'
*.png
'
,
True
),
Filter
(
_
(
'
JPEG files
'
),
'
*.jp*g
'
,
False
),
Filter
(
_
(
'
JPEG files
'
),
'
*.jp*g
'
,
False
),
Filter
(
_
(
'
SVG files
'
),
'
*.svg
'
,
False
)]
# type: FilterList
Filter
(
_
(
'
SVG files
'
),
'
*.svg
'
,
False
)]
else
:
else
:
_filters
=
[
Filter
(
_
(
'
Images
'
),
[
'
image/png
'
,
_filters
=
[
Filter
(
_
(
'
Images
'
),
[
'
image/png
'
,
'
image/jpeg
'
,
'
image/jpeg
'
,
...
@@ -106,7 +107,7 @@ class BaseAvatarChooserDialog:
...
@@ -106,7 +107,7 @@ class BaseAvatarChooserDialog:
class
NativeFileChooserDialog
(
Gtk
.
FileChooserNative
,
BaseFileChooser
):
class
NativeFileChooserDialog
(
Gtk
.
FileChooserNative
,
BaseFileChooser
):
_title
=
''
_title
=
''
_filters
=
[]
# type: FilterList
_filters
:
List
[
Filter
]
=
[]
_action
=
Gtk
.
FileChooserAction
.
OPEN
_action
=
Gtk
.
FileChooserAction
.
OPEN
def
__init__
(
self
,
accept_cb
,
cancel_cb
=
None
,
transient_for
=
None
,
def
__init__
(
self
,
accept_cb
,
cancel_cb
=
None
,
transient_for
=
None
,
...
@@ -158,7 +159,7 @@ class NativeAvatarChooserDialog(BaseAvatarChooserDialog, NativeFileChooserDialog
...
@@ -158,7 +159,7 @@ class NativeAvatarChooserDialog(BaseAvatarChooserDialog, NativeFileChooserDialog
class
GtkFileChooserDialog
(
Gtk
.
FileChooserDialog
,
BaseFileChooser
):
class
GtkFileChooserDialog
(
Gtk
.
FileChooserDialog
,
BaseFileChooser
):
_title
=
''
_title
=
''
_filters
=
[]
# type: FilterList
_filters
:
List
[
Filter
]
=
[]
_action
=
Gtk
.
FileChooserAction
.
OPEN
_action
=
Gtk
.
FileChooserAction
.
OPEN
_preivew_size
=
(
200
,
200
)
_preivew_size
=
(
200
,
200
)
...
...
This diff is collapsed.
Click to expand it.
gajim/gtk/types.py
+
0
−
7
View file @
e192882b
...
@@ -13,10 +13,3 @@
...
@@ -13,10 +13,3 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
# Types for typechecking
# Types for typechecking
from
typing
import
ClassVar
from
typing
import
List
from
gajim.gtk.const
import
Filter
FilterList
=
ClassVar
[
List
[
Filter
]]
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