Skip to content

Commit

Permalink
Replaced CheckButton with Button
Browse files Browse the repository at this point in the history
  • Loading branch information
rilian-la-te committed Apr 30, 2015
1 parent d4db185 commit d6c6b70
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 33 deletions.
13 changes: 7 additions & 6 deletions applets/core/launchbar/config.ui
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,18 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="check-folder">
<property name="label" translatable="yes">Add all displayed files after one is selected</property>
<object class="GtkButton" id="add-all-files">
<property name="label" translatable="yes">Add all displayed files</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="relief">none</property>
<signal name="clicked" handler="on_add_all_files_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
Expand Down
46 changes: 22 additions & 24 deletions applets/core/launchbar/launchbar-config.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ namespace LaunchBar
AppChooserWidget choose_desktop;
[GtkChild (name = "choose-file")]
FileChooserWidget choose_file;
[GtkChild (name = "check-folder")]
CheckButton check_folder;
[GtkChild (name = "box-popover")]
Box box_popover;
public ConfigDialog(Bar launchbar)
Expand Down Expand Up @@ -56,28 +54,7 @@ namespace LaunchBar
private void on_file_activated()
{
var uri = choose_file.get_uri();
if (check_folder.active)
{
uri = choose_file.get_current_folder_uri();
var path = choose_file.get_current_folder();
try
{
Dir dir = Dir.open(path);
for (var ch = dir.read_name(); ch!= null; ch = dir.read_name())
{
var ch_uri = Filename.to_uri(path+"/"+ch);
add_uri(ch_uri,false);
}
return;
} catch (GLib.Error e)
{
print("%s %s\n",e.message, path);
show_error(_("Failed to add directory. Adding this file."));
add_uri(uri);
}
}
else
add_uri(uri);
add_uri(uri);
}
[GtkCallback]
private void on_application_activated()
Expand Down Expand Up @@ -139,6 +116,27 @@ namespace LaunchBar
}
}
}
[GtkCallback]
private void on_add_all_files_clicked()
{
var uri = choose_file.get_current_folder_uri();
var path = choose_file.get_current_folder();
try
{
Dir dir = Dir.open(path);
for (var ch = dir.read_name(); ch!= null; ch = dir.read_name())
{
var ch_uri = Filename.to_uri(path+"/"+ch);
add_uri(ch_uri,false);
}
return;
} catch (GLib.Error e)
{
print("%s %s\n",e.message, path);
show_error(_("Failed to add directory content.\n Adding current directory as launcher."));
add_uri(uri);
}
}
private void update_ids_from_widget()
{
launchbar.ids = populate_ids_from_widget();
Expand Down
20 changes: 18 additions & 2 deletions po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: lxpanel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-01 01:55+0600\n"
"PO-Revision-Date: 2015-05-01 01:55+0600\n"
"POT-Creation-Date: 2015-05-01 02:47+0600\n"
"PO-Revision-Date: 2015-05-01 02:48+0600\n"
"Last-Translator: Andriy Grytsenko <[email protected]>\n"
"Language-Team: Russian <[email protected]>\n"
"Language: ru\n"
Expand Down Expand Up @@ -226,6 +226,7 @@ msgstr "Центр управления"
#: ../applets/core/menumodel/menu-maker.vala:156
#: ../applets/core/menumodel/menu-maker.vala:159
#: ../applets/core/launchbar/config.ui:39
#: ../applets/core/launchbar/config.ui:38
msgid "Applications"
msgstr "Приложения"

Expand Down Expand Up @@ -296,6 +297,7 @@ msgstr "Показывать пассивные значки"
#: ../applets/core/launchbar/launchbar.vala:188
#: ../applets/core/launchbar/launchbar-config.vala:95
#: ../applets/core/launchbar/launchbar-config.vala:97
#: ../applets/core/launchbar/launchbar-config.vala:74
msgid "Quicklaunch already contains this application.\n"
msgstr "На этом апплете уже есть такое приложение.\n"

Expand All @@ -305,6 +307,7 @@ msgstr "Выберите файл для добавления на панель

#: ../applets/core/launchbar/launchbar.vala:212
#: ../applets/core/launchbar/launchbar-config.vala:53
#: ../applets/core/launchbar/launchbar-config.vala:51
msgid "Quicklaunch already contains this URI.\n"
msgstr "Панель запуска уже содержит этот адрес.\n"

Expand Down Expand Up @@ -864,6 +867,7 @@ msgid "Failed to add directory. Adding this file."
msgstr "Ошибка добавления каталога. Добавляю только этот файл."

#: ../applets/core/launchbar/config.ui:34
#: ../applets/core/launchbar/config.ui:33
msgid "Add launcher from installed applications"
msgstr "Добавить установленное приложение"

Expand All @@ -887,6 +891,18 @@ msgstr "Имя"
msgid "Add all displayed files after one is selected"
msgstr "Добавить все показываемые файлы при выборе одного."

#: ../applets/core/launchbar/launchbar-config.vala:136
msgid ""
"Failed to add directory content.\n"
" Adding current directory as launcher."
msgstr ""
"Ошибка добавления содержимого каталога.\n"
"Добавляется показываемая директория в качестве кнопки запуска."

#: ../applets/core/launchbar/config.ui:63
msgid "Add all displayed files"
msgstr "Добавить все показываемые файлы."

#~ msgid "SimplePanel"
#~ msgstr "SimplePanel"

Expand Down
16 changes: 15 additions & 1 deletion po/vala-panel.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-01 01:55+0600\n"
"POT-Creation-Date: 2015-05-01 02:47+0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -218,6 +218,7 @@ msgstr ""
#: ../applets/core/menumodel/menu-maker.vala:156
#: ../applets/core/menumodel/menu-maker.vala:159
#: ../applets/core/launchbar/config.ui:39
#: ../applets/core/launchbar/config.ui:38
msgid "Applications"
msgstr ""

Expand Down Expand Up @@ -288,6 +289,7 @@ msgstr ""
#: ../applets/core/launchbar/launchbar.vala:188
#: ../applets/core/launchbar/launchbar-config.vala:95
#: ../applets/core/launchbar/launchbar-config.vala:97
#: ../applets/core/launchbar/launchbar-config.vala:74
msgid "Quicklaunch already contains this application.\n"
msgstr ""

Expand All @@ -297,6 +299,7 @@ msgstr ""

#: ../applets/core/launchbar/launchbar.vala:212
#: ../applets/core/launchbar/launchbar-config.vala:53
#: ../applets/core/launchbar/launchbar-config.vala:51
msgid "Quicklaunch already contains this URI.\n"
msgstr ""

Expand Down Expand Up @@ -852,6 +855,7 @@ msgid "Failed to add directory. Adding this file."
msgstr ""

#: ../applets/core/launchbar/config.ui:34
#: ../applets/core/launchbar/config.ui:33
msgid "Add launcher from installed applications"
msgstr ""

Expand All @@ -874,3 +878,13 @@ msgstr ""
#: ../applets/core/launchbar/config.ui:64
msgid "Add all displayed files after one is selected"
msgstr ""

#: ../applets/core/launchbar/launchbar-config.vala:136
msgid ""
"Failed to add directory content.\n"
" Adding current directory as launcher."
msgstr ""

#: ../applets/core/launchbar/config.ui:63
msgid "Add all displayed files"
msgstr ""

0 comments on commit d6c6b70

Please sign in to comment.