summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-03-01 15:59:46 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-03-01 15:59:46 (GMT)
commit251534965c8fe8d3942e22b23b30de577f5c8297 (patch)
tree5403f62cc6f34d861acc7dbc74a5193b932df7fc
parentd3f758cf0f0aa631a600a16b163d8dd013b5be73 (diff)
added empty carts checkbox and cmd line option
use german in gui git-svn-id: https://svn.helsinki.at/rhimport/trunk@21 7c65635b-ec39-4f67-a626-873dbafdd612
-rwxr-xr-xrhimport21
-rw-r--r--rhimport.glade24
2 files changed, 27 insertions, 18 deletions
diff --git a/rhimport b/rhimport
index ee1f552..46794b6 100755
--- a/rhimport
+++ b/rhimport
@@ -38,23 +38,26 @@ my $DB = "rivendell";
my $HELP = 0;
my $FILE = "";
my $POOL = 0;
+my $EMPTYCARTS = 1;
my $DROPBOX = "";
my $LISTALLOWED = 0;
GetOptions ("help!" => \$HELP,
"file=s" => \$FILE,
"pool!" => \$POOL,
+ "empty-carts!" => \$EMPTYCARTS,
"dropbox=s" => \$DROPBOX,
"list-allowed!" => \$LISTALLOWED,
);
if($HELP) {
print << "EOF";
-usage: $0 --file <audio or playlist file> --pool --dropbox <path to dropbox> --list-allowed
+usage: $0 --file <audio or playlist file> --pool --empty-carts --dropbox <path to dropbox> --list-allowed
options:
--file the media file or playlist to import
--pool pool mode, import media files referneced by playlist
+ --empty-carts emtpy out pool of carts before import
--dropbox the path to the dropbox to use
--list-allowed list allowed dropboxes and exit
@@ -102,6 +105,8 @@ sub set_mode_playlist_gui()
$POOL = 1;
my $l_mode = $guixml->get_widget('l_mode');
$l_mode->set_label("<b>Musik Pool</b>");
+ my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
+ $cb_clear_carts->set_sensitive(1);
my $l_file_playlist = $guixml->get_widget('l_file_playlist');
$l_file_playlist->set_label("<b>Playlist</b>");
my $filter = Gtk2::FileFilter->new;
@@ -120,6 +125,8 @@ sub set_mode_file_gui()
$POOL = 0;
my $l_mode = $guixml->get_widget('l_mode');
$l_mode->set_label("<b>Sendung</b>");
+ my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
+ $cb_clear_carts->set_sensitive(0);
my $l_file_playlist = $guixml->get_widget('l_file_playlist');
$l_file_playlist->set_label("<b>Datei</b>");
my $filter = Gtk2::FileFilter->new;
@@ -149,7 +156,11 @@ sub start_import_gui()
my $filechooser = $guixml->get_widget('filechooser');
my $file = $filechooser->get_filename;
if(!$file || -d $file) {
- $l_status->set_label("No Playlist selected!");
+ if($POOL) {
+ $l_status->set_label("Keine Playlist ausgewählt!");
+ } else {
+ $l_status->set_label("Keine Audio Datei ausgewählt!");
+ }
return 0;
}
$filechooser->unselect_all;
@@ -157,7 +168,7 @@ sub start_import_gui()
my $co_dropbox = $guixml->get_widget('co_dropbox');
my $dropbox = $co_dropbox->get_active_text;
- $l_status->set_label("importing from $file");
+ $l_status->set_label("importiere von $file");
my $ret;
if($POOL) {
@@ -209,9 +220,9 @@ if(!$FILE && !$DROPBOX) {
(-e "$FILE") or die "file '$FILE' not found";
if($POOL) {
- print "Will import from playlist $FILE, with user $user\n\n";
+ print "will import from playlist $FILE, with user $user\n\n";
} else {
- print "Will import $FILE, with user $user\n\n";
+ print "will import $FILE, with user $user\n\n";
}
my $ret;
diff --git a/rhimport.glade b/rhimport.glade
index 00ed60e..0cf2e39 100644
--- a/rhimport.glade
+++ b/rhimport.glade
@@ -31,14 +31,6 @@
<widget class="GtkHBox" id="hbox_mode">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="l_dummy_l">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkButton" id="b_mode">
<property name="label" translatable="yes">Modus</property>
<property name="width_request">130</property>
@@ -50,7 +42,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -63,15 +55,21 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="l_dummy_r">
+ <widget class="GtkCheckButton" id="cb_clear_carts">
+ <property name="label" translatable="yes">Vor Import alle Carts leeren</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
</widget>
<packing>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
@@ -127,8 +125,8 @@
<widget class="GtkFileChooserWidget" id="filechooser">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="use_preview_label">False</property>
<property name="preview_widget_active">False</property>
+ <property name="use_preview_label">False</property>
</widget>
<packing>
<property name="position">5</property>